Wifi problem with release='1.20.2.rc9'
-
Our fipy has become reluctant to connect to wifi since we updated it to 1.20.2.rc9 While trying to find a reason for this new found reluctance to connect we stumbled across a problem with our wifi code
try: from network import WLAN wlan=WLAN(mode=WLAN.STA, antenna=WLAN.INT_ANT); nets=wlan.scan(); ss='??'; AP='our_router'; pwd='our_pwd' for net in nets: if AP==net[0]: ss=net[4]; print('ss =', ss) if not wlan.isconnected(): wlan.connect(AP, auth=(WLAN.WPA2, pwd), timeout=5000) while not wlan.isconnected(): pycom.rgbled(white); time.sleep(.5); pycom.rgbled(off); time.sleep(.5) print(' wifi connected') except TimeoutError as e: sys.print_exception as ethe problem is the code throws a 'TimeoutError: Connection to AP Timeout!' after 5s without connection but the except doesn't catch it, says TimeoutError is undefined. How can micropython throw an error that is undefined?
-
Thanks, I believe this is a bug that has gone unnoticed for a very long time. The timeouterror is defined in the C-interface only, but not ported over to a micropython object, meaning throwing the error works, as that happens in C, but reading it as a micropython object does not work. I now added it in micropython
I will submit the fix internally and it should be fixed by the next version!
Though, note that 1.20.2.rc9 is an older release, and, even though 1.20.2.r4 also has this bug, the next release will include the fix and we will no longer update the release candidates from the past.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login