Skip to content
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

Non blocking wifi #367

Merged
merged 8 commits into from
Feb 4, 2021
Merged

Non blocking wifi #367

merged 8 commits into from
Feb 4, 2021

Conversation

mairas
Copy link
Collaborator

@mairas mairas commented Jan 25, 2021

This PR implements quite a few changes in the networking code. WiFi connection logic is no longer blocking: we don't need to wait for the wifi to get connected before entering the main loop. This allows easier simultaneous NMEA 2000 and other protocol use.

The wifi disconnection watchdog that reboots the device after disconnection is now a LambdaConsumer of SystemStatus in SensESPApp instead of being hard-coded in the Networking class. Sure, the behavior is arguably still hard-coded but will be easier to modify in the future. This requires PR #365 to work.

Wifi state changes are now captured and propagated using event handlers. Due to underlying API differences, the implementation is platform-specific (different for ESP8266 and ESP32).

Wifi settings were not reset properly at least on ESP32. Now they're nuked to invalid values on reset to force the device to forget the old values.

Wifi settings are no longer saved on SPIFFS by SensESP. The settings are in any case saved to flash memory by WifiManager, so having them in multiple places just made things more difficult.

@mairas
Copy link
Collaborator Author

mairas commented Jan 25, 2021

One of the tests fails until PR #365 has been merged.

@ba58smith
Copy link
Collaborator

I've reviewed #365, and it looks OK to me. But that's all I can add to this PR - it's way over my head.

@mairas mairas merged commit ecaa736 into SignalK:master Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants