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

Reset wifi coprocessor on disconnect #590

Closed

Conversation

tyeth
Copy link
Contributor

@tyeth tyeth commented May 31, 2024

This PR along with RSSI (#589) precedes #584.

Here we add reset code for the Airlift boards + WIFININA boards (arduino), along with setting the mqtt client to disconnected if we fail the mqtt ping (the mqtt client connected check is very simplistic and still returns true when wifi lost) and then calling runNetFSM to re-establish network connectivity

@tyeth tyeth marked this pull request as ready for review May 31, 2024 17:30
@tyeth tyeth requested a review from brentru May 31, 2024 17:30
@tyeth
Copy link
Contributor Author

tyeth commented May 31, 2024

@brentru ready for initial thoughts / review (worth turning on ignore whitespace diff option), not happy with the reset process really, I'd like to just call disconnect and then connect/begin again, probably pushing the issue back to WifiNina firmware long term.
Also not sure what the situation with the Nano_33_IOT and mkrWifi1010 are, should I grab one of each to retest, and add the board definitions (or just silently ignore them for now)?

Copy link
Member

@brentru brentru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tyeth I have a few changes to request. Overall, this looks good and I believe it'll improve stability.

WRT the arduino boards, let's talk about that on Slack

src/Wippersnapper.cpp Show resolved Hide resolved
src/Wippersnapper.cpp Show resolved Hide resolved
_wifi = &SPIWIFI;
_ssid = 0;
_pass = 0;
_mqtt_client = new WiFiSSLClient;

// setup ESP32 co-processor pins during init.
WiFi.setPins(_ssPin, _ackPin, _rstPin, _gpio0Pin, _wifi);
delay(1000);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know why it's there, but for maintainers, please add a comment explaining the utility of this "magic" delay() call

src/network_interfaces/ws_networking_pico.h Show resolved Hide resolved
@tyeth
Copy link
Contributor Author

tyeth commented May 31, 2024 via email

@tyeth tyeth mentioned this pull request Jul 1, 2024
@tyeth tyeth closed this Jul 25, 2024
@tyeth tyeth deleted the reset-wifi-coprocessor-on-disconnect branch October 11, 2024 16:08
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