-
Notifications
You must be signed in to change notification settings - Fork 45
Description
Hi ! I am currently developing something on an ESP32 using ESP IDF and I was adding your library to my project to light up a Neopixel Ring (24 pixels).
I encountered some problems regarding the use of Wi-Fi and FastLED, which I believe I solved (I will describe it later), but now I am stuck with a new problem : On the first call to FastLED.show(), my Ethernet connectivity breaks ; I don't see any receives.
Details on my working environment :
- I'm using an Olimex EVB ESP32 board (with an ESP32 chip, obviously), which has a LAN Port (LAN8720) .
- I'm using ESP IDF (idf.py -- version gives ESP-IDF v4.3-dev-907-g6c17e3a64-dirty ), and Visual Studio Code on Ubuntu.
- I power up my board via USB (5V) and an other USB port (5v) with an adapter powers up my Neopixel Ring. Plus, I added a 10K Ohm resistor on the pin to which the ring is connected. I didn't add the capacitor as recommended on Adafruit website, because my power supply isn't that powerful.
- I connect via LAN my PC and the board to the same router, so there are in the same subnet, and the router gives via DHCP the IPs to them.
- I can use either GPIO 12 / 02 / 04 / 05
- Here's my code to show what I am seeing : I just started my example from your main, so if someone wants to do this on his side, just replace the main folder of this repo. This is not my project, but this example is showing the same issue.
main.zip
I'm also using the RMT driver, by commenting the (#define FASTLED_ESP32_I2S) line in FastLED.h and un-commenting ("platforms/esp/32/clockless_rmt_esp32.cpp") in CMakeLists.txt. Indeed, I am using the WS2812 LED chipset, and as I understood, this uses the RMT driver. Finally, I added a line inside IDF code, in "esp_eth_mac_esp32.c" in component esp_eth, to print transmits of the mac driver :
- ESP_LOGD(TAG, "transmit len= %d, buff len= %d", sent_len, length); // (line226)
As my example is running on the Olimex, I am pinging it with my PC. After the initialization, I have no problem pinging it. But, on the first call to FastLED.show(), receives end, and the device is not responding to my pings. I can stop and restart the Ethernet handler, this won't change any thing. The only way is to destroy it (uninstall the driver), re-install it and restart it again. But once again, on the next show, this will stop working. If I don't restart it, receives don't happen, but also, after a while, I am starting to see that the line in "esp_eth_mac_esp32.c" :
MAC_CHECK(sent_len == length, "insufficient TX buffer size", err, ESP_ERR_INVALID_SIZE); // line227
is reporting an error .
At least, my LED are showing correctly =) .
There is also a Wi-Fi handler initialized, but removing it won't solve the problem.
I have no idea what is causing the PB : I have browsed everywhere, I cannot seem to find anything on that, except this :
espressif/esp-idf#2644
But the person's problem was on the RMT side with RX, not on the Ethernet side.
I don't know if the RMT here is messing with the SPI emac pins ( I don't know why it would do that).
I don't know either if it is interrupt - related ( I also cannot see why it would be because the RMT implementation is not using any I believe). EDIT : I may have been wrong, and I believe now that there are actually interrupts, because the RMT sends the signal in a devided way.
It might be my implementation somehow, but what is in the example is pretty basic (just esp_eth usage and one FastLED controller with not that many pins).
Do you think I have to write an issue on FastLED Github page or on ESP-IDF one's ? I mean if the issue is RMT related and not really FastLED-idf related, I can understand that solving this is not really in your interest.
Otherwise, do you have any idea what might be the issue here ? Ah, and here is a capture of the logging, where we can see during the blinking that no receives happen, until I destroy-restart the eth handler :
PS : The problem I had with the use of Wi-Fi and FastLED was due, I think, to the fact that Wi-Fi main task is pinned to core 0 and doing FastLED.show() in this core would result in wrong LED show, for example, 5 LEDs light up instead of 2. So, I'm now calling show() in a task pinned to core 1, and the problem disappeared. Have you ever seen this issue with Wi-Fi before ? Thank you for reading me !
