Merge pull request #796 from larsks/bug/795

try both binascii and ubinascii in inisetup.py
This commit is contained in:
Scott Shawcroft 2018-05-03 10:04:37 -07:00 committed by GitHub
commit 2fe552694b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,9 +3,13 @@ import network
import storage import storage
def wifi(): def wifi():
import ubinascii try:
import ubinascii as binascii
except ImportError:
import binascii
ap_if = network.WLAN(network.AP_IF) 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") ap_if.config(essid=essid, authmode=network.AUTH_WPA_WPA2_PSK, password=b"micropythoN")
def check_bootsec(): def check_bootsec():