Setting Up and Configuring ESP32 WiFi

📅 Apr 02, 2026
👁️ 1 Views
✅ Verified
Setting Up and Configuring ESP32 WiFi

Getting your ESP32 connected to WiFi is one of the first and most useful things you can do with it. It opens the door for your projects to talk to the internet. Let's walk through the steps together.

What You'll Need

Before we start, make sure you have these things ready:

  • An ESP32 development board.
  • A USB cable to connect it to your computer.
  • The Arduino IDE installed on your computer. If you don't have it, you can download it from the official Arduino website.
  • Your WiFi network name (SSID) and password.

Step-by-Step Guide

1. Add the ESP32 Board to Arduino IDE

The Arduino IDE doesn't come with the ESP32 by default. You need to add it as an extra board manager.

  1. Open the Arduino IDE.
  2. Go to File > Preferences.
  3. In the "Additional Boards Manager URLs" field, paste this URL:
    arduino
    https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
  4. Click "OK".
  5. Now, go to Tools > Board > Boards Manager...
  6. Search for "esp32". Install the "ESP32 by Espressif Systems" package.

2. Connect Your ESP32 and Select It

Plug your ESP32 into your computer using the USB cable. Then, in the Arduino IDE:

  1. Go to Tools > Board and select your ESP32 model (e.g., "ESP32 Dev Module").
  2. Go to Tools > Port and select the new COM port that appeared when you plugged in the board.

3. Load and Modify the WiFi Example

The Arduino IDE for ESP32 comes with great example sketches. Let's use the basic WiFi connection one.

  1. Go to File > Examples > WiFi > WiFiClient.
  2. A new window will open with the example code. Look for these two lines:
    arduino
    const char* ssid = "yourNetworkName";
    const char* password = "yourNetworkPassword";
  3. Replace "yourNetworkName" with your actual WiFi name (keep the quotes).
  4. Replace "yourNetworkPassword" with your actual WiFi password (keep the quotes).

4. Upload and Test

Click the upload button (the right arrow icon) in the Arduino IDE. The code will compile and send to your ESP32.

Once uploaded, open the Serial Monitor (Tools > Serial Monitor). Set the baud rate to 115200. You should see messages like "Connecting to WiFi..." and finally "WiFi connected" along with the IP address assigned to your ESP32.

Congratulations! Your ESP32 is now on your WiFi network.

What Can You Do Next?

Now that your ESP32 is connected, you can start building! You could make a simple web server to control an LED, send sensor data to the cloud, or create a notification system. For more project ideas, checking out the official ESP-IDF WiFi documentation is a great next step.

If you're working with images or data for your IoT projects, you might find tools like our Image to Base64 Converter or JSON Formatter helpful for preparing web content and data.

Frequently Asked Questions

My ESP32 isn't showing up in the Port menu. What should I do?

First, try a different USB cable—some cables are for charging only and don't transfer data. If that doesn't work, you might need to install a driver for the USB-to-serial chip on your ESP32 (often a CP210x or CH340 chip). You can find these drivers with a quick web search.

The code uploads, but I get "Connecting to WiFi....." forever in the Serial Monitor.

Double-check your WiFi name and password in the code. Make sure they are exactly correct, including capitalization. Also, ensure your WiFi network is a 2.4GHz network, as most ESP32 boards do not support 5GHz bands.

Can I store the WiFi credentials somewhere safer than the code?

Yes! For a more permanent project, you should avoid hardcoding credentials. You can use the WiFiManager library, which lets the ESP32 create its own WiFi network for you to enter credentials via a web page. It then saves them in its memory.

Where can I find more code examples?

The Arduino IDE has many examples under File > Examples > WiFi. For more advanced use, the ESP32 Arduino Core GitHub repository is an excellent resource with all the official examples.