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

Detecting wifi loss during Loop... #99

Closed
richiejarvis opened this issue Jan 14, 2020 · 2 comments
Closed

Detecting wifi loss during Loop... #99

richiejarvis opened this issue Jan 14, 2020 · 2 comments

Comments

@richiejarvis
Copy link

Hi - Thanks for this great library. I've just started playing, and would like to force the ESP32S to reboot automatically if it is not connected to wifi. I looked at the src and saw that in line 971 you are returning a boolean, not a bool. See arduino/Arduino#4673

I'll gen a Pull Request once I've sussed it out. I was trying to do this in my code:

  if (iotWebConf.checkWifiConnection) {
    // do something
  }

Is there a better/easier way that you are aware of?

Cheers,

Richie

Line:

boolean IotWebConf::checkWifiConnection()

@prampec
Copy link
Owner

prampec commented Jan 14, 2020

Thank you for your comment. I always have used boolean as I always thought, that both bool and boolean are just aliases for uint8.

See method setWifiConnectionHandler() for detecting connection failures. Example: IotWebConf09CustomConnection

@richiejarvis
Copy link
Author

richiejarvis commented Jan 14, 2020

Thank you for the quick reply. Yeah, it threw me out till I found that post! I also discovered my error as well - I had not included the all important () after the function call. The call went through the if statement then. I realise now that the bool vs boolean was a red-herring - oops! sorry!

Feel free to ditch the PR - it isn't needed now I've fixed my code. It was an interesting tangent for me personally though.

Soz to bother...

Cheers,

Richie

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

No branches or pull requests

2 participants