Skip to content

GLEDOPTO Ethernet locks, stops responding after ESP-NOW sync send #5210

Closed

Description

@adamgranted

What happened?

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:

  1. Enable ESP-NOW in WiFi Settings
  2. Enable "Use ESP-NOW sync" in Sync Interfaces
  3. Under Send, enable Sync on Start, Send Notification on Direct Change, and Send Notification on Button Press.
  4. Navigate to /#Colors
  5. Ensure Sync is enabled in the top nav bar
  6. Make a color change
  7. 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?

Other, ESP32

Relevant log/trace output

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. coderabbitai commented on Dec 19, 2025

    @coderabbitai
    Contributor

    📝 CodeRabbit Plan Mode

    Generate an implementation plan and prompts that you can use with your favorite coding agent.

    • Create Plan
    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:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord or schedule a call!

  2. 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
  3. github-actions commented on Apr 20, 2026

    @github-actions

    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! ✨

  4. added
    stale
    on Apr 20, 2026
  5. DedeHai commented on Apr 22, 2026

    @DedeHai
    Collaborator

    @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).

  6. removed
    stale
    on Apr 22, 2026
  7. adamgranted commented on Apr 24, 2026

    @adamgranted
    Author

    @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.

  8. drmaus83 commented on Sep 21, 2026

    @drmaus83

    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
    static uint8_t espNowPendingBuffer[WLEDPACKETSIZE];
    static size_t  espNowPendingSize = 0;
    static volatile bool espNowSendPending = false;
    
    static void sendEspNowNotify()
    {
      size_t packetSize = 41;
      size_t s = (espNowPendingSize - 41) / UDP_SEG_SIZE;
      partial_packet_t buffer = {'W', 0, 1, {0}};
      const size_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<const uint8_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<const uint8_t*>(&buffer), packetSize+3);
          buffer.packet++;
          packetSize = 0;
          if (err) break;
        }
        if (!err && packetSize > 0)
          err = quickEspNow.send(ESPNOW_BROADCAST_ADDRESS, reinterpret_cast<const uint8_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
    }

    And in handleNotifications():

    #ifndef WLED_DISABLE_ESPNOW
      if (espNowSendPending) {
        espNowSendPending = false;
        sendEspNowNotify();
      }
    #endif

    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.

  9. DedeHai commented on Sep 22, 2026

    @DedeHai
    Collaborator

    @drmaus83 this should be fixed with my new espNow driver in 17.0, can you please test that?

  10. softhack007 commented on Sep 22, 2026

    @softhack007
    Member

    Calling into the WiFi/ESP-NOW driver from a task other than the one that initialized it deadlocks it.

    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 frommain.

    Moreover the original problem reporter has confirmed the issue is solved in 16.0.0.

  11. drmaus83 commented on Sep 22, 2026

    @drmaus83

    @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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions