hzeller / rpi-rgb-led-matrix

Controlling up to three chains of 64x64, 32x32, 16x32 or similar RGB LED displays using Raspberry Pi GPIO
GNU General Public License v2.0
3.64k stars 1.16k forks source link

FYI #1654

Open MiguelElBigodon opened 4 months ago

MiguelElBigodon commented 4 months ago

I have the following error: FYI: not running as root which means we can't properly control timing unless this is a real-time kernel. Expect color degradation. Consider running as root with sudo.

How can I solve this problem?

I have the adafruit matrix hat+real time clock board, two 16x32 matrices and a Raspberry Pi 4b.

hzeller commented 4 months ago

On Thu, May 16, 2024, 11:48 MiguelElBigodon @.***> wrote:

I have the following error: FYI: not running as root which means we can't properly control timing unless this is a real-time kernel. Expect color degradation. Consider running as root with sudo.

How can I solve this problem?

Run with sudo

I have the adafruit matrix hat+real time clock board, two 16x32 matrices

and a Raspberry Pi 4b.

— Reply to this email directly, view it on GitHub https://github.com/hzeller/rpi-rgb-led-matrix/issues/1654, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABCNCJ5QUN4EJTQIHHFSYDZCT5QJAVCNFSM6AAAAABH2YW4YCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGMYDCMJQG4ZDAMI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

MiguelElBigodon commented 4 months ago

The problem:

sudo python3 /home/migasboss/rpi-rgb-led-matrix/bindings/python/samples/runtext.py Press CTRL-C to stop sample Traceback (most recent call last): File "/home/migasboss/rpi-rgb-led-matrix/bindings/python/samples/runtext.py", line 33, in File "/home/migasboss/rpi-rgb-led-matrix/bindings/python/samples/samplebase.py", line 76, in process File "/home/migasboss/rpi-rgb-led-matrix/bindings/python/samples/runtext.py", line 14, in run File "graphics.pyx", line 32, in rgbmatrix.graphics.Font.LoadFont Exception: Couldn't load font ../../../fonts/4x6.bdf

Fonts imagem IMG_20240516_202842.jpg

Runtext: from samplebase import SampleBase from rgbmatrix import graphics import time class RunText(SampleBase): def init(self, *args, *kwargs): super(RunText, self).init(args, **kwargs) self.parser.add_argument("-t", "--text", help="The text to scroll on the RGB LED panel", default="MECATRONICA") def run(self): offscreen_canvas = self.matrix.CreateFrameCanvas() font = graphics.Font() font.LoadFont("../../../fonts/4x6.bdf") textColor = graphics.Color(255, 255, 0) pos = offscreen_canvas.width my_text = self.args.text while True: offscreen_canvas.Clear() len = graphics.DrawText(offscreen_canvas, font, pos, 25, textColor, my_text) pos -= 1 if (pos + len < 0): pos = offscreen_canvas.width time.sleep(0.05) offscreen_canvas = self.matrix.SwapOnVSync(offscreen_canvas) # Main function if name == "main": run_text = RunText() if (not run_text.process()): run_text.print_help()

MiguelElBigodon commented 4 months ago

I'm having the problem mentioned above, which says I don't have the bdf files but they're all in the folder where they should be.

davemaster commented 4 months ago

A little more reading of "README.MD" in this repository, and problem solved... a little more. An advice, before using python scripts, try using the demo within the examples-api-use folder.

Best regards

PD. IN python, the code must be PERFECTLY indented, otherwise... ERROR everywhere...