-
Notifications
You must be signed in to change notification settings - Fork 74
add retry to AP connect for simpletest #20
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
Conversation
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.
Looks like esp.connect
in WiFiManager attempts a reset and retry, and excepts a ValueError
too. (https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI/blob/master/adafruit_esp32spi/adafruit_esp32spi_wifimanager.py#L87
You may want to implement a hard-reset for the ESP before retrying: (https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI/blob/master/adafruit_esp32spi/adafruit_esp32spi.py#L146)
Are you having these issues with the WiFiManager examples?
I have always had this issue with esp32spi , but the wifmanager handles it just fine with its retry. I dd not add the hard reset here, because it had just been reset as part of the init. I'm not sure what causes this or if others have had this issue. I has always worked for me on the second try. I only accepted RuntimeError since I did not want to mask other issues. I can add the ValueError and reset if you want -- I was just trying to keep it as simple as possible -- being a "simpletest" |
FYI -- here is an example of the typical error and recovery with this PR
|
@jerryneedell Thanks for providing the error log, you wouldn't need to handle |
Updating https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI to 1.3.2 from 1.3.1: > Merge pull request adafruit/Adafruit_CircuitPython_ESP32SPI#21 from makermelissa/master > Merge pull request adafruit/Adafruit_CircuitPython_ESP32SPI#20 from jerryneedell/jerryn_simpletest Updating https://github.com/adafruit/Adafruit_CircuitPython_PyPortal to 1.0.5 from 1.0.4: > Merge pull request adafruit/Adafruit_CircuitPython_PyPortal#10 from ladyada/master
I find that the first attempt to connect to my SSID often fails. It usually connects on the secontd try.
adding this retry loop avoids a lot of problems.
This just occurred when I tried following the guide for a new pyportal.
With this change, it connects reliably.