用这个程序连接不上手机热点,wlan.isconnected()的返回值一直是false,用wlan.scan()可以扫描的到其他没有密码的wifi,手机热点取消密码之后都扫描不到,请问是什么原因?
import network, time
SSID='kmust123' # Network SSID
KEY='0123456789' # Network key
初始化wlan模块并连接到网络
print("Trying to connect... (may take a while)...")
wlan = network.WINC()
wlan.connect(SSID, key=KEY, security=wlan.WPA_PSK)
#我们现在通过DHCP应该有一个有效的IP
print(wlan.ifconfig())
while(True):
wlan.connect(SSID, key=KEY, security=wlan.WPA_PSK)
print(wlan.isconnected())
print(wlan.scan())
time.sleep(3000)