I've tested this in both the REPL and webREPL and have had odd results. Here's roughly the commands used:
Code: Select all
import network
lan = network.WLAN(network.AP_IF)
lan.config(essid='testnet')
At first the REPL just kept reporting:
Code: Select all
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: can't set AP config
There was a reference here on the boards to it not working in repl but did work for someone in webREPL so I then attempted that. Surprisingly, the commands above worked.... once. I would get a numbered ets_task() line report back after typing in the .config() line.
Code: Select all
lan.config(essid='testnet')
#6 ets_task(4020e374, 29, 3fff74f8, 10)
Code: Select all
lan.config(essid='testnet')
But at the moment I don't know what caused the initial error message when attempting from REPL. Since I enabled webREPL (and disabled it again) the commands in REPL are working once more.
Curious if anyone else has experienced this (and any warnings on if regularly changing the essid is going to cause problems in any way once I move all this to a code file and run on startup?)