audio-reactive-led-strip
audio-reactive-led-strip copied to clipboard
m = m (VALUE ERROR: bytes must be in range(0, 256))
So i do everything correctly, run the visualization code to get everything going, and I get this error in spyder (python).
" File "C:\Users\Ryan\Desktop\audio-reactive-led-strip-master\python\led.py", line 81, in _update_esp8266 m = m if _is_python_2 else bytes(m)
ValueError: bytes must be in range(0, 256) "
The error is rooted in the led.py script in this section of code:
I'm not sure how to get past this and have been working on this project for months now trying to get it to work. Can anyone please help?
So it looks like an element of m is not within range(0,256). This could be due to a number of different things, looking at what goes into m.
- How many pixels are in your strip? More than 255 won't work for this reason
- Are any of the values in p not within range? Any of them being out of range would also cause this error.
Thank you so much! I do have more than 255 pixels in my strip, but I changed the variables so it was only controlling 200. Ran it again, now my LED strip is just white and not changing colors.
The esp8266 (Node MCU) says its connected to the internet and the IP addresses match within the python code and arduino code, but still no color changes
Do you think it could be something to do with the security options on my computer blocking the communication from the python code to the esp8266?
Considering it managed to set all the LEDs white, I doubt that's the case. Have you modified anything else? Could you give some more information?
Have a look at the array p, in led.py, just before it is sent. Are all the values 255?
The only other idea I have is this: I have had a similar error before, where if the strip was turned on before the visualisation.py program runs, then the strip seems to get "maxed out" all white when the program first loads. Try running the program with audio playing, then turning on and connecting the strip.
On Dec 18, 2017 22:54, "miller22time" [email protected] wrote:
Do you think it could be something to do with the security options on my computer blocking the communication from the python code to the esp8266?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/scottlawsonbc/audio-reactive-led-strip/issues/99#issuecomment-352584051, or mute the thread https://github.com/notifications/unsubscribe-auth/Ae5azM5fXhECIXIW5XEXg-NP9lADM7tBks5tBu0YgaJpZM4RGGSd .
You might have a wierd strip that is expecting grb or rgb or rgbw data, have you tried my fork with the neopixelbus library?
Yeah, I use that one too. The strip is fine otherwise. Check out my fork for beat detection, new effects etc :)
On 19 December 2017 at 00:23, Joey Babcock [email protected] wrote:
You might have a wierd strip that is expecting grb or rgb or rgbw data, have you tried my fork with the neopixelbus library?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/scottlawsonbc/audio-reactive-led-strip/issues/99#issuecomment-352600459, or mute the thread https://github.com/notifications/unsubscribe-auth/Ae5azCXsAgtsxoU7nDDvyHps8NSsHGgMks5tBwICgaJpZM4RGGSd .
I bought an entirely new strip and am waiting for it to come just to test your fork
Gosh, I'm honoured. Enjoy!
On Dec 19, 2017 00:50, "Joey Babcock" [email protected] wrote:
I bought an entirely new strip and am waiting for it to come just to test your fork
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/scottlawsonbc/audio-reactive-led-strip/issues/99#issuecomment-352604952, or mute the thread https://github.com/notifications/unsubscribe-auth/Ae5azOu65iPnAfFIkVP8eYYNF8MHrI-Iks5tBwhrgaJpZM4RGGSd .
I looked at array P and the values are all 0! This is odd but hopefully this is what is causing my strip to act weird! Would you know how to fix this?
What happens if you run led.py? Running this file will run a test of the LED strip. Does the test work correctly?