-
Notifications
You must be signed in to change notification settings - Fork 239
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
ESPNow: Encryption not working #415
Comments
Ciao @toi-go thank you very much, this is bad. I will fix it ASAP. |
Here is the fix: 5f790b3 |
Hi @gioblu , thank you for providing the patch. Unfortunately, with it, my two ESP32 cannot communicate with each other - no matter if I call bus.strategy.set_pmk or not. So, there must be another problem. To test, I've used the ping example at examples/ESP32/ESPNOW/PlatformIO.
|
It seems that the remaining problem is somehow related to autoregistration mode, as it works if it is disabled.
If you register remote nodes manually, you have to use the MAC address of the interface (AP or Station) which is actually in use (depending on CONFIG_STATION_MODE): From ESPNOWHelper.h
In my case, CONFIG_STATION_MODE was not defined, so I had to use the MAC address of the AP interface. To determine the MAC address, I used the following code:
|
Documentation at https://github.com/gioblu/PJON/blob/master/src/strategies/ESPNOW/README.md suggests that communication would be encrypted if a PMK is passed to the set_pmk method:
For me, this is not the case: My two nodes are still able to communicate with each other even if both nodes do the above with a different PMK or if only one of them does set a PMK.
Apparently, add_peer in ESPNOWHelper.h does not set the encrypt flag:
The text was updated successfully, but these errors were encountered: