Periodically I order a bunch of ESP32's and one or two of them will fail to connect to WiFi. Or connect but not make it through HDCP. Or get an IP address but be very slow accepting a connection. Usually I just send them back and make a mental note that a test jig for these would save a lot of dicking about. But today I brought up a system whose ESP32 is old enough that I can't recall where I got it from, so decided to take a look...
The symptoms: After setup and kicking off WiFi in station mode, this is the end of the console log:
I (2167) wifi:new:<11,2>, old:<1,0>, ap:<255,255>, sta:<11,2>, prof:1
I (2937) wifi:state: init -> auth (b0)
I (2947) wifi:state: auth -> assoc (0)
I (2977) wifi:state: assoc -> run (10)
I (6077) wifi:state: run -> init (fc0)
I (6077) wifi:new:<11,0>, old:<11,2>, ap:<255,255>, sta:<11,2>, prof:1
I (6077) wifi:new:<11,0>, old:<11,0>, ap:<255,255>, sta:<11,2>, prof:1
Lifted the tin lid to take a peek underneath and you can see from the photo what the issue is: the blue cap isn't soldered properly, and the grey one to the bottom isn't sure where 'up' is.
I reflowed the blue cap which got me onto the network, but getting an IP address is still dodgy so the entire top really needs cleaning up and doing properly.
Posted in case someone else has similar issues and can't find the fault in the code that causes it.