Network fault

WiFi not connecting? Check band, credentials and mode

WiFi failures have clear error codes on the serial monitor. Read the code before changing the network or the sketch.

22 November 20267 min read
A simple Arduino LED and resistor circuit on a breadboard used to demonstrate systematic fault finding
Start with the smallest circuit that still shows the problem, then add parts back one at a time.

Build it for real

To build this project for real, get the parts from hobidevre.com → hobidevre.com →

More build guides: hobidevre.com/blog

Confirm the frequency band

Common WiFi modules such as the ESP8266 support 2.4 GHz only. If your router broadcasts 5 GHz alone, or uses the same name for both bands, the board cannot join. Enable a separate 2.4 GHz network or split the SSIDs.

A board that sees no networks at all is almost always facing a band problem or a radio that has not been initialised.

Check the exact credentials

SSID and password are case-sensitive. A trailing space copied from a configuration file is invisible and invalid. Print the length of each string on the serial monitor to reveal hidden characters.

If the network has no password, pass an empty string rather than a placeholder.

Read the serial status code

The WiFi library reports a status after each connection attempt, and the serial monitor prints the reason for failure. A wrong password and a network that was not found are different codes with different fixes.

Print the status once per second while connecting, and stop printing once connected. This gives a timeline instead of a single confusing line.

Station or access point mode

In station mode the board joins your router. In access point mode the board creates its own network for a phone or laptop to join. Choosing the wrong one makes a correct configuration look broken.

If you need both, enable the appropriate dual mode and give the access point a distinct name.

Router settings that block joins

MAC address filtering, client isolation and a full DHCP lease table can all refuse a valid connection. Check the router log if the board reaches the network but never gets an address.

Captive portals, such as those in hotels, cannot be handled by a simple WiFi begin call; they need an HTTP login step.

Supply stability during transmission

WiFi transmission causes short current spikes. A board powered from a weak regulator or a long USB cable can reset at the moment it tries to connect, which looks like a repeated failed join.

Add a large capacitor near the module power pins and use a supply that can deliver several hundred milliamps.

Add a bounded retry loop

Try connecting a limited number of times with a short pause, then report failure and continue. An infinite blocking loop prevents any other code from running and hides the cause.

Log each attempt with a timestamp so you can tell whether the board is rejected immediately or times out after several seconds.

Get the parts

If you want to build this project in real life, you can get the parts from hobidevre.com.

Frequently asked questions

Why does it say wrong password when the password is right?

Check for hidden trailing spaces and confirm the 2.4 GHz network, not a 5 GHz one with the same name.

Can the board connect to 5 GHz WiFi?

Most low-cost ESP boards cannot; they support 2.4 GHz only. Enable a 2.4 GHz network on the router.

Why does it disconnect under load?

The supply is dipping during transmission. Use a stronger regulator and add local decoupling.

Related reading

Practise in the browser

Open the same layout in the simulator and follow the steps. Sign in to save your work.