Skip to content

ESP-NOW not functioning on latest build #4655

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
A6uh opened this issue Apr 22, 2025 · 9 comments
Open
1 task done

ESP-NOW not functioning on latest build #4655

A6uh opened this issue Apr 22, 2025 · 9 comments
Labels
cannot reproduce Developers are not able reproduce. Might be fixed already, or report is missing important details

Comments

@A6uh
Copy link

A6uh commented Apr 22, 2025

What happened?

Wizmote not being detected on latest build. Manually inputting the known Wizmote address also doesn’t yield any results when pressing buttons.

To Reproduce Bug

Flash WLED 0.16.0-alpha (build 2412040) to ESP-32
Attempt to pair ESP-NOW remote

Expected Behavior

It should be detecting the ESP-NOW remote address, and after pairing, should respond to button input.

Install Method

Binary from WLED.me

What version of WLED?

WLED 0.16.0-alpha (build 2412040)

Which microcontroller/board are you seeing the problem on?

ESP32

Relevant log/trace output

Anything else?

Reverting to WLED 0.15 release resolves the issue.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@A6uh A6uh added the bug label Apr 22, 2025
@DedeHai DedeHai added cannot reproduce Developers are not able reproduce. Might be fixed already, or report is missing important details and removed bug labels Apr 23, 2025
@DedeHai
Copy link
Collaborator

DedeHai commented Apr 23, 2025

works perfectly fine. make sure you have wifi sleep disabled.

@DedeHai DedeHai closed this as completed Apr 23, 2025
@A6uh
Copy link
Author

A6uh commented Apr 23, 2025

Could you double check this with a freshly flashed ESP32 or delete the wifi network from an existing one? It appears that ESP-NOW only doesn't work if the ESP isn't actively connected to a wifi network. If the ESP does have an active wifi connection, ESP-NOW will function correctly.

I've been connecting to the WLED AP, and trying to setup the remote. This works on 0.15 without an active WiFi connection.

Unfortunately the project I'm trying to use it for, won't be anywhere near a WiFi network to connect to.

@A6uh
Copy link
Author

A6uh commented Apr 23, 2025

Here are some logs I collected. ESP-NOW was enabled and wifi sleep was disabled by default. When I connect to a wifi network is on line 446.

https://pastebin.com/jUeNbRmz

I found a better workaround as well, if you set the network SSID and password to random characters and 'save & connect' it enables ESP-NOW without needing a real WiFi network. Until you do that, ESP-NOW is never actually enabled.

@DedeHai DedeHai reopened this Apr 24, 2025
@DedeHai
Copy link
Collaborator

DedeHai commented Apr 24, 2025

interesting find, not sure that is a bug or intentional or a HW limitation. Did this ever work in older versions?

@blazoncek
Copy link
Collaborator

@A6uh how far have you researched ESP-NOW? It will help you understand where the problem is after you do that.

Brief recap: As WiFi and ESP-NOW share same circuitry they can't work independently. If you want uninterrupted ESP-NOW packets between two ESP devices they have to:

  1. be connected to the same WiFi channel
  2. must have WiFi disabled and still use same channel for ESP-NOW
  3. be in AP mode on the same channel

Once these are fulfilled, ESP-NOW will work as expected. WLED is designed to operate either in 1) or in 3) mode.

I've been working on correct ESP-NOW implementation for over a year now and best take is available in my fork but it may still have quirks.

As for Wizmote: It is an interesting beast. It uses ESP32 inside which will broadcast (proprietary) message on every possible channel in brief bursts. This allows any ESP device to pick ESP-NOW packet on the channel it is currently connected (or configured) to. However if a device has WiFi configured but is not connected to it will switch channels several times per second while searching for WiFi SSID it is configured to. This makes working ESP-NOW difficult as channels change very often.

@A6uh
Copy link
Author

A6uh commented Apr 24, 2025

(3) is actually where I think the issue is. If you look at line 451 in those logs, ESP-NOW doesn't actually enter AP mode at all until you try connecting to a WiFi network. Up until then, it doesn't initialize. Shortly after on 487 it stops ESP-NOW, then reenables it in STA mode on 494. I assume STA mode is (1).

I figure it should have been initializing ESP-NOW's AP mode once it was enabled in the UI.

Oh and to answer @DedeHai 's question, yes it did work correctly on 0.15. That's how I originally solved it in the meantime.

Edit:
These are logs from WLED 0.15
As soon as you enable ESP-NOW and save, it enters AP mode. (line 74 and 79) This isn't happening on 0.16
https://pastebin.com/3G5nQueF

Also, it seems the only reason using a dummy network on 0.16 is because each time it tries to connect, it also initializes ESP-NOW AP mode. So probably not a stable workaround lol. These are logs showing that.
https://pastebin.com/eTXXvZgM

@blazoncek
Copy link
Collaborator

Dare to take my fork for a spin? Use stable branch.

@A6uh
Copy link
Author

A6uh commented Apr 24, 2025

It looks like your fork kind of has the same issue. Once ESP-NOW is enabled in the UI, ESP-NOW isn't initialized and put into AP mode. However, if you restart the ESP32 afterwards, it puts ESP-NOW into AP mode while it's starting up. Then it works great!

Unfortunately just restarting the ESP32 doesn't fix it for WLED 0.16.0

@blazoncek
Copy link
Collaborator

Once ESP-NOW is enabled in the UI, ESP-NOW isn't initialized and put into AP mode

That is "normal" and as "designed". I'm not saying that it is correct.
However, ESP-NOW in my fork is designed to work in "temporary AP mode".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cannot reproduce Developers are not able reproduce. Might be fixed already, or report is missing important details
Projects
None yet
Development

No branches or pull requests

3 participants