Replies: 5 comments 7 replies
-
Since I was interested in doing a similar project in Micropython (this one to be precise). The conclusion of my research was that this not trivial in Arduino (due to the non flexible timing of the neopixels), and likely impossible in Micropython (besides one strip): I have used with 8 strips in parallel the Adafruit_NeoPXL8 library (up to eight strips, needs samd21, samd51, rp2040 or ESP32S3 controllers) |
Beta Was this translation helpful? Give feedback.
-
No, none of the available Neopixel libraries (that I'm aware of!) perform parallel updates; you'll need to look at your own low-level implementation. Using multiple channels of RMT seems like it would be the most promising approach. You may also want to consider investigating the Raspberry Pi Pico as there has been a lot of activity driving Neopixels by PIO. |
Beta Was this translation helpful? Give feedback.
-
It appears there is no readily available library to use. I'm going to try to make an implementation myself, but I'm unsure if I manage to pull it off.
For timing, this means the following : When sending a 0 bit, the pin should be set high between 200 and 500 ns. Sending a 1, the pin is allowed high between 550 and 5500 ns. After sending a bit (0 or 1) there is about 5000 ns before the next bit must be sent. This timing is not fixed as long as the next bit is sent before the reset. With these constrains, it is not necessary to send the bits in a fixed frequency. It's therefore also not needed to write to all strings in a fixed order. I'm currently considering the following logic :
The above code is of course a bit simplified. I need to have a couple of open questions answered before I can start implementing anything.
Since I'm driving > 1000 pixels, it's irrelevant how much power the esp32 will use. The power consumption of the ep32 will not significant contribute to the power consumption of the complete project. |
Beta Was this translation helpful? Give feedback.
-
So is there a library the controls WS2812B thru ESP32 using micropython? Is it possible? |
Beta Was this translation helpful? Give feedback.
-
I did some experimentation today to check what the capabilities within micropython are. After some experimentation with the clock functions, I couldn't make 2 calls to time.ticks_cpu() faster than 661 clock cycles apart. Much too slow for transferring the data. To confirm, I wrote a very simple program to sent data to the neopixel
As expected, the first neopixel light up full brightness. This implementation is too slow to have any chance of sending a 0. Setting a pin high or low takes around 1000 / 4000 (I could not get a consistent reading) according to time.ticks_cpu(). I will explore some other options now. Would it be feasible to take a similar approach in C ? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Dear all,
I'm currently working on a project to automatically map a lot of ws2812b pixels in a tree. The mapping and calculations itself are done in python, and I run MicroPython on a ESP32 to drive the pixels.
On the ESP32, I use asyncio.start_server to receive data.
The build in neopixel library is used to send data to the led.
The relevant code for showing the led
The combination is working, but the performance is not what I expect. The servers appear to be not fully stable, and the frame rate is a bit low. (8 frames / sec).
I'm looking for a solution to increase the frame rate. At the moment data is first send to string1 and when complete, send to string2. I would like to send the data to both strings in parallel. I can't seem to find this option in the neopixel library. Are there any libraries supporting parallel data?
I plan to increase the number of to about 1000 pixels in the project. For the hardware, I would like to have up to 10 strings containing 100/150 pixels each. Writing 10 streams in parallel would considerately decrease the time to send a single frame. At the moment, I don't know if I can find 10 suitable pins on the esp32, but that's a different issue.
If relevant, the complete code is available at https://github.com/Lahaije/PixelTree/tree/main/src/MicroPython
esp32-20220618-v1.19.1.bin is installed at the ESP32
Beta Was this translation helpful? Give feedback.
All reactions