Python : declaring matrix using rgbmatrix.so loads cpu when using time.sleep

224 Views Asked by At

This is my first post here, so all my apologies if I missed a specific rule of the site.

Here is my point : I have a 16x32 Adafruit Matrix with the Hat for Rpi. The hardware part went with no particular issue.I installed the python and software libraries as described in the documentation. I could also run the demos and even control my matrix (display image, scrolling text, both etc...). But I noticed that -when I run a python matrix related program- my RPi3 CPU load is 100% on one CPU which finally leads to system crash after a while.

I did some extensive tests to understand when this does occur, and here is my conclusion : declaring a matrix with the adafruit library loads the processor when I try to use the time.sleep(n) function.

I am not familiar with libraries compilation, but I cannot figure out why just declaring a variable would generate loading issue.

Here is my demo code :

#!/usr/bin/python             # This is server.py file
# This Python file uses the following encoding: utf-8

import time
from rgbmatrix import Adafruit_RGBmatrix

matrix = Adafruit_RGBmatrix(16, 1)

while True:
   time.sleep(10)

The library used can be found here : rgbmatrix.cc

I understand my question is specific to a trademark but they did not give me any answer on their forum, so I hope a good dev will be able to help me find out what happens, as the time.sleep function is suppose to hold the execution instead of generating a 100% load.

EDIT : This is a bug from Adafruit library... I compiled directly Hzeller led library and the problem was gone.

0

There are 0 best solutions below