-
Notifications
You must be signed in to change notification settings - Fork 1.3k
esp32: don't fully reset the wifi device #6600
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
.. this makes reconnecting without a full reset not work. Because this works on other generations of the esp32 (c2, c3, etc), apply this behavior only to esp32. After this change, it's possible to connect multiple times to wifi in different runs of code.py or the repl after soft rebooting.
.. otherwise, nothing set it enabled on the second soft reboot.
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.
Thank you!
Hey @jepler should this actually apply to the esp32-c3 as well? I'm experiencing something similar on my Wemos C3 Mini. First run after reset - this script works:
I see my local networks printed and the connection is successful. I can even re-run this script manually several times in the repl. When I soft reset (ctrl-d in repl) and try to run this again, it fails. No networks are printed and I receive a Is this what you saw with your esp32 chip? And if so, is it expected this same fix would apply to c3's? |
Can confirm, I went ahead and make a custom bin with this on 223:
And now wifi works between repl resets. How do y'all want to proceed? I can do some leg work on getting a PR up but dunno exactly what approach we want to take here (is this worth a re-think?). |
I am able to run @Bruno-DaSilva 's test script multiple times on my QT Py ESP32-C3 without a problem. I have found that the my C3 doesn't have the network range as some of the other ESP chips and when I'm near it's range limit my network ssid will switch in and out of being listed in a wifi scan. I did throw some Ctrl-D's between runs and the script still was able to connect. |
@RetiredWizard well that's no bueno as far as compatibility 😆 Different behaviour between different boards of the same chip, that's fun. Open to guidance on next steps for sure... |
@Bruno-DaSilva Please open a new issue. They are easier to track than follow up on than a merged PR. Thanks for helping test on the C3! |
@tannewt you go it, will do. |
.. this makes reconnecting without a full reset not work. The user initiated wifi flag is now used to track whether
import wifi
needs to re-enable the wifi interface.Because this works on other generations of the esp32 (c2, c3, etc), apply this behavior only to esp32.
After this change, it's possible to connect multiple times to wifi in different runs of code.py or the repl after soft rebooting.
Testing procedure: Connect with Thonny. Put wifi deets in .env on device (to open this file when it exists already, use the hamburger menu to select to show hidden files on the target device). Run the following script with F5: