Closed Theauxm closed 3 years ago
The installation wasn't in the correct place. had to move the neopixel.py file from the rpi_ws281x library into the actual python3.7 package list.
Glad you were able to solve it, is there anything I should update in the documentation to help others who may run into this?
A list of things I ran into when working through getting this to work properly that the documentation could use:
Raspberry Pi 4b is also compatible, and uses GPIO12 as the PWM output. I didn't need a logic converter, I just have a 5V 200W (40A) power supply.
Had a difficult time figuring out how to install NeoPixelBus on a headless installation of Raspbian. Looks like a UI (head..full?) is required, and to be downloaded from here: https://www.arduino.cc/en/Main/Software (Linux ARM 32 bits)
I needed to also install rpi_ws281x separately, https://github.com/jgarff/rpi_ws281x , though I did do this before the NeoPixelBus installation which may have it already installed. I then had to run the following to build it:
/rpi_ws281x $ sudo scons
/rpi_ws281x $ cd python
/rpi_ws281x/python $ sudo python3 setup.py build
/rpi_ws281x/python $ sudo mv /usr/local/lib/python3.7/dist-packages/neopixel.py /home/pi/Desktop
/rpi_ws281x/python $ sudo mv /home/pi/rpi_ws281x/build/lib.linux-armv7l-3.7/neopixel.py /usr/local/lib/python3.7/dist-packages/
What this does is builds the repo, then moves the correct neopixel.py file into the python distribution packages so it can be imported correctly in visualization.py.
The neopixelbus is only for Arduino, I actually edited that an hour or so ago because I realized I put it in the Raspberry pi section rather than the Arduino section.
I'll look a little more into the other things you've mentioned. I only have experience with the arduino side of things and don't own a raspberry pi so I can't be of too much help on that front but I'm open to any suggestions you may have that could improve documentation.
Ok so I helped a friend set one up. Here's some more stuff we think would be best to add to the documentation:
I feel like a good portion of people will not have an extra monitor to easily set this up (as it ALL can be done via some terminal), so a suggestion would be how to add ssh and install raspbian (Make sure you're adding the ssh files to the boot DRIVE on linux rather than the boot DIRECTORY) to the pi. Even just putting those links would be an immense help.
Second, this repo needs to be added to the documentation. It currently does not say it needs to be installed to run strandtest.py. There may be an issue with packages as I mentioned in my previous comment. (Maybe also give instructions on how to build with scons && sudo python3 setup.py build).
To summarize:
On line: Connect a PWM GPIO pin on the Raspberry Pi to the data pin on the LED strip. If using the Raspberry Pi 2 or 3, then try Pin 18(GPIO5). Append: If using the Raspberry Pi 4b, try GPIO 13. Links to the GPIO pin DATASHEET
Add a section for the rpi_2812x GitHub installation. Please add how to build it. Says it on the repo's readme but might be helpful. Apparently it doesn't build correctly. So this will need to be added as an example: What I'm doing is moving the built python file into the python package list, or else an error appears when trying to run strandtest.py.
/rpi_ws281x $ sudo scons
/rpi_ws281x $ cd python
/rpi_ws281x/python $ sudo python3 setup.py build
/rpi_ws281x/python $ sudo mv /usr/local/lib/python3.7/dist-packages/neopixel.py /home/pi/Desktop
/rpi_ws281x/python $ sudo mv /home/pi/rpi_ws281x/build/lib.linux-armv7l-3.7/neopixel.py /usr/local/lib/python3.7/dist-packages/
Add the raspbian OS and ssh install links. Include: If using Linux to install OS, make sure you're adding the ssh files to the boot DRIVE rather than the boot DIRECTORY.
Getting the following error when trying to run led.py,
attributeerror: module 'neopixel' has no attribute 'adafruit_neopixel'
Though I have the rpi_ws281x library installed from here: https://github.com/jgarff/rpi_ws281x
And in neopixel.py it has the following code:
class Adafruit_NeoPixel(object): def init(self, num, pin, freq_hz=800000, dma=10, invert=False, brightness=255, channel=0, strip_type=ws.WS2811_STRIP_RGB):
so it obviously exists..? What am I doing wrong?