diff --git a/ports/esp8266/modules/inisetup.py b/ports/esp8266/modules/inisetup.py index 192ff5ea84..46f0892484 100644 --- a/ports/esp8266/modules/inisetup.py +++ b/ports/esp8266/modules/inisetup.py @@ -3,9 +3,13 @@ import network import storage def wifi(): - import ubinascii + try: + import ubinascii as binascii + except ImportError: + import binascii + ap_if = network.WLAN(network.AP_IF) - essid = b"MicroPython-%s" % ubinascii.hexlify(ap_if.config("mac")[-3:]) + essid = b"MicroPython-%s" % binascii.hexlify(ap_if.config("mac")[-3:]) ap_if.config(essid=essid, authmode=network.AUTH_WPA_WPA2_PSK, password=b"micropythoN") def check_bootsec():