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

Segmentation fault with simple example #255

Closed
DanielSSilva opened this issue Aug 22, 2021 · 7 comments
Closed

Segmentation fault with simple example #255

DanielSSilva opened this issue Aug 22, 2021 · 7 comments

Comments

@DanielSSilva
Copy link

Hi! Let me start by stating that I'm not super familiar with Python and I'm new to using this library. I'm using this library to develop a project with the NeoPixels. I've followed the installation guide and I'm able to get the expected results, however, everytime the program finishes I have a segmentation fault.
From what I was able to understand, this library uses the ws_281x C library, which can be where the problem relies....

Type of Raspberry Pi

Tested on a Rpi3 and Zero W

Linux Kernel version

Linux raspberrypi 5.10.17-v7+ #1414 SMP Fri Apr 30 13:18:35 BST 2021 armv7l GNU/Linux

Expected behaviour

Code run without any issue

Actual behaviour

Message is successfully displayed on the LEDs, but after that I get Segmentation fault, without any further information.

Here's the sample that I'm using

from luma.led_matrix.device import neopixel
from luma.core.legacy import show_message
from luma.core.legacy.font import proportional, SPECCY_FONT #https://luma-core.readthedocs.io/en/latest/_modules/luma/core/legacy/font.html

device = neopixel(width=16, height=7)
device.contrast(50)
def main():
    msg = "Hi!"
    show_message(device, msg, y_offset=-1, fill="green", font=proportional(SPECCY_FONT), scroll_delay=0.04)    

if __name__ == "__main__":
    try:
        main()
    except KeyboardInterrupt:
        pass
@thijstriemstra
Copy link
Collaborator

after that I get Segmentation fault, without any further information.

Can you paste at least the seg fault message? And what python 3 version are you using? can you try a different version?

@DanielSSilva
Copy link
Author

DanielSSilva commented Aug 22, 2021

Can you paste at least the seg fault message?

That's the thing, the only message that I get is "Segmentation fault". There's no stack trace or anything related.

And what python 3 version are you using? can you try a different version?

I've just installed raspbian, so I'm assuming it's either 3.6 or 3.7. I'll try with another version when I get the chance. Should I try with some 3.x, or should it be with 2.x?

@thijstriemstra
Copy link
Collaborator

Only 3.x is supported. Check version with python --version or python3 --version.

@DanielSSilva
Copy link
Author

Here's both the python3 version (3.7.3) as well as the segmentation fault message that I get.
What's the best way to test with other python version? I was googling and seemed to be through pyenv? What's the recommended way to achieve this?
image

@thijstriemstra
Copy link
Collaborator

We have seen more issues with the stock version of Python on Raspbian. If you try latest Python 3.7.x I'm pretty sure the segfault will be gone. Unfortunately I don't see an quick way to upgrade Python on Raspbian, only compile from source.

It should be pretty straightforward though, download .zip file, unpack it and

./configure
make -j4
sudo make install
/usr/local/bin/python3 --version

And then reinstall luma.led_matrix with that new Python version.

@thijstriemstra
Copy link
Collaborator

was googling and seemed to be through pyenv?

ps. i dont use pyenv but it might work as well.

@thijstriemstra
Copy link
Collaborator

If you try latest Python 3.7.x I'm pretty sure the segfault will be gone.

No feedback, closing.

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

2 participants