-
Notifications
You must be signed in to change notification settings - Fork 131
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
What to do if you see: ws2811_init failed with code -1 #70
Comments
gives
|
Zero v1.3
Building and running rpi_ws281x lib straight actually works, but unicorn fails with -1. |
I am having this problem on a Picture Zero W. |
Same issue here on Pi Zero W (with latest apt-get update etc).
|
I rebuilt the rpi_ws2811 library on my pi w and it works fine now. |
interesting... recompiled from the repo you mean, right? hum, yes, we have been thinking it's the pypi distributed source that somehow is dodgy in some way, though at a quick glance it wasn't obvious. Certainly the source in this repo is what we tested against the zero W. |
I cloned this repo and recompiled the C library locally. I then ran setup.py. My intention was simply to add better error messages, rather than -1 for all cases. Once recompiled it started working and I never saw the errors codes I had added. |
I was having the exact same issue until I realized that I simply forgot to run my python scripts as root. |
cat /proc/cpuinfo | grep Revision |
The NanoPi neo Core is not a Raspberry Pi board and will not work with rpi_ws281x. You'd need to figure out how to exploit its hardware features to generate a WS281X-compatible signal, or get Googling and see if someone else has done so. While rpi_ws281x is extremely specific to the Pi hardware, the techniques it uses are likely portable by someone with the right documentation, expertise and inclination. Looks like there's been interest in ws2812 on the NanoPi since at least 2016 with nobody rising to the challenge, so YMMV - http://www.friendlyarm.net/forum/topic/6839 The easy solution? Buy a Raspberry Pi. |
Update
The
rpi_ws281x
part of the library has been moved out of this GitHub repository to its own home at: https://github.com/pimoroni/rpi_ws281x-python which will eventually build against the upstream version of the C source.This newer version includes more detailed error messages and exit codes, you can look them up here: https://github.com/jgarff/rpi_ws281x/blob/f56929f79e75e253ca5bd230efb728c39f413e2b/ws2811.h#L93-L108
The correct error code for an unsupported hardware revision is now
-3
, if you see this code please follow the instructions below.Original post for posterity:
If you see the
ws2811_init failed with code -1
message, a number of things could be going wrong since the error -1 is returned for all exceptions when initializing the ws2811 library.The most common cause thus far, however, is a new, or unknown revision of Raspberry Pi which is not logged in the
rpihw.c
file. To determine your revision number run:Compare this against the numbers in: https://github.com/pimoroni/unicorn-hat/blob/master/library/rpi-ws281x/lib/rpihw.c
If you don't see your revision number there, let us know. You should also submit an issue against https://github.com/jgarff/rpi_ws281x, with details of your Pi.
The text was updated successfully, but these errors were encountered: