1.0.5-rc2 ESPNOW: Peer channel is not equal to the home channel, send fail!

OutOfLine
Posts: 52
Joined: Sat Feb 24, 2018 1:32 pm

1.0.5-rc2 ESPNOW: Peer channel is not equal to the home channel, send fail!

Postby OutOfLine » Thu Nov 26, 2020 9:21 am

Using esp-arduino 1.0.5-rc2 trying to send something by esp_now I get

Code: Select all

ESPNOW: Peer channel is not equal to the home channel, send fail!
The returned error code is ESP_ERR_ESPNOW_ARG

I have never seen this error before and the same code works fine on esp-arduino 1.0.4
Did anybody else see this when using esp_now on esp-arduino 1.0.5-rc2 (or 1.0.5-rc1)?

What does the message mean by 'home channel'?

PS: Sorry, my code https://github.com/reppr/pulses/ is quite complicated and I did not find the time yet to write a simplified example. If you want to try it send "CC" (twice capital letter C) with 500000 baud over the serial line to trigger the error.

OutOfLine
Posts: 52
Joined: Sat Feb 24, 2018 1:32 pm

Re: 1.0.5-rc2 ESPNOW: Peer channel is not equal to the home channel, send fail!

Postby OutOfLine » Sun Nov 29, 2020 2:34 pm

Maybe somebody is interested, so I report back what I have found so far:

I did 'git bisect' on esp32-arduino pointing at the following commit: 22b427df IDF release/v3.3 (#3672) So the change came from ESP IDF, not esp32-arduino (which is no surprise).

I assume the error came from my (wrong) attempt to change the channel esp-now is working to channel #4. Possibly the older IDF version just ignored the issue, so esp-now *did* send parameters to my orchestra of a couple of ESP32 musical instruments configuring and synchronizing them, but just used channel 1 instead of channel 4. As the music started well I assumed everything was ok. I could not really test this theory, but I have my reasons to think so. Probably the newer IDF version just checks parameters better and refuses to send. Error messages instead of music :(
As a workaround I set the channel to 0 or 1 and it works like it did before.

A lot of googling showed me, that it *is* difficult to change the radio channel for esp-now and I'm not really sure yet, if it *is* possible at all. I would be happy for any informations on the matter.

btw: I do *not* use wifi for anything else but esp-now in these instruments. No AP.

questions:
Did somebody succesfully change esp-now radio channel to anything other then 1 or 0?
Did anybody try esp-now related tests with SDR?

highCaliber
Posts: 1
Joined: Tue Jul 20, 2021 3:46 am

Re: 1.0.5-rc2 ESPNOW: Peer channel is not equal to the home channel, send fail!

Postby highCaliber » Tue Jul 20, 2021 3:49 am

I created an account just to say thank you, and I'm sure I will find other uses :)

I was sure changing the channel on the slave to 3 (matching what the master believe the slave to be) wouldn't break anything. I changed them both to show channel 1 and successful delivery. I guess the slaves will have to take turns? Doesn't matter, just leveled up a bit more.

Thank you again!

OutOfLine
Posts: 52
Joined: Sat Feb 24, 2018 1:32 pm

Re: 1.0.5-rc2 ESPNOW: Peer channel is not equal to the home channel, send fail!

Postby OutOfLine » Sun Jul 25, 2021 8:17 am

@highCaliber Nice to see that my post was useful to somebody :)

Currently I am working on other things and did not test with current software versions yet. But I am planing to come back to the issue and so my questions remain of interest to me:

* was anybody able to use esp-now on other channels than 0 or 1?
* did someone test esp-now with software defined radio or has other sources of insight into the
inner working of the protocol?

Charles_Wen
Posts: 13
Joined: Fri Aug 06, 2021 1:39 am

Re: 1.0.5-rc2 ESPNOW: Peer channel is not equal to the home channel, send fail!

Postby Charles_Wen » Wed Oct 13, 2021 11:13 am

Yes, I test it, only channel 0 and channel 1 can communicate successful.

TheVisionariesInk
Posts: 5
Joined: Mon Dec 20, 2021 11:05 am

Re: 1.0.5-rc2 ESPNOW: Peer channel is not equal to the home channel, send fail!

Postby TheVisionariesInk » Mon Dec 20, 2021 11:16 am

I have just found this post as I was looking for the same details.

If you have not yet found the answer the below is working for me for setting channels with ESP-Now only use.

WiFi.mode( WIFI_STA );
WiFi.disconnect();
int chan=11;
ESP_ERROR_CHECK(esp_wifi_set_channel(chan,WIFI_SECOND_CHAN_NONE));
if (esp_now_init() != ESP_OK) { ESP.restart(); return; }
peerInfo.channel = chan;
memcpy(peerInfo.peer_addr, MAC, 6);
if (esp_now_add_peer(&peerInfo) == ESP_OK){Serial.printf("# Peer Added\r\n");}
else {Serial.printf("# Unable to add peer \r\n");}

Hope it helps someone looking for the same answer.

OutOfLine
Posts: 52
Joined: Sat Feb 24, 2018 1:32 pm

Re: 1.0.5-rc2 ESPNOW: Peer channel is not equal to the home channel, send fail!

Postby OutOfLine » Wed Jan 26, 2022 10:50 am

Yes your post helped me a lot. Using WIFI_SECOND_CHAN_NONE did the trick.
I can switch the channel without error messages now.

I had tried a long time to switch to channel 4. This channel looks best on a WiFi analysing app.
The connection was very slow and there was a lot of data corruption. So I finally tried channel 11 (as you do) and everything works very well. On WiFi analyzer this channel does not look too good, but it works well. I do not think there is a problem of the ESP32 with this channel. But there might be other (non WiFi) signals on the frequency.

I hope I can check that using SDR (software defined radio) soon.
Did anybody explore ESP-NOW with SDR?

Anyway: I mention this if somebody has similar problems. It might be useful to check other channels... I had good results with channels 0, 1 and 11.

Who is online

Users browsing this forum: No registered users and 136 guests