You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GLEDOPTO Ethernet locks, stops responding after ESP-NOW sync send #5210
Both the GLEDOPTO GL-C-615WL and GL-C-616WL reach a soft locked state after sending a sync command via ESP-NOW.
To Reproduce Bug
With WLED 0.16.0-alpha (2512190) installed and connected via ethernet:
Enable ESP-NOW in WiFi Settings
Enable "Use ESP-NOW sync" in Sync Interfaces
Under Send, enable Sync on Start, Send Notification on Direct Change, and Send Notification on Button Press.
Navigate to /#Colors
Ensure Sync is enabled in the top nav bar
Make a color change
Device locks
In my tests, it does not automatically recover regardless of time. Power cycling the GLEDOPTO is the only way to get access to the web interface, after which you need to disable sync before it happens again.
Expected Behavior
Expected sync to work as it normally and reliably does.
Install Method
Binary from WLED.me
What version of WLED?
WLED 0.16.0-alpha (2512190)
Which microcontroller/board are you seeing the problem on?
changed the title [-]BUG: GLEDOPTO Ethernet locks, stops responding after ESP-NOW sync send[/-][+]GLEDOPTO Ethernet locks, stops responding after ESP-NOW sync send[/+]on Dec 20, 2025
Hey! This issue has been open for quite some time without any new comments now. It will be closed automatically in a week if no further activity occurs.
Thank you for using WLED! ✨
@adamgranted does this still happen with the beta release?
I have seen similar issues from lockup to crashes when messing with ESPNow, there seem to be deeply rooted bugs in the espressif core libraries, but my issues may not be related as I did not use ETH when seeing that.
Anyway, the core was updated to a newer version a few months back that had some changes to wifi (and therefore ESPNow).
@DedeHai so far so good. I'm dual running 0.16.0-alpha and 16.0.0-beta on identical Gledoptos and the beta install appears to be reliable. This can probably be closed, if I see the issue again I can re-open this or a new issue.
The analysis and patch below were put together by Claude (Anthropic's AI coding assistant) while helping me debug this on my own hardware posting as is since I'm mostly a hobbyist the details are a fair bit above my skill level but I figured if it could help someone then might as well post it. Everything below this is completely generated by the AI so interpret it as you wish
Repro: Enable ESP-NOW + "Use ESP-NOW sync", then change color/brightness/effect from the web UI. Device freezes completely — no crash dump on serial, no auto-recovery, power cycle required. Idle operation is fine; it's specifically triggered by a UI-initiated state change. Reproduced on a custom ESP32-S3-WROOM-1 board (no PSRAM), on both WLED 0.15.4 and 16.0.1.
Root cause, as Claude found it:quickEspNow.send() in notify() (udp.cpp) can be called from ESPAsyncWebServer's async_tcp task (via wsEvent() → deserializeState()) rather than the main loop task that originally called quickEspNow.begin(). Calling into the WiFi/ESP-NOW driver from a task other than the one that initialized it deadlocks it. Confirmed with a WLED_DEBUG build where the serial trace stops dead at ESP-NOW sending first packet. with nothing printed after, every time.
Proposed fix: stage the packet + a pending flag in notify(), and only perform the actual quickEspNow.send() from handleNotifications(), which exclusively runs on the main loop task:
// added near the top of udp.cpp, after the PartialEspNowPacket typedef
#ifndef WLED_DISABLE_ESPNOW
staticuint8_t espNowPendingBuffer[WLEDPACKETSIZE];
staticsize_t espNowPendingSize = 0;
staticvolatilebool espNowSendPending = false;
staticvoidsendEspNowNotify()
{
size_t packetSize = 41;
size_t s = (espNowPendingSize - 41) / UDP_SEG_SIZE;
partial_packet_t buffer = {'W', 0, 1, {0}};
constsize_t bufferSize = sizeof(buffer.data)/sizeof(uint8_t);
size_t s0 = 0;
memcpy(buffer.data, espNowPendingBuffer, packetSize);
for (size_t i = 0; packetSize < bufferSize && i < s; i++) {
memcpy(buffer.data + packetSize, &espNowPendingBuffer[41+i*UDP_SEG_SIZE], UDP_SEG_SIZE);
packetSize += UDP_SEG_SIZE;
s0++;
}
if (s > s0) buffer.noOfPackets += 1 + ((s - s0) * UDP_SEG_SIZE) / bufferSize;
auto err = quickEspNow.send(ESPNOW_BROADCAST_ADDRESS, reinterpret_cast<constuint8_t*>(&buffer), packetSize+3);
if (!err && s0 < s) {
buffer.packet++;
packetSize = 0;
for (size_t i = s0; i < s; i++) {
memcpy(buffer.data + packetSize, &espNowPendingBuffer[41+i*UDP_SEG_SIZE], UDP_SEG_SIZE);
packetSize += UDP_SEG_SIZE;
if (packetSize + UDP_SEG_SIZE < bufferSize) continue;
err = quickEspNow.send(ESPNOW_BROADCAST_ADDRESS, reinterpret_cast<constuint8_t*>(&buffer), packetSize+3);
buffer.packet++;
packetSize = 0;
if (err) break;
}
if (!err && packetSize > 0)
err = quickEspNow.send(ESPNOW_BROADCAST_ADDRESS, reinterpret_cast<constuint8_t*>(&buffer), packetSize+3);
}
}
#endif
In notify(), replace the inline send block with:
if (enableESPNow && useESPNowSync && statusESPNow == ESP_NOW_STATE_ON) {
espNowPendingSize = 41 + s*UDP_SEG_SIZE;
memcpy(espNowPendingBuffer, udpOut, espNowPendingSize);
espNowSendPending = true; // defer - don't touch the driver from this task
}
Result after the fix:espNowSentCB reports status: 0 (success) instead of hanging, and the device stays fully responsive under repeated rapid changes.
Caveats Claude flagged, for transparency: the root cause is a strong, evidence-based hypothesis confirmed by testing, not something traced through the ESP-IDF driver source directly. The fix also uses a simple flag/buffer handoff rather than a mutex-protected queue, so rapid successive updates coalesce (last one wins) rather than all being sent — reasonable for a sync protocol, but worth a maintainer's judgment call if a queued approach is preferred.
The quickEspNow library has known problems with managing the queue, bassicially any reconnect (or switching from wifi to ethernet) causes allocation of a new queue and duplicating the driver task handle. We have completely re-written our own esp-now driver in 17.0, please check if the problem is reproducible using the 17.0 source code frommain.
Moreover the original problem reporter has confirmed the issue is solved in 16.0.0.
@DedeHai i dont see version 17.0
Also @softhack007 I switch to the stable 16.0.1 and it still did it but maybe I need to do a full erase and flash I'll test that as well
Activity
coderabbitai commentedon Dec 19, 2025
📝 CodeRabbit Plan Mode
Generate an implementation plan and prompts that you can use with your favorite coding agent.
Examples
🔗 Similar Issues
Possible Duplicates
Related Issues
🔗 Related PRs
#4844 - Fix broken Sync button after 0.15 refactor [merged]
👤 Suggested Assignees
🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord or schedule a call!
[-]BUG: GLEDOPTO Ethernet locks, stops responding after ESP-NOW sync send[/-][+]GLEDOPTO Ethernet locks, stops responding after ESP-NOW sync send[/+]github-actions commentedon Apr 20, 2026
Hey! This issue has been open for quite some time without any new comments now. It will be closed automatically in a week if no further activity occurs.
Thank you for using WLED! ✨
DedeHai commentedon Apr 22, 2026
@adamgranted does this still happen with the beta release?
I have seen similar issues from lockup to crashes when messing with ESPNow, there seem to be deeply rooted bugs in the espressif core libraries, but my issues may not be related as I did not use ETH when seeing that.
Anyway, the core was updated to a newer version a few months back that had some changes to wifi (and therefore ESPNow).
adamgranted commentedon Apr 24, 2026
@DedeHai so far so good. I'm dual running
0.16.0-alphaand16.0.0-betaon identical Gledoptos and the beta install appears to be reliable. This can probably be closed, if I see the issue again I can re-open this or a new issue.drmaus83 commentedon Sep 21, 2026
The analysis and patch below were put together by Claude (Anthropic's AI coding assistant) while helping me debug this on my own hardware posting as is since I'm mostly a hobbyist the details are a fair bit above my skill level but I figured if it could help someone then might as well post it. Everything below this is completely generated by the AI so interpret it as you wish
Repro: Enable ESP-NOW + "Use ESP-NOW sync", then change color/brightness/effect from the web UI. Device freezes completely — no crash dump on serial, no auto-recovery, power cycle required. Idle operation is fine; it's specifically triggered by a UI-initiated state change. Reproduced on a custom ESP32-S3-WROOM-1 board (no PSRAM), on both WLED 0.15.4 and 16.0.1.
Root cause, as Claude found it:
quickEspNow.send()innotify()(udp.cpp) can be called from ESPAsyncWebServer'sasync_tcptask (viawsEvent()→deserializeState()) rather than the main loop task that originally calledquickEspNow.begin(). Calling into the WiFi/ESP-NOW driver from a task other than the one that initialized it deadlocks it. Confirmed with aWLED_DEBUGbuild where the serial trace stops dead atESP-NOW sending first packet.with nothing printed after, every time.Proposed fix: stage the packet + a pending flag in
notify(), and only perform the actualquickEspNow.send()fromhandleNotifications(), which exclusively runs on the main loop task:In
notify(), replace the inline send block with:And in
handleNotifications():Result after the fix:
espNowSentCBreportsstatus: 0(success) instead of hanging, and the device stays fully responsive under repeated rapid changes.Caveats Claude flagged, for transparency: the root cause is a strong, evidence-based hypothesis confirmed by testing, not something traced through the ESP-IDF driver source directly. The fix also uses a simple flag/buffer handoff rather than a mutex-protected queue, so rapid successive updates coalesce (last one wins) rather than all being sent — reasonable for a sync protocol, but worth a maintainer's judgment call if a queued approach is preferred.
DedeHai commentedon Sep 22, 2026
@drmaus83 this should be fixed with my new espNow driver in 17.0, can you please test that?
softhack007 commentedon Sep 22, 2026
Sorry, but technically speaking this is totally questionable ("BS" in the Harry Frankfurt sense https://en.wikipedia.org/wiki/On_Bullshit). The quickEspNow library used in older releases serialises send requests via an internal queue, there should be no deadlock.
The quickEspNow library has known problems with managing the queue, bassicially any reconnect (or switching from wifi to ethernet) causes allocation of a new queue and duplicating the driver task handle. We have completely re-written our own esp-now driver in 17.0, please check if the problem is reproducible using the 17.0 source code from
main.Moreover the original problem reporter has confirmed the issue is solved in 16.0.0.
drmaus83 commentedon Sep 22, 2026
@DedeHai i dont see version 17.0
Also @softhack007 I switch to the stable 16.0.1 and it still did it but maybe I need to do a full erase and flash I'll test that as well