vanshksingh / Pi5Neo

Library to Control Neopixel on Raspberry Pi 5 using python
MIT License
6 stars 4 forks source link

Longer LED chains do not work correctly #2

Open jrwrodgers opened 1 week ago

jrwrodgers commented 1 week ago

@vanshksingh When using this library and the example code with 256 LEDs - some after #178 are not the expected colour and then some beyond around #200 don't light up at all. I logged the data pin with an analyser and got the following for a single red led instruction.

Is the data packet terminated correctly and should it stay low? Is this why as more LED's are using bits might be lost? Is the full data packet being sent with xfer? or is xfer2 needed? image

vanshksingh commented 1 week ago

Library uses xfer3 right now , previously it was xfer2

My best guess why it fails is , the 3.3v line , jut not enough power for long length transmission...

Can you tell me more about how you are powering the setup ? And any step up that you have/may implement for 3.3v to 5v conversion ?

I recently got an 1 meter strip of neopixel to test the lib , but I think it will fall short of the 256 mark

jrwrodgers commented 1 week ago

@vanshksingh I'm using a dedicated 5v power supply for the LED's - its a XLSEMI XL4016 .. and able to deliver 8A. I think 255 LEDs draws (50mA each on white) ~ 3A so should have plenty of headroom. The digital signal is from the raspi 5 on GPIO 10 (MOSI). See image of an attempt to light all LEDs in red. If I reduce the number of LEDs then it works fine. image

I wondered if its because the expected digital signal should have a low between each LED packet but with the MOSI line it stays high? image Then at some point it misses one of the color bytes and changes red to blue... and then doesnt have enough info to have any color?

Apologies if I'm talking nonsense, this is all new to me so I'm on a steep learning curve.

Are there any tests you would like me to try?

Also for reference this is the code I'm using: from pi5neo import Pi5Neo import time neo = Pi5Neo('/dev/spidev0.0', 255, 800) for i in range(1): print(i) neo.clear_strip() neo.fill_strip(50,0,0) neo.update_strip() time.sleep(5) time.sleep(1) neo.clear_strip() neo.update_strip()

vanshksingh commented 4 days ago

I would say this is an very good issue being pointed out

I can only guess at this point of time , as xfer 3 should have eliminated the issue , see here

I think ill have to buy a similar strip and test it myself to fix it (if it can be fixed)

My only guess is voltage drop OR it can also the be type of the led at play like 1 and 2

Apologies if I'm talking nonsense, this is all new to me so I'm on a steep learning curve.

I am actually quite impressed with the oscilloscope readings

wdebusschere commented 3 days ago

@jrwrodgers @vanshksingh

I’m experiencing an issue where only a maximum of 171 LEDs work on my 300 LED strip. Here are the details:

•   With 171 LEDs, all light up red as expected.
•   With 200 LEDs, the first 29 are blue, and the next 142 are red (totaling 171 functional LEDs).
•   With 172 LEDs, the first is blue, and the remaining 170 are red. (see photo)
•   With 300 LEDs, the first 129 are blue, and only 42 are red.

Screenshot 2024-10-01 at 11 04 02

I also tested with neopixel_spi i can access more leds, but its also behaving weird, random lights light up..