Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FYI #1654

Open
MiguelElBigodon opened this issue May 16, 2024 · 4 comments
Open

FYI #1654

MiguelElBigodon opened this issue May 16, 2024 · 4 comments

Comments

@MiguelElBigodon
Copy link

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
Copy link
Owner

hzeller commented May 16, 2024 via email

@MiguelElBigodon
Copy link
Author

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
Copy link
Author

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
Copy link

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants