PiPixel issue with 'sudo' running the ws2812.json

Brand new install of Raspberry Pi Zero + ws2812 lights

PiWS281X driver needs to be run as sudo. Rerun it with sudo, like this: sudo bp -v run ws2812.json

But then I get
sudo: bp: command not found

I get that there is some issue with $PATH, but then also Im hearing theres a way to set permissions on the SPI pin which im not sure i need ?(a PiPixel with jumper on GPIO18). There are some stack overflow threads about how to run a sudo command while preserving the env of the user, all confusing and nothing seems to work.

Was it a matter of installing things incorrectly? Also I didnt install my python using virtualenv, but im not sure that could matter? thanks!

You do, in fact need sudo when using WS2812 lights unfortunately. Nothing to change with SPI as it’s not actually using SPI.
But the easiest way to run it is: sudo $(which bp) -v run ws2812.json
The other option is to run: which bp which will output a full path and then run it using that full path:
sudo /user/bin/bp -v run ws2812.json
That may be the right path, but not sure… don’t have a Pi I can pull up at the moment.
Hope that helps! Let me know if still confused.

Thanks! the results of both are:

Traceback (most recent call last):
File “/home/pi/.local/bin/bp”, line 12, in
from bibliopixel.main import main
ModuleNotFoundError: No module named ‘bibliopixel’

The OS is buster if that helps. I feel like followed the instructions pretty well.

Raspbian buster or just Debian buster?
How did you install it? Just pip3 install bibliopixel ??
This is a bit odd… which trick is what I always do.
Try this: sudo $(which python3) -m bibliopixel -v run ws2812.json

ok! thx for the patience on this. I get:
/usr/bin/python3: No module named bibliopixel

How did you install it?
What’s the output of pip3 freeze?
I would say it’s just not installed for python3


Raspbian buster 2019-07-10 (lite image)

Running this (now) outputs 23 lines of: Requirement already satisfied:

It could very well be that in my first install attempt i was looking at old documentation, or got confused and just did pip instead of pip3

when I run:
$ bp run -v ws2812.json

Can’t open /dev/mem: Permission denied
ERROR - project_runner - 1 project failed

15-09-2019:17:35:58,146 ERROR [project_runner.py:193] 1 project failed

ERROR - project_runner - Unable to create drivers

The PiWS281X driver needs to be run as sudo. Rerun it with sudo, like this:
sudo bp run -v ws2812.json

ws2811_init failed with code -5 (mmap() failed)

15-09-2019:17:35:58,159 ERROR [project_runner.py:196] Unable to create drivers

The PiWS281X driver needs to be run as sudo. Rerun it with sudo, like this:
sudo bp run -v ws2812.json

ws2811_init failed with code -5 (mmap() failed)

Traceback (most recent call last):
File “/home/pi/.local/bin/bp”, line 16, in
File “/home/pi/.local/lib/python3.7/site-packages/bibliopixel/main/main.py”, line 31, in main
File “/home/pi/.local/lib/python3.7/site-packages/bibliopixel/commands/run.py”, line 12, in run
File “/home/pi/.local/lib/python3.7/site-packages/bibliopixel/project/project_runner.py”, line 27, in run
projects = _get_projects(args)
File “/home/pi/.local/lib/python3.7/site-packages/bibliopixel/project/project_runner.py”, line 199, in _get_projects
raise ValueError(‘Run aborted’)
ValueError: Run aborted

Yeah, you’ve clearly got it installed, but I’ve never seen running it with sudo fail to work as described.
Is there any possibility of starting with a fresh raspbian install?
the other thought is to uninstall bibliopixel then try reinstalling but this time run sudo pip3 install bibliopixel

sure ive got a few spare pi zero w, Ill document a complete install beginning to end and make it available here

here’s oddness

$ sudo pip3 uninstall bibliopixel

Skipping bibliopixel as it is not installed.

OK this started downloading a bunch of stuff…

then I ran: pip3 freeze

and it was the exactly same, line by line of the previous output.

then I ran:
sudo $(which python3) -m bibliopixel -v run ws2812.json
which produced:

/usr/bin/python3: No module named bibliopixel.main; ‘bibliopixel’ is a package and cannot be directly executed

but now when i run:
sudo $(which bp) -v run ws2812.json

WARNING - animation_threading - Frame-time of 33ms set, but took 46ms
15-09-2019:18:21:50,221 WARNING [animation_threading.py:47] Frame-time of 33ms set, but took 46ms

which appears to be working! Thanks so much!

Awesome! The python3 -m command was wrong. I goofed, so don’t worry about it :wink:
Glad it’s working!

Wow, thanks for this thread. Somehow I fell into exactly the same hole.

Working through the steps here to hopefully get up and running.

Thanks guys, I’ve got it running. Had to install rip_ws281x but now I’m seeing the same…

WARNING - animation_threading - Frame-time of 33ms set, but took 34ms

No LEDs lighting up through the PiPixel but I’m using a new 5v 3A power supply through the barrel connector on the PiPixel which I’ve never done before. I also have another PiPixel to swap out and try so I’ve got a few troubleshooting steps to run through. Let me know if you have any suggestions off the top of your head.

Did you move the jumper to be on GP18 (or GP13) instead of SPI?
If it is and still not working take a pic of your hookup and post here. Either that the LEDs aren’t getting power or the data isn’t getting through.

It looks like the data is not getting through somehow. I confirmed that I’v got 5.2v coming out of the PiPixel. I tried with an adafruit ring and a geod with a single LED. Both have been lit before. I’ve got another assembled PiPixel I can swap out and try too.

I’m running this…

I just changed the num to 32 for the ring and 1 for the geod.