Esphome device won't connect to wifi, weird logging…

I’ve got a BT Proxy device that was working happily for a few months, then I spotted recently it had dropped off my wifi.

When I wired up the serial usb to see the logs, I can see it’s stuck trying to connect to the wifi, but ther’s a lot more unfamiliar logging that I’ve not seen before (when a device wouldn’t connect).

Can anyone make any sense of this and/or offer any advice?

[10:33:28][D][esp-idf:000][wifi]: new:<6,0>, old:<6,2>, ap:<6,2>, sta:<6,0>, prof:1
[10:33:28][D][esp-idf:000][wifi]: 
[10:33:28]
[10:33:28][W][component:237]: Component wifi took a long time for an operation (72 ms).
[10:33:28][W][component:238]: Components should block for at most 30 ms.
[10:33:28][W][wifi_esp32:704]: Event: Disconnected ssid='sharpwifi' bssid=xx:xx:xx:xx:xx:xx reason='Association Leave'
[10:33:28][W][wifi:653]: Error while connecting to network.
[10:33:28][I][wifi:313]: WiFi Connecting to 'sharpwifi'...
[10:33:28][D][esp-idf:000][wifi]: I (537498) wifi:
[10:33:28][D][esp-idf:000][wifi]: new:<6,2>, old:<6,0>, ap:<6,2>, sta:<6,0>, prof:1
[10:33:28][D][esp-idf:000][wifi]: 
[10:33:28]
[10:33:28][D][esp-idf:000][wifi]: I (537714) wifi:
[10:33:28][D][esp-idf:000][wifi]: state: init -> auth (b0)
[10:33:28][D][esp-idf:000][wifi]: 
[10:33:28]
[10:33:28][D][esp-idf:000][wifi]: I (537720) wifi:
[10:33:28][D][esp-idf:000][wifi]: state: auth -> assoc (0)
[10:33:28][D][esp-idf:000][wifi]: 
[10:33:28]
[10:33:28][D][esp-idf:000][wifi]: I (537726) wifi:
[10:33:29][D][esp-idf:000][wifi]: state: assoc -> run (10)
[10:33:29][D][esp-idf:000][wifi]: 
[10:33:29]
[10:33:29][D][esp-idf:000][wifi]: I (537746) wifi:
[10:33:29][D][esp-idf:000][wifi]: <ba-add>idx:0 (ifx:0, xx:xx:xx:xx:xx:xx), tid:0, ssn:0, winSize:64
[10:33:29][D][esp-idf:000][wifi]: 
[10:33:29]
[10:33:29][D][esp-idf:000][wifi]: I (537773) wifi:
[10:33:29][D][esp-idf:000][wifi]: connected with sharpwifi, aid = 2, channel 6, BW20, bssid = xx:xx:xx:xx:xx:xx
[10:33:29][D][esp-idf:000][wifi]: 
[10:33:29]
[10:33:29][D][esp-idf:000][wifi]: I (537781) wifi:
[10:33:29][D][esp-idf:000][wifi]: security: WPA2-PSK, phy: bgn, rssi: -51
[10:33:29][D][esp-idf:000][wifi]: 
[10:33:29]
[10:33:29][D][esp-idf:000][wifi]: I (537793) wifi:
[10:33:29][D][esp-idf:000][wifi]: pm start, type: 1
[10:33:29]
[10:33:29][D][esp-idf:000][wifi]: 
[10:33:29]
[10:33:29][D][esp-idf:000][wifi]: I (537817) wifi:
[10:33:29][D][esp-idf:000][wifi]: AP's beacon interval = 102400 us, DTIM period = 1
[10:33:29][D][esp-idf:000][wifi]: 
[10:33:29]
[10:33:29][D][esp-idf:000][wifi]: I (538333) wifi:
[10:33:29][D][esp-idf:000][wifi]: <ba-add>idx:1 (ifx:0, xx:xx:xx:xx:xx:xx), tid:6, ssn:0, winSize:64
[10:33:29][D][esp-idf:000][wifi]: 
[10:33:29]
[10:33:58][W][wifi:647]: Timeout while connecting to WiFi.
[10:34:03][I][wifi:313]: WiFi Connecting to 'sharpwifi'...
[10:34:03][D][esp-idf:000][wifi]: I (571938) wifi:
[10:34:03][D][esp-idf:000][wifi]: state: run -> init (0)
[10:34:03][D][esp-idf:000][wifi]: 

The AP does work (i.e. I can connect to the fallback AP), so it’s not the wifi chip itself, but I’ve not seen this esp-idf logging before in any of the esphome projects I have.

Have you checked your router on whether the mac-address of the BT Proxy accidently got blocked from connecting to the next AP? What do the AP/router logs tell when that BT Proxy tries to connect?

The router isn’t particularly forthcoming with respect to logs.

Typically, I’ve had this problem for over a week, and the moment I post here, I think of something new.

I assigned a static IP, and on my router assigned the IP by mac address, and it’s connected fine :man_facepalming:

I’m guessing a device was introduced that nabbed it’s original IP address and the btproxy wasn’t getting assigned a new one (possibly a problem in my network), but sorted now.

Thanks for the prompt :+1: