-
Notifications
You must be signed in to change notification settings - Fork 95
Wifi device refactor #115
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
Wifi device refactor #115
Conversation
- Move svc impls to the WifiDevice itself - This way any stack can be uses once connection is handled - Added compat impl for Wifi which forwards to the WifiDevice impls - Added internal wifi error enum and upgraded the basic wifi error enum
The Unfortunately, these changes seem to trigger mis-compilations for me
And one totally irrelevant nit-picky thing: Maybe the commit message of the last commit is a bit mis-leading? |
1714cf6
to
6d45675
Compare
Went a bit overboard and overhauled the errors in the wifi module to use a result and fixed the examples. I can't reproduce any of those miscompilations though :(. Maybe try cargo update? That's what fixed my issues earlier. |
Very nice improvements to the error handling Unfortunately, BLE doesn't compile anymore Even On S3 in opt-level 3 the dhcp and static_ip examples just freeze at the wifi scan. Oddly enough the coex example gets the scan done but never connects On S2 in opt-level 2 the dhcp example runs into an illegal instruction while the static_ip example works. With opt-level 1 everything seems to work on S3. But on S2 the dhcp example still crashs. I think needed opt-level 1 is not a big deal but I am a bit concerned I never can make the dhcp example work on S2 Maybe @jessebraham can also give this a try |
6d45675
to
9c31518
Compare
Oops fixed.
That was the behaviour I saw yesterday then a cargo update magically fixed it 🤷 I can reproduce the S2 issue, which goes away with |
To be honest, I think we should be setting |
Out of curiosity I also just retested #112 (comment) (S2 static IP opt-level = 3) with lto = 'off' and it now works... Disabling LTO completely is obviously not the true fix, but until it's fixed in the backend I don't really see any reason to have it enabled. |
Great - |
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.
Given that #116 is already in this LGTM
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.
Changes look good, I only tried a few examples (using different chips) but they all worked.
* WifiDevice refactor - Move svc impls to the WifiDevice itself - This way any stack can be uses once connection is handled - Added compat impl for Wifi which forwards to the WifiDevice impls - Added internal wifi error enum and upgraded the basic wifi error enum * add wifi event * Add missing fields in scan * Rework errors in wifi module to return a result * Fix examples
Currently, the
WifiDevice
Is heavily tied to the smoltcp stack. This PR implementsembedded_svc::wifi::Wifi
on the raw device instead of on the stack to allow usage of other stacks (i.e embassy_net). I have included an implementation that just calls the inner device functions for compatibility but I can remove that if needed. Finally, I added the internal error codes from esp-idf and reworked the error types slightly. I'm sure we could get Bingen to generate this for us, but we only really need it for a few things so I just hand-rolled it for now.