-
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/esp8266: esp-now network device support #9917
Conversation
@gschorcht nice! How does one test this PR? |
@emmanuelsearch Please refer the updated description. |
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.
Without having a deeper look into the code (yet), I took two node-mcu clones and checked examples/gnrc_networking as mentioned in the PR description. And it works!
Not that I had any doubts about that ... :)
I did also a quick check with tests/gnrc_udp and involved a third device with success.
Two observations:
In gnrc_udp when using udp send
with more than 202 bytes no packet has been received on the server side.
The USEMODULE=esp_now
should get some kind conditional check. As dumb as I am, I ran make without it by accident. It builds without error, flashing is done, but then the node goes into a crazy "PANIC,reboot" loop. Even the tty-device disappeared.
@A-Paul Many thanks for your test. Don't wonder please, when I was investigating your problems, I realized some minor inconsistencies in some functions when debugging output is enabled. So, I have fixed them with the last commit and would like to include them with this PR. These are in detail:
As stated, I could realize these inconsistencies only after setting ENABLE_DEBUG. |
That behavior seems to be caused by upper layers of GNRC or the application. The USEMODULE=esp_now should get some kind conditional check. As dumb as I am, I ran make without it by accident. It builds without error, flashing is done, but then the node goes into a crazy "PANIC,reboot" loop. Even the tty-device disappeared. Yes, that is a problem. The short answer is: It is not reasonable to have such a conditional check and the application developer has to take care. The long asnwer: It is a bit mode tricky and rather a configuration problem of the application. Using Yes, this dependency is usually solved by the board's
And yes, it would be possible to add this dependency. But, here comes the problem. RIOT port for ESP8266 is a bare metal implementation. However, when you activate
Therefore, I would always prefer the bare metal implementation. When If At the end of the day, the use of GNRC and the configuration of GNRC requires some care on the part of the application developer. That's why you can't use GNRC test/examples as they are for all platforms. The are configured for exavtly one netdev which is always available. It would be great to have a dynamic configuration. This problem is handled in #9903. |
Due to the asynchronous nature of GNRC there is no error reporting (basically sending is just fire-and-forget). There is an experimental |
@A-Paul How do we proceed, the test was successful and the observed behavior isn't caused by the driver. Would you give your OK to get it built with murdock? |
Hi @gschorcht, I might repeat the quick test based on your last changes during this weekend. @smlng, i seems you had a look into the code already. What is your affirmation level? :) |
Repeated tests as in #9917 (review) |
any news here? Feature Freeze is tomorrow |
So far this PR did not get a proper code review and neither in-depth testing. I propose we skip this feature for the release but try to get it merged somewhat soon so we have a stable version in the next release. I suppose many people are interested in networking with ESPs so let's not take the risk of merging prematurely. |
How do we proceed with this PR? All requests for changes were considered some time ago. ESP-NOW for ESP8266 is compatible with ESP-NOW for ESP32 and is a prerequisite to use ESP32 and ESP8266 in the same network. ESP-NOW allows that ESP nodes to communicate without having infrastructure mode WiFi. And finally, this PR is prerequisite for the cleanup in PR #10929 and would make #10980 obsolete. |
will test today, need to find a 2nd esp8266 though. |
@smlng Thanks 😄 BTW, testing should also be possible with one ESP8266 and one ESP32 node. |
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.
otherwise tested ACK!
@miri64 good to get this merged? |
@gschorcht I think you can squash ;-) |
The documentation had to be changed due to the relation of module `esp_now` to `esp_wifi` module. In addition, a number of corrections have been made. In the case of documentation, it is impossible to do this in various commits.
Calling the initialization function ensures that the dummy lwIP library is used instead of the real lwIP, even if the esp_wifi module for esp8266 is not used.
squashed |
@smlng Is it ok to merge? |
Thanks. |
Contribution description
This PR introduces the ESP-NOW netdev device driver. The ESP-NOW netdev device allows ESP8266 nodes module to communicate using the built-in WiFi interface and the GNRC stack.
Test procedure
Since ESP-NOW is a technology that only works between ESP nodes, at least two esp8266 boards are needed for testing. The easiest way to test is to use
examples/gnrc_networking
. Once the boards have been flashed with the following make commandthe commands
ifconfig
andping6
can be used for testing.Issues/PRs references
This PR depends on
#10126,#10536,#10581,#10656,#10700.