Ii just gets stuck trying to connect:
Trying to connect. Note this may take a whileâŚ
So I canât even get an IP address, or connect to it from any app.
I do use wireshark, but not sure what to do to monitor it trying to connect.
I modified the code to see if it was getting stuck doing something else (and basedf on what I read, tried to force it to use WPA2_PSK but your sample does not seem to require it.
Also tried to force it to use a static IP address. Neither DHCP or static IP work.
Setup Network Interface
network_if = network.WLAN(network.STA_IF)
network_if.active(True)
network_if.config(security=3) #WLAN.WPA2_PSK
wlan_mac = network_if.config(âmacâ)
security = network_if.config(âsecurityâ)
print(âMAC Address: {:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}â.format(wlan_mac[0],wlan_mac[1],wlan_mac[2],wlan_mac[3],wlan_mac[4],wlan_mac[5]))
print("Security: ", security ) # Show MAC for peering
if not network_if.isconnected():
print(âConnecting to networkâŚâ)
network_if.ifconfig((â192.168.1.71â, â255.255.255.0â, â192.168.1.250â,â8.8.8.8â ))
network_if.connect(âXXXXXâ,âXXXXXâ)
while not network_if.isconnected():
print(â.â, end=â\nâ)
blue_led.on()
time.sleep(1)
blue_led.off()
red_led.on()
time.sleep(1)
red_led.off()
print(network_if.isconnected())
print(network_if.status())
print()
print(âConnected:â, network_if.isconnected())
else:
print(âAlready connected!â)
I can see the LED changing from red to blue so it is in that loop, but no connection whatsoever.
Regards,
Ernesto