PiPixel issue with 'sudo' running the ws2812.json

Brand new install of Raspberry Pi Zero + ws2812 lights

Getting
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

asn1crypto==0.24.0
beautifulsoup4==4.8.0
BiblioPixel==3.4.45
BiblioPixelAnimations==3.20190410.153508
BiblioPixelTriggers==1.0.2
certifi==2018.8.24
chardet==3.0.4
Click==7.0
croniter==0.3.30
cryptography==2.6.1
entrypoints==0.3
Flask==1.1.1
gitdb2==2.0.5
GitPython==3.0.2
idna==2.6
itsdangerous==1.1.0
Jinja2==2.10.1
keyring==17.1.1
keyrings.alt==3.1.1
loady==1.8.10
MarkupSafe==1.1.1
numpy==1.16.2
pycrypto==2.6.1
PyGObject==3.30.4
pyserial==3.4
python-apt==1.8.4
python-dateutil==2.8.0
python-periphery==1.1.2
pyxdg==0.25
PyYAML==5.1.2
requests==2.21.0
rpi-ws281x==1.0.0
SecretStorage==2.3.1
six==1.12.0
smmap2==2.0.5
soupsieve==1.9.3
spidev==3.4
ssh-import-id==5.7
urllib3==1.24.1
Werkzeug==0.15.6

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
main.main()
File “/home/pi/.local/lib/python3.7/site-packages/bibliopixel/main/main.py”, line 31, in main
module.run(args)
File “/home/pi/.local/lib/python3.7/site-packages/bibliopixel/commands/run.py”, line 12, in run
project_runner.run(args)
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.