-->
Page 1 of 1

[Solved] How to debug Wifi not connecting

PostPosted: Mon Oct 02, 2017 10:28 am
by pylkko
using a eps8266 based board Adafruit Huzzah. It used to connect to my router's wifi fine, but today it stopped.

Most everything seems to work. Serial can print and receive messages, can read analog sensor on pin, can deep sleep etc. But just no longer can connect.

I tried some example code for basic wifi connection, and neither Adafruits own one or the Arduino example work. They just hang at "connecting". Nothing is in the routers logs, nothing in dhcp log, nothing in main log.

I know for sure that nothing has changed in the router setup or the local network. The device does not appear to be fried. Is there some way to get more data or info form the device? I used a debugging command, but it only printed out the wifi setup (ssid, password, using sta etc).

Re: How to debug Wifi not connecting

PostPosted: Mon Oct 02, 2017 3:31 pm
by QuickFix
You could put it into AP mode and try to connect to it using your mobile (or any other wireless device).
Just flash it with a server-demo (or the standard AT firmware and manually set its mode to SoftAP).

Re: [Solved] How to debug Wifi not connecting

PostPosted: Sun Oct 08, 2017 1:07 pm
by pylkko
it turned out that the problem was that the router was not broadcasting the network at all. I did not notive this at first, since apparently all the other devices around here are on 5 Ghz and were working, but on the router 2.4 Ghz had crashed. After rebootin the router, the esp8266 workder just perfect.

The way that I figured this out was by using special code to give me more information about the connection for debugging. So, even though this was a stupid and simple mistkae, it was a good opportunity to learn something. What i did was place a for-loop that attempts to connect and also prints to serial the iteration number and a status number pulled from WiFi.status().

int status = WiFi.status();
there is a bunch of number that correspond to specific states for this and I was getting the one
that corresponds to WL_NO_SSID_AVAIL, and then I started to suspect the router.