ESPNOW and WIFI channels

davnec
Posts: 5
Joined: Mon Jul 10, 2017 8:14 am

ESPNOW and WIFI channels

Postby davnec » Tue Dec 06, 2022 10:04 am

Hi at all, I'm sorry to repropose this argument that already discussed in this formum, but I don't found a clear solutio (if exists..)

I'm working on refactoring of an old firmware that connect two device
First connected to WIFI and communicate via ESP-Now with second remote device.

The main problem is that the AP can change the wifi channel dinamically and consequently the esp-now channel.
The remote device cannot have access to wifi.

The old firmware use a trik to solve this problem

- The remote listens on the channel 1
- The master set the wifi channel to 1 with

Code: Select all

esp_wifi_set_channel(0x01, WIFI_SECOND_CHAN_NONE);
- The master send a message containing the real wifi channel and then change again the channel to the real wifi
- The remote send the response on the real wifi channel

I know that it's a little devilish, but works on the old IDF (I don't know the exact version)

but on the new version (actual release 5.0) i have the message
wifi:STA is scanning or connecting, or AP has connected with external STAs, cannot set channel

I read a lot of post, but I did not find it clearly written if there is a workaround to solve this issue.

Thanks a lot

Davide

Who is online

Users browsing this forum: No registered users and 165 guests