Crash on calling WLAN API?
Ok, next problem :-)
I haven't modified
main.py, but I wanted to get familiar with the WLAN API via the REPL.
The docs say that:
The WLAN constructor is special in the sense that if no arguments besides the id are given, it will return the already existing WLAN instance without re-configuring it.
Great - let's call that and see what's currently configured:
losed by foreign host. [pete@Panorama:~]$ telnet 192.168.4.1 Trying 192.168.4.1... Connected to 192.168.4.1. Escape character is '^]'. MicroPython v1.8.6-422-g516b861 on 2017-02-07; WiPy with ESP32 Login as: micro Password: Login succeeded! Type "help()" for more information. >>> from network import WLAN >>> wlan = WLAN(id=1) Traceback (most recent call last): File "<stdin>", line 1, in <module> OSError: resource not available
Hmm, ok. The docs say that:
When id is 0, the configuration will be get/set on the Station interface. When id is 1 the configuration will be done for the AP interface.
and I'm connected to the WiPy as an access point, so it ought to be id=1. But let's go ahead and try id=0 and see what happens:
>>> wlan = WLAN(id=0) Connection closed by foreign host. [pete@Panorama:~]$ telnet 192.168.4.1 Trying 192.168.4.1... telnet: connect to address 192.168.4.1: Operation timed out telnet: Unable to connect to remote host [pete@Panorama:~]$
I get kicked out of the REPL (which I could understand if it's changing the wifi config, though I didn't actually ask for a change in this case) - and more significantly I can't log back in without a power-cycle.
Is this just happening because I'm trying to do it interactively using the telnet REPL, and modifying boot.py would work, or is the WLAN API generally flakey?
Firmware 1.5.1.b1 flashed today.
Bump - anyone else seen this, or something similar?
This post is deleted!