-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cpu/esp*: esp_now and esp_wifi cleanup #10929
Conversation
release status ping, should I change the milestone? |
@MrKevinWeiss I have to find some time to rebase it. I will try it in next days. And of course, someone would have to review it 😄 |
Great, when you do I will test and mercilessly bug @smlng for the review |
2591165
to
6d0651e
Compare
I just want to see if murdock is happy. I can try testing soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well I don't know what I did but I followed the testing procedure and was able to ping6 back and forth with a esp border router and node using rpl (with this PR). I don't know if that counts as tested, I think it was only with the esp_now though.
@MrKevinWeiss Most import is that both network interfaces First, you should check on the border router whether it can connect to the configured WiFi AP.
Second, you should be able to ping another ESP-NOW node using network interface I guess these both tests could also be done using
Please note, the channel used for ESP-NOW has to be the same as the channel used by your WiFi AP. If you use the ESP-NOW to WiFi border router project and you configure a route to |
ping @smlng I would have like this for the release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM code-wise, haven't tested myself but: @MrKevinWeiss if you're confident do the merge
OK. I will retest on Monday. If possible can you squash and fix the murdock errors? |
@MrKevinWeiss I fixed the problems in TravisCI and Murdock but I didn't squash yet so that you are able to see how I had them to fix. |
Many thanks. It is squash time! |
cpu/esp_common/include/cpu_conf.h
Outdated
|
||
#ifdef __cplusplus | ||
} | ||
#endif /* CPU_CONF_H */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(comment wrong)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ups
@MrKevinWeiss I tested it again with two ESP32s in another environment where I had problems too as long as the LAN doesn't use global unicast addresses That is, as long as ESP32's WiFi interface and the machine in the LAN have only link local addresses ESP32: pinging the ESP-NOW node behind the border router worked without problems. Of course, The route to Did you have global unicast addresses in your LAN? |
Tested again with the additional All I want to do is ping the esp node from the esp border router when the esp border router is connected to wifi. If I enter the wrong wifi ssid I can ping the esp node and if the wifi ssid is correct it cannot ping. |
@MrKevinWeiss Did you use the global unicast address |
@MrKevinWeiss I set up a completly new test environment which exactly corresponds to your test environment:
On border router:
On ESP-NOW node:
Pinging border router from Linux:
Pinging ESP-NOW node from ESP32 border router:
On Linux:
So the environment looks exactly like yours. I can ping the ESP-NOW node with connected WiFi interface either using its global unicast address After setting the route on the Linux machine to Sorry, when I'm nerving a bit, but could you double check whether you have tried in exactly this way., please. There is no reason why it should not work in your environment. Update: No matter whether RPL is activated on BR or not. RPL is not required for direct links between the border router and the ESP-NOW node. |
I know, I am sorry that I cannot get it but I really would like for anyone else to test to confirm. |
Downsized numbers of dynamic send and receive buffers.
a8fe593
to
97bb337
Compare
Rebased |
I tested with the freshly rebased version and the following setup: Both ESPs used
ESPnow:
Notes: Setup of the nodes: ESPbr:
PC:
Using that setup everything worked: I could ping every host from every other host in the setup. I found one (unrelated?) problem where I left the ESPbr in this setup running without using it and after around 40 minutes it printed the following message before the shell stopped responding to input: Nonetheless I can confirm that this PR indeed enabled using esp_now and esp_wifi on the same node, so I will add the tested label. |
I'll leave merging to @MrKevinWeiss or @smlng as I didn't have the slightest look at the code ;) |
@MichelRottleuthner Many thanks for testing it . Theses are really good news. I'm really happy that someone else than me could get it working 🚀 The problem you saw might have the same reason as the problem I described in issue #11941. I'm already investigating it and it seems that it is caused to be caused by using mutexes in WiFi interface callbacks within interrupt context. I have already changed it in a test version which seems to be working stable, also with multiheap enabled. |
Many thanks @MichelRottleuthner now that we confirmed it was my setup I am happy to merge it. Also the documentation seems good. |
Thank you all for your support and your patience 😄 |
Contribution description
This PR is a cleanup of modules
esp_now
andesp_wifi
to get them working together, for example to realize a border router which connects an ESP-NOW based mesh network of ESP32 an ESP8266 nodes with an infrastructure mode WiFi network.Testing procedure
Build a border router using project RIOT_ESP_NOW_WiFi_Border_Router and some ESP-NOW nodes. Follow the instructions in README.md.
Although the test could be performed on either ESP8266 nodes or ESP32 nodes only, a configuration is recommended in an ESP32 is used as border router and ESP8266s are used as ESP NOW nodes.
[Update]
However, if an ESP8266 is used as a boundary router, RPL must not be enabled due to its limited RAM.After merging PR # 10981, the limited amount of RAM for ESP8266 should no longer be a problem.Issues/PRs references
Since it cleans upesp_wifi
for ESP32 as well as ESP8266, it depends on PR #9917.