scottlawsonbc / audio-reactive-led-strip

:musical_note: :rainbow: Real-time LED strip music visualization using Python and the ESP8266 or Raspberry Pi
MIT License
2.67k stars 642 forks source link

Can't run led.py #284

Closed Theauxm closed 3 years ago

Theauxm commented 3 years ago

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?

Theauxm commented 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.

joeybab3 commented 3 years ago

Glad you were able to solve it, is there anything I should update in the documentation to help others who may run into this?

Theauxm commented 3 years ago

A list of things I ran into when working through getting this to work properly that the documentation could use:

/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.

joeybab3 commented 3 years ago

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.

Theauxm commented 3 years ago

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).

Theauxm commented 3 years ago

To summarize: