-
Notifications
You must be signed in to change notification settings - Fork 74
I added a reset after a certain number of connection attempts. #6
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
looks ok stylistic, if jerry wants to try it! |
I'll try it -- it will only help if _esp_is_connected goes False -- I' don't know if that was the case. |
Yeah, if we notice it's happening in the get portion of it, we can move it. I was just trying to keep it clean and you mentioned it hit the connection error portion when you did experience the error. |
it was just looping gin the "get" loop and failing very quickly -- I don think it was attempting to reconnect. |
I found an error in my code and just pushed again. |
was the error you fixed causing this -- I get it sometimes -- then it works on reboot
|
Yeah, please try again. I found that too and already pushed the fix. |
actually -- it already failed as in my original case so the reset is not helping where it is
|
Ok, I'll refactor. |
Ok, try again @jerryneedell. It seems to be working on my end. |
your note says you added it to get and post, but I only see it in get... |
That's odd. let me try pushing again... |
I hadn't hit save after adding it to post. |
ok - started a new test -- I am a bit concerned the attempts=1 is too strict, especially for the connect test - mine often fails on the first try but works on the second - it did work even after failing and resetting when I started this test so it may be OK. |
Just pass it something bigger on init. |
sure -- that's fine if you want 1 for the default, just checking. test is running -- hopefully it with generate an error soon.... or maybe not... |
well -- this failed and did not recover as it did for my example -- not sure why
|
restarting the test I ran last night with current released library and my fix in example again -- to see if it fails/recovers cleanly again |
Thanks Jerry, I’ll give it another go when I get a chance a little later. |
No rush -- thanks for trying to make it better ... -- my test is still running -- never fails when yo want it to... |
FYI - I was able to reproduce my original example, catching the error in esp32spi_cheerlights.py in the “get” loop and issuing the RESET before the “continue”. It actually occurred twice during this run and recovered both times. This is with currently released library, not with this PR.
|
Ok, I basically threw the try/except block around the code inside the get function and put some print messages before each line so I can try to determine which is causing the failure. I'm pretty sure I know what's up, but not quite sure why my changes didn't work, so I'm trying a different approach. |
@makermelissa Although it would be great to know what causes the error, I think the main thing is to catch them and be able to resume normal operation afterwards. This is why I just dealt with it in the "user code". |
Yeah, I may end up doing that. This is what I woke up to this morning for my thing running all night:
What that means is because the error was handled within the function, None was passed back. Since the errors seem so varied I'm more inclined to go with your method. |
Ok, I went ahead and removed the attempts code from the get/post functions, left it in place for connections (but changed it to a default of 2), added a reset function to the wifi, which really just calls the esp reset (in case we want some additional handling in the future), and added the wifi reset to the examples. |
Looks good - I'll runs some tests with it this afternoon/evening |
Worked 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.
tested cheerlights example and caught/recovered from errors. Have not see error on post example yet.
It should be the same if it does happen. |
Updating https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI to 1.2.0 from 1.1.1: > Merge pull request adafruit/Adafruit_CircuitPython_ESP32SPI#6 from makermelissa/master Updating https://github.com/adafruit/Adafruit_CircuitPython_Register to 1.6.0 from 1.5.1: > Merge pull request adafruit/Adafruit_CircuitPython_Register#22 from ladyada/master
This is to address #5.