Can't get IP (intermittent)
Posted: Tue Mar 27, 2018 7:56 pm
I am running a fairly vanilla setup where I try to connect to my home router (SilverShark). A lot of the time, I will get a valid IP address very quickly. However, sometimes I don't. I had the following console dump on one of these occasions. It looks like everything is fine. The wifi module said it connected, but no IP.
I (346) wifi: wifi firmware version: 407bb27
I (348) wifi: config NVS flash: enabled
I (351) wifi: config nano formating: disabled
I (361) wifi: Init dynamic tx buffer num: 32
I (361) wifi: Init dynamic rx buffer num: 32
I (361) wifi: wifi driver task: 3ffc3dfc, prio:23, stack:4096
I (363) wifi: Init static rx buffer num: 10
I (367) wifi: Init dynamic rx buffer num: 32
I (371) wifi: Init rx ampdu len mblock:7
I (375) wifi: Init lldesc rx ampdu entry mblock:4
I (379) wifi: wifi power manager task: 0x3ffc937c prio: 21 stack: 2560
I (489) wifi: wifi timer task: 3ffca474, prio:22, stack:3584
I (517) wifi: mode : sta (30:ae:a4:80:76:9c)
I (639) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1
I (1297) wifi: state: init -> auth (b0)
I (1302) wifi: state: auth -> assoc (0)
I (1314) wifi: state: assoc -> run (10)
I (1533) wifi: connected with SilverShark, channel 1
I (11315) wifi: pm start, type:0
The log looks exactly the same (minus the last line) when I get an IP. When I do get an IP, it is very quickly after the "connected with SilverShark" line.
Any help on this would be great:
1. Any clues as to why this is intermittently working/not working?
2. I have tried tcpip_adapter_down, then tcpip_adapter_up functions after a reasonable timeout. No luck. I've similarly tried an esp_wifi_stop() / then calling esp_wifi_set_mode, esp_wifi_setconfig, esp_wifi_start, esp_wifi_connect. That didn't help either. Is there any way to force a re-start after a timeout? With some stacks, shutting down an interface and restarting it - kicking off DHCP again - works to get things unhung.
Rob
I (346) wifi: wifi firmware version: 407bb27
I (348) wifi: config NVS flash: enabled
I (351) wifi: config nano formating: disabled
I (361) wifi: Init dynamic tx buffer num: 32
I (361) wifi: Init dynamic rx buffer num: 32
I (361) wifi: wifi driver task: 3ffc3dfc, prio:23, stack:4096
I (363) wifi: Init static rx buffer num: 10
I (367) wifi: Init dynamic rx buffer num: 32
I (371) wifi: Init rx ampdu len mblock:7
I (375) wifi: Init lldesc rx ampdu entry mblock:4
I (379) wifi: wifi power manager task: 0x3ffc937c prio: 21 stack: 2560
I (489) wifi: wifi timer task: 3ffca474, prio:22, stack:3584
I (517) wifi: mode : sta (30:ae:a4:80:76:9c)
I (639) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1
I (1297) wifi: state: init -> auth (b0)
I (1302) wifi: state: auth -> assoc (0)
I (1314) wifi: state: assoc -> run (10)
I (1533) wifi: connected with SilverShark, channel 1
I (11315) wifi: pm start, type:0
The log looks exactly the same (minus the last line) when I get an IP. When I do get an IP, it is very quickly after the "connected with SilverShark" line.
Any help on this would be great:
1. Any clues as to why this is intermittently working/not working?
2. I have tried tcpip_adapter_down, then tcpip_adapter_up functions after a reasonable timeout. No luck. I've similarly tried an esp_wifi_stop() / then calling esp_wifi_set_mode, esp_wifi_setconfig, esp_wifi_start, esp_wifi_connect. That didn't help either. Is there any way to force a re-start after a timeout? With some stacks, shutting down an interface and restarting it - kicking off DHCP again - works to get things unhung.
Rob