-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Changing channel breaks ESP-Now Master/Slave example #2653
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
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This stale issue has been automatically closed. Thank you for your contributions. |
Can someone comment on why this occurs? |
Support seems none-existent. |
was this solved? |
This needs to be checked, reopening. |
Can you please take a look @me-no-dev? |
@VojtechBartoska I'm not sure what the problem was. it seems like OP tried to set one channel for master and another for slave and expected the code to work. Should be closed IMHO |
is anyone able to retest this on v2.0.3? Thanks in advance! |
I had a similar situation with ESP8266. On investigation I found that even when we set channel as anything other than 1 while adding peers, the device doesn't execute that. The solution that I found with esp8266 is that we need to first set the channel with wifi.begin and then disconnect wifi with wifi.disconnect and proceed with adding peer. In Code it would look like below.
|
Hi,
@VojtechBartoska Same on my side on v2.0.4 (not tested before)
Indeed if we leave the default channel values in sketches (master=3 and slave=1) we can't expect the code to work !
But if I set the same channel for slave and master, it not work better and I got this output
On the slave side I don't have any output after init :
I tried a simpler way to get working ESPNow: 2 ESPs in STA mode and hardcoding the peer address on sender side but without success. My setup: |
Adding this to our Roadmap as it needs further testing. |
Hi, I have opened PR to fix the small problem with the channel, but I could not replicate your issue with |
Of course, Here is the basic informations :
If it works on your side with 2 ESP32, maybe the problem is related to ESP32-S2 or C3, or an incompatibility between the two? |
Thanks for the info. |
Hi, Some news after several tests. ESPNow does not work with the Lolin C3 Mini board specifically, I was able to get it to work successfully on another ESP32-C3 based board with native USB. Here are the "verbose" logs of the Lolin C3 Mini running "Master" sketch
On the slave side, nothing happens. On the other hand I detected another problem, even with the board for which ESPNow works (by re-reading I think this is the problem initially reported by @skrenes): If I use a channel other than 1 (same value on the master and slave side of course), the communication does not work and we get the behavior below
|
There is definitely a hardware design issue with the board I used for my 1st test : So the issue is only about using channel other than 1 :
|
Hi, it seems that the WiFi library does not allow changing channel for Station, so it is impossible to use any other channel than 1. |
OK, that explains the behavior.
In my case, I tried to change to use a channel as less congested as possible.
That would be great, in the meantime it might be helpful to put a comment on the CHANNEL constant? Thanks a lot for the help! |
I will just remove the option to change |
This worked for me. |
Hi there ! As [juantinazzo] said the problem is when you need to connect one device (at least) to router, in order to communicate out of local network. Even if [juantinazzo] workaround works, all ESP-Now devices have to get connected on the same router to synchronise their operating channel, but they often can't be in router's range .... |
@P-R-O-C-H-Y As you worked on ESP-Now recently, can you please take a look on this issue? |
This issue can be closed as solved by the ESP-NOW library PR #9395. |
Hardware:
Board: ESP32 D32 v1.0.0
Core Installation version: 1.0.1
IDE name: Arduino IDE
Flash Frequency: 80Mhz
PSRAM enabled: ?
Upload Speed: 921600
Computer OS: Mac OSX 10.14.4
Description:
In the basic example of ESP-Now (and I believe Multi-Slave example too), if the user changes the
CHANNEL
definitions from1
to anything else, the example fails.The definitions are here:
arduino-esp32/libraries/ESP32/examples/ESPNow/Basic/Slave/Slave.ino
Line 35 in da8b7c1
arduino-esp32/libraries/ESP32/examples/ESPNow/Basic/Master/Master.ino
Line 37 in da8b7c1
An example of the output from the master is this:
Notice the
Delivery Fail
status. The slave doesn't detect the master at all. Using a channel scan tool on my laptop, I see that the slave is in fact broadcasting its softAP on the properly defined channel. I don't know enough about the underlying SDK to determine what's going on within a reasonable amount of time. I'm hoping someone else can figure out what's going on, especially given how easy it is to replicate.The text was updated successfully, but these errors were encountered: