I have a board with an ESP8266 chip running Micropython firmware v1.8.7. My requirement is to use WebREPL via the University Wi-Fi, which uses WPA2 Enterprise EAP-MSCHAPv2 authentication. My Google-fu so far has informed me that Arduino users have been able to connect to WPA2 Enterprise EAP-TLS (certificate based authentication) (link) but not (SSID, username, pwd) networks.
All the threads I've seen so far on the subject seem to be from mid-2016 at the very latest, so I'm wondering whether someone's been able to figure out how to do this since then. I've never dabbled in network related stuff before (nor am I a great programmer), so all the big words above are pretty new to me. I thus have the following questions:
I appreciate any help you guys can provide. If there's any relevant info I haven't included, please let me know and I'll edit it in.
Edit: @MaximilianGerhardt This is what works for me on a WPA2 Personal:
import network
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect('ssid','pwd')
wlan.ifconfig()
import webrepl
webrepl.start()
On a WPA2 Enterprise, I had hoped changing this line would work, but no joy:
wlan.connect('ssid',auth=WPA2_ENT,'user','pwd')
Thanks, I'll look into the Espressif Non-OS SDK V2.0.0 and see if I can make it work.
As I linked in the comments the problem has apparently been solved in the newest 2.0 Espressif SDK. But since you're not using the Espressif C SDK, but the python "Micropython" firmware, this change has not been yet propagated into this python firmware.
You can see the mapping of the network functions (active()
, connect()
, ifconfig()
etc) in the firmware here: https://github.com/micropython/micropython/blob/52df2f889e3315a4ced5a81e80efbb138182cd1b/esp8266/modnetwork.c. In line 115 you can also see the call to wifi_station_connect()
, which is a native Espressif-SDK function. Thus you'll see, the firmware doesn't yet make use of the new functions for WPA2 authentication. In line 490 you can see all the available options for authentication:
MP_OBJ_NEW_SMALL_INT(AUTH_OPEN) ,
MP_OBJ_NEW_SMALL_INT(AUTH_WEP) ,
MP_OBJ_NEW_SMALL_INT(AUTH_WPA_PSK) ,
MP_OBJ_NEW_SMALL_INT(AUTH_WPA2_PSK) ,
MP_OBJ_NEW_SMALL_INT(AUTH_WPA_WPA2_PSK)
WPA2 enterprise authentication is not yet one of them.
So now I'd say your options are:
EDIT: This is still an issue and tracked in https://github.com/micropython/micropython/issues/2778.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With