Peculiar WiFi Issue

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
forum_user
Posts: 4
Joined: Thu Jan 30, 2020 11:14 pm

Peculiar WiFi Issue

Post by forum_user » Thu Jan 30, 2020 11:50 pm

Hello, I'm having an odd issue where I'm able to connect to my wifi, receive an address, but have no subsequent connectivity outside of localhost:

Version:

Code: Select all

>>> import os
>>> os.uname()
(sysname='esp32', nodename='esp32', release='1.12.0', version='v1.12-dirty on 2020-01-30', machine='ESP32 module with ESP32')
Network Setup (successful):

Code: Select all

>>> wlan = network.WLAN(network.STA_IF)
>>> wlan.active(True)
True
>>> wlan.isconnected() 
False
>>> wlan.connect('PD-24', '<PASSWORD>')
>>> I (2494538) wifi: new:<11,0>, old:<11,0>, ap:<255,255>, sta:<11,0>, prof:1
I (2494548) wifi: state: init -> auth (b0)
I (2494548) wifi: state: auth -> assoc (0)
I (2494558) wifi: state: assoc -> run (10)
I (2494688) wifi: connected with PD-24, channel 11, BW20, bssid = 78:d2:94:87:1c:a6
I (2494688) wifi: pm start, type: 1

I (2494698) network: CONNECTED
I (2496688) tcpip_adapter: sta ip: 192.168.2.16, mask: 255.255.255.0, gw: 192.168.2.1
I (2496688) network: GOT_IP
>>> wlan.ifconfig()
('192.168.2.16', '255.255.255.0', '192.168.2.1', '192.168.2.1')
>>> wlan.isconnected()
True
Socket Attempt (failure):

Code: Select all

>>> import usocket
>>> usocket.getaddrinfo('www.micropython.org', 80)
[]
Ping Localhost (successful):

Code: Select all

>>> import uping
>>> uping.ping('127.0.0.1')
PING 127.0.0.1 (127.0.0.1): 64 data bytes
84 bytes from 127.0.0.1: icmp_seq=1, ttl=255, time=7.590000 ms
84 bytes from 127.0.0.1: icmp_seq=2, ttl=255, time=7.493000 ms
84 bytes from 127.0.0.1: icmp_seq=3, ttl=255, time=7.531000 ms
84 bytes from 127.0.0.1: icmp_seq=4, ttl=255, time=7.506000 ms
4 packets transmitted, 4 packets received
(4, 4)
Ping Gateway (failure):

Code: Select all

>>> uping.ping('192.168.2.1')
PING 192.168.2.1 (192.168.2.1): 64 data bytes
4 packets transmitted, 0 packets received
(4, 0)
A similar attempt using a hotspot works as expected:

Code: Select all

>>> wlan = network.WLAN(network.STA_IF)
>>> wlan.active(True)
I (3410728) wifi: mode : sta (4c:11:ae:75:44:f0)
True
>>> I (3410738) wifi: STA_START
wlan.isconnected() 
False
>>> wlan.connect('R910a-3B6A7F', '<PASSWORD>')
>>> I (3472808) wifi: new:<1,1>, old:<1,0>, ap:<255,255>, sta:<1,1>, prof:1
I (3473648) wifi: state: init -> auth (b0)
I (3473658) wifi: state: auth -> assoc (0)
I (3473698) wifi: state: assoc -> run (10)
I (3473738) wifi: connected with R910a-3B6A7F, channel 1, 40U, bssid = f4:63:49:3b:6a:7f
I (3473738) wifi: pm start, type: 1

I (3473738) network: CONNECTED
I (3474688) tcpip_adapter: sta ip: 192.168.128.57, mask: 255.255.255.0, gw: 192.168.128.1
I (3474688) network: GOT_IP
wlan.ifconfig()
('192.168.128.57', '255.255.255.0', '192.168.128.1', '192.168.128.1')
>>> wlan.isconnected()
True
>>> import usocket
>>> usocket.getaddrinfo('www.micropython.org', 80)
[(2, 1, 0, 'www.micropython.org', ('176.58.119.26', 80))]
I'm really confused as the initial network (Netgear router) works fine with all other devices (phones, computers, etc.).

Does anyone have any troubleshooting suggestions? I was trying to figure out how to enable more verbose logging for the network module, but haven't been able to figure that out yet.

Thanks for any suggestions.

Post Reply