ESP-NOW specifics [WIFI-2245]

daneast
Posts: 9
Joined: Wed Apr 22, 2020 11:26 am

ESP-NOW specifics [WIFI-2245]

Postby daneast » Wed Apr 22, 2020 12:11 pm

I've read all the material I can find on the ESP-NOW protocol, but I still have some unanswered questions. As an aside, it appears I registered only for the ESP32 forum and not the ESP8266 forum, but I imagine that the protocol itself (although not necessarily the way we programmatically access the API) is the same for both platforms.
  1. How nicely does ESP-NOW play while other Wifi networks are in operation on the same channel? Does ESP-NOW wait or otherwise coordinate with non-ESP Wifi devices so they are not transmitting over top of one another?
  2. I ran a test for several hours with two ESP devices relaying data back and forth using ESP-NOW. Some of my tests were at a long distance where many of the packets were dropped. During this test, I never saw a corrupt or truncated data packet. It was all or nothing (a good, complete packet, or the packet was totally dropped). This leads me to believe the protocol itself is doing checksumming, or at the very least, a check that an entire data packet was received. The demo implementations I have seen discuss adding CRC data to make sure the packet wasn't corrupt. I would like to know exactly what the ESP-NOW protocol itself handles so I can prevent unnecessary duplicate data in my packets (such as packet length) if that is already handled.
  3. Similar to question #1 above, but specific to ESP-NOW, does the protocol check for "radio silence" when transmitting between ESP-NOW nodes, or is that something I have to manage at a higher level? For example, if Node 1 is transmitting (broadcast mode, not to a specific MAC) within receive range of Node 2, and I attempt to send data with Node 2, will Node 2 wait until Node 1's transmission is complete or will it transmit the instant esp_now_send is called (and disrupt Node 1's transmission that was being received by yet another Node)?
Thanks.

ESP_igrr
Posts: 1690
Joined: Tue Dec 01, 2015 8:37 am

Re: ESP-NOW specifics

Postby ESP_igrr » Wed Apr 22, 2020 1:46 pm

Hi daneast,

ESP-NOW uses a standard Wi-Fi feature called vendor-specific action frames (which is a type of management frames). Since this is part of Wi-Fi protocol, arbitration with other packets at the physical layer is handled the same way as for other Wi-Fi packets. Management frames have a Frame Check Sequence appended, which explains the "all or nothing" property. There is no need to add CRC unless you want to guard against the possible case that the sender and the receiver are not using the same application level frame format (due to e.g. different versions of your application trying to talk to each other).
There is some information about ESP-NOW frame structure in the programming guide: https://docs.espressif.com/projects/esp ... ame-format

daneast
Posts: 9
Joined: Wed Apr 22, 2020 11:26 am

Re: ESP-NOW specifics

Postby daneast » Wed Apr 22, 2020 5:04 pm

Thank you, my testing today with 3 units also showed that they manage their traffic and do not transmit over one another.

Is the ESP32's ESP-NOW compatible with the ESP8266? I have 3 ESP8266s communicating properly with ESP_NOW, and finally received an ESP32 today. However, the ESP32 cannot send to or receive from the ESP8266s it seems. Unfortunately I only have one ESP32 at this time, so I can't check that the ESP32 is working correctly, however everything is initializing properly and I am not seeing any errors when sending.

ESP_igrr
Posts: 1690
Joined: Tue Dec 01, 2015 8:37 am

Re: ESP-NOW specifics

Postby ESP_igrr » Wed Apr 22, 2020 10:35 pm

The protocol should be compatible between the ESP8266 and ESP32, so perhaps there is some issue with adding peers or setting up encryption... Do you have a wireless adapter in your PC/laptop which you can switch to monitor mode, and capture the packets with Wireshark? Once you have a packet capture, please submit an issue on Github — one of our Wi-Fi engineers will help troubleshoot this.

daneast
Posts: 9
Joined: Wed Apr 22, 2020 11:26 am

Re: ESP-NOW specifics

Postby daneast » Thu Apr 23, 2020 12:40 pm

Do you have any guidance on how to sniff ESP-NOW packets specifically? I tried Wireshark on both Windows 10 and OSX and could not see what appeared to be ESP-NOW packets from the known working ESP8266a. I tried the Mac / OSX because Wireshark on that works in monitor mode which is supposed to show all packets.

daneast
Posts: 9
Joined: Wed Apr 22, 2020 11:26 am

Re: ESP-NOW specifics

Postby daneast » Fri Apr 24, 2020 2:06 am

I still don't understand what is going on, but have discovered one thing. Using Wireshark, I can see the ESP-NOW broadcast transmissions by the ESP32. However, I cannot see any network packets from the ESP8266 modules with Wireshark. Again, the ESP8266s can communicate with one another fine using ESP-NOW, but the ESP32 cannot (send or receive) with them.

So the fact that the ESP8266 packets can't be seen in Wireshark makes me wonder if that is using some other protocol that isn't Wifi? Is that even possible?

ESP_Alvin
Posts: 147
Joined: Thu May 17, 2018 2:26 am

Re: ESP-NOW specifics [WIFI-2245]

Postby ESP_Alvin » Fri Apr 24, 2020 2:33 am

Moderator's note: edit the topic title for issue tracking, thanks.

zhangyanjiao
Posts: 24
Joined: Mon Aug 28, 2017 3:27 am

Re: ESP-NOW specifics [WIFI-2245]

Postby zhangyanjiao » Fri Apr 24, 2020 6:53 am

hi daneast,
We have tested bewteen ESP32 and ESP8266 (RTOS), they can send and receive data successfully.

daneast
Posts: 9
Joined: Wed Apr 22, 2020 11:26 am

Re: ESP-NOW specifics [WIFI-2245]

Postby daneast » Fri Apr 24, 2020 1:14 pm

I've just about exhausted everything without success. My software is dumping the Wifi MAC address which I see in monitor. I can then use Wireshark to see packets from the ESP32's MAC address, and the packets obviously contain the data I am sending. With the ESP8266 I do the same thing, but Wireshark does not show any packets from that MAC address. If I manually pore through all the packets Wireshark sees I cannot find any that can be from the ESP8266 (based on the frequency I have it broadcast, etc). I have driven out in the country to try to reduce Wifi traffic to better see ESP8266 packets with no luck.

The ESP8266 are communicating among themselves using ESP-NOW perfectly fine, but these packets cannot be seen in Wireshark and they cannot be seen by an ESP32 running identical code. The ESP8266 cannot see packets transmitted by the ESP32 which I can see on Wireshark.

I'm totally new to the ESP ecosystem, so all I can do now is speculate randomly. Could the ESP8266 firmware be significantly out of date and that cause some kind of problem where these ESP8266s are incompatible with ESP32? Or could there be a more general Wifi issue with the firmware making them incompatible with actual Wifi specs? I ordered these three ESP8266 modules as a package - could there be a hardware or low-level config issue affecting all three that still allow them to work together but not with other modules? Are they operating totally off frequency? Is there something in the Menu Config that could impact this in some way? I have gone through ever single config item on the ESP8266 project multiple times, including comparing (what I can) to the ESP32 config options. I'm running out of ideas here. Any help would be appreciated.

Kaisha
Posts: 20
Joined: Thu Mar 05, 2020 8:59 pm

Re: ESP-NOW specifics [WIFI-2245]

Postby Kaisha » Fri Apr 24, 2020 4:36 pm

From my understanding there are some issues with using ESP-NOW with WiFi. Specifically when you connect to an AP and its a different channel from ESP-NOW.

Who is online

Users browsing this forum: abansal22, Google [Bot] and 44 guests