How to Find Arduino's IP Address via Wi-Fi: All Working Methods for ESP8266 and ESP32

Connecting Arduino to a Wi-Fi network opens up a lot of possibilities for controlling devices over the Internet, but the problem often arises: how to find out IP address of the boardto connect to it remotely? Without this address, you won't be able to open the web interface, send an HTTP request, or configure interaction with other devices on the local network. In this article, we'll cover all the current methods for obtaining IP addresses for popular modules. ESP8266 (NodeMCU, Wemos D1) and ESP32, including methods through Serial Monitor, router settings, specialized sketches and external services.

A key feature of working with Arduino is that its IP address can change each time you connect to the network (unless your router has a static IP address). Therefore, it's important not only to know the current address but also to learn how to record it or quickly find it when it changes. We'll cover solutions for various scenarios: from simply displaying the IP address in the port monitor to automated notifications via a Telegram bot. You'll also learn the differences between local (within your network) and external (global) Arduino IP addresses and when which one is needed.

Method 1: Displaying the IP address in the Serial Monitor (the easiest method)

If your Arduino is already connected to Wi-Fi and running a sketch that supports networking, the fastest way to find out its IP is to print it to Serial MonitorThis method does not require additional tools and works for any modules based on ESP8266 or ESP32.

Add the following code to your sketch (usually placed in a function setup() after connecting to Wi-Fi):

Serial.begin(115200);

WiFi.begin("your_SSID", "your_PASSWORD");

while (WiFi.status() != WL_CONNECTED) {

delay(500);

Serial.print(".");

}

Serial.println("");

Serial.print("Connected! IP address: ");

Serial.println(WiFi.localIP());

After downloading the sketch, open Serial Monitor in the Arduino IDE (Tools → Port Monitor) and set the speed 115200 baudAfter a few seconds, you will see a line like this:

Connected! IP address: 192.168.1.105
  • Pros: no need to install anything, works out of the box.
  • ⚠️ Cons: Requires physical connection of Arduino to computer via USB.
  • 🔄 When to use: for debugging or if the board is always connected to the PC.

Method 2: View the list of devices in the router settings

If your Arduino is already connected to Wi-Fi but you don't want to connect it to your computer, you can find its IP address through the router interface. This method is universal and works for any device on the network, including ESP8266, ESP32, and even if you don't know which sketch is loaded on the board.

Instructions for most routers:

  1. Open your browser and enter your router's IP address in the address bar (usually it's 192.168.0.1 or 192.168.1.1).
  2. Log in (default logins/passwords can be found on the router sticker).
  3. Go to the section with a list of connected devices. The section name depends on the model:
    • TP-Link: DHCP → DHCP Client List
    • ASUS: Network Map → Clients
    • Keenetic: Devices
    • MikroTik: IP → DHCP Server → Leases
  • Find the device with the name in the list ESP_XXXXXX or espressif (For ESP32) is your Arduino.
  • Router model Path to the list of devices How to identify an Arduino
    TP-Link Archer C6 Advanced → Network → DHCP → DHCP Client List The name begins with ESP_ or contains the MAC address of the board
    ASUS RT-AX88U Network Map → Clients Device Type: "Other" or "Espressif"
    Keenetic Giga Devices (main page) Manufacturer: Espressif Systems
    Xiaomi Mi Router 4 Devices → Connected devices Network name: espressif or ESP8266

    If there are many devices in the list, pay attention to MAC address Arduino - it is usually printed on the module body (for example, on NodeMCU) or you can output it to Serial Monitor team Serial.println(WiFi.macAddress());.

    📊 What router are you using?
    TP-Link
    ASUS
    Keenetic
    Xiaomi
    Another

    3. Method: Using a sketch with sending IP via UDP or HTTP

    If you need to obtain the Arduino's IP address remotely (without connecting to the Serial Monitor or a router), you can program the board to automatically send its IP address to another computer on the network. This is convenient for projects where the Arduino operates autonomously, such as a weather station or a smart home system.

    Below is an example sketch that sends an IP address to a computer using the protocol UDP (port 4210). Upload it to the Arduino, and on your computer, start listening to the port (for example, via netcat or Packet Sender):

    #include<WiFi.h> // For ESP32 (for ESP8266 use<ESP8266WiFi.h> )
    

    #include <WiFiUdp.h>

    const char* ssid = "your_SSID";

    const char* password = "your_PASSWORD";

    WiFiUDP udp;

    void setup() {

    Serial.begin(115200);

    WiFi.begin(ssid, password);

    while (WiFi.status() != WL_CONNECTED) {

    delay(500);

    Serial.print(".");

    }

    udp.begin(4210);

    IPAddress localIP = WiFi.localIP();

    char ipStr[16];

    sprintf(ipStr, "%d.%d.%d.%d", localIP[0], localIP[1], localIP[2], localIP[3]);

    udp.beginPacket("192.168.1.100", 4210); // Replace with your PC's IP

    udp.print("Arduino IP: ");

    udp.print(ipStr);

    udp.endPacket();

    }

    void loop() {}

    To listen for UDP packets on a computer (Windows), use the command:

    nc -ulvp 4210
    • 📡 UDP alternative: sending IP via HTTP request to a local server (e.g. http://192.168.1.100/log?ip=ARDUINO_IP).
    • 🔌 For ESP8266: replace #include <WiFi.h> on #include <ESP8266WiFi.h>.
    • ⚠️ Limitation: The computer must be on the same network as the Arduino.
    How can I check if UDP packets are reaching my computer?

    If the team nc -ulvp 4210 does not show data, check:

    1. Is the firewall on your computer disabled (it may block UDP).

    2. Is the computer IP specified correctly in the sketch (udp.beginPacket).

    3. Are the Arduino and PC connected to the same Wi-Fi network (not to different router subnets).

    Method 4: Arduino Web Server with IP Output

    One of the most convenient methods is to run a simple web server on your Arduino, which will display its IP address when opened in a browser. This allows you to find out the IP address at any time by simply entering something like http://arduino.local (if mDNS is configured) or current IP.

    Example sketch for ESP8266/ESP32 with web server:

    #include<WiFi.h> // or<ESP8266WiFi.h> for ESP8266
    

    #include <WebServer.h>

    const char* ssid = "your_SSID";

    const char* password = "your_PASSWORD";

    WebServer server(80);

    void handleRoot() {

    String ip = WiFi.localIP().toString();

    String html = "<html><body><h1>Arduino IP</h1><p>" + ip + "</p></body></html>";

    server.send(200, "text/html", html);

    }

    void setup() {

    Serial.begin(115200);

    WiFi.begin(ssid, password);

    while (WiFi.status() != WL_CONNECTED) delay(500);

    server.on("/", handleRoot);

    server.begin();

    }

    void loop() {

    server.handleClient();

    }

    After loading the sketch:

    1. Find out the Arduino IP using any of the previous methods (for example, via Serial Monitor).
    2. Enter this IP in the address bar of your browser (for example, http://192.168.1.105).
    3. You will see a page with your current IP address.

    Upload a sketch with WebServer support|Connect Arduino to Wi-Fi|Find out the board's IP (via Serial or router)|Open the IP in a browser|If necessary, refresh the page (F5) for the current IP-->

    If you're using an ESP32 with dual Wi-Fi (2.4 GHz + 5 GHz), the web server will only be accessible through the network the board is connected to. For example, if the Arduino is connected to the 5 GHz band and your computer is connected to the 2.4 GHz band of the same router, access to the server may not work.

    5. Method: Using mDNS (access by name instead of IP)

    Protocol mDNS (Multicast DNS) allows you to access Arduino not by IP address, but by a friendly name, for example http://arduino.localThis eliminates the need to constantly find out the IP address, especially if it changes after rebooting the router. mDNS is supported by most modern operating systems (Windows 10+, macOS, Linux) and modules. ESP8266/ESP32.

    An example sketch with mDNS support:

    #include <WiFi.h>
    

    #include<ESPmDNS.h> // For ESP32 (for ESP8266: #include<ESP8266mDNS.h> )

    const char* ssid = "your_SSID";

    const char* password = "your_PASSWORD";

    void setup() {

    Serial.begin(115200);

    WiFi.begin(ssid, password);

    while (WiFi.status() != WL_CONNECTED) delay(500);

    if (!MDNS.begin("arduino")) { // "arduino" is the hostname (will be accessible as arduino.local)

    Serial.println("Error starting mDNS!");

    } else {

    Serial.println("mDNS is running. Open http://arduino.local");

    }

    }

    void loop() {}

    After loading the sketch:

    1. Make sure your computer and Arduino are connected to the same network.
    2. Open in browser http://arduino.local (or other name specified in MDNS.begin()).
    3. If the page doesn't open, check mDNS support in your OS:
      • Windows: install Bonjour Print Services.
      • Linux: install the package avahi-daemon (sudo apt install avahi-daemon).
      • Android: use apps like Network Browser.
    ⚠️ Attention: On some corporate networks or guest Wi-Fi networks, mDNS may be blocked by the administrator. In this case, use standard IP detection methods.

    6. Method: Arduino's external IP address (for remote access)

    All previous methods help to find out local IP Arduino (for example, 192.168.1.105), which only works within your home network. If you need to connect to the Arduino from the internet (for example, to control a smart home remotely), you'll need external (public) IP address your router + setting up port forwarding (Port Forwarding).

    How to find out your external IP:

    1. Open any IP address detection service in your browser, for example:
  • Copy the displayed IP - this is your router's internet address.
  • Set up port forwarding on your router:
    • External port: 8080 (or any other).
    • Internal IP: The local IP of your Arduino (e.g. 192.168.1.105).
    • Inland port: 80 (if a web server is running on the Arduino).
    • Now you can connect to Arduino from the Internet at http://<your_external_IP>:8080.
    ⚠️ Attention: Exposing your Arduino to the internet creates security risks. Always use strong passwords for your Wi-Fi and router admin panel, or better yet, set up a VPN for remote connections.
    IP type Example Where is it used? How to find out
    Local (internal) 192.168.1.105 Connection within a home network Serial Monitor, router, mDNS
    External (public) 93.180.71.3 Remote access from the Internet Services like 2ip.ru
    Dynamic DNS (DDNS) myarduino.ddns.net Constant access with changing external IP No-IP, DuckDNS services

    7. Additional tips and common problems

    When working with Arduino IP addresses, common errors often occur that prevent you from connecting to the board. Here are the most common ones and how to solve them:

    • 🔌 Arduino won't connect to Wi-Fi:
      • Please check that you entered the correct password (case sensitive!).
      • Make sure your router supports older Wi-Fi standards (some ESP8266 don't work with WPA3).
      • Try disabling the "Hide SSID" function on your router.
    • 🌐 IP address in Serial Monitor - 0.0.0.0:
      • Restart your Arduino and router.
      • Check if DHCP is enabled on your router (it should be).
      • If you are using a static IP, make sure it does not conflict with other devices.
    • 🔒 Unable to connect to the Arduino web server:
      • Check that the port 80 not blocked by firewall.
      • Make sure the Arduino and the computer are on the same subnet (for example, both on 192.168.1.x).
      • Try disabling your antivirus (it may be blocking local connections).

    If you frequently work with Arduino online, it is recommended to:

    • 📌 Assign a static IP for Arduino in the router settings (by MAC address).
    • 🔄 Use OTA update (Over-The-Air) to flash the board without USB.
    • 📡 Set up a backup communication channel (for example, sending IP via SMS or Telegram at startup).

    FAQ: Frequently Asked Questions About Arduino IP Addresses

    Is it possible to find out the IP address of an Arduino without connecting it to a computer?

    Yes, there are several ways:

    1. Via the router interface (DHCP section or list of connected devices).
    2. If you have a web server running on your Arduino, simply enter its last known IP address into your browser.
    3. If mDNS is configured, use a name like this: arduino.local.
    4. Program the Arduino to send IP over UDP/HTTP to another computer on the network.
    Why does the Arduino IP change after rebooting the router?

    This happens because, by default, the router assigns IP addresses to devices dynamically (DHCP). To prevent the IP address from changing, do one of the following:

    • Set up static IP in the Arduino code (by specifying it manually in WiFi.config()).
    • Assign the IP address to the Arduino's MAC address in your router settings (DHCP reservation).
    • Use mDNS to access by name instead of IP.

    Example code for static IP:

    #include <WiFi.h>
    

    WiFi.config(IPAddress(192, 168, 1, 105), IPAddress(192, 168, 1, 1), IPAddress(255, 255, 255, 0));

    How do I connect to an Arduino if I don't know its IP and can't connect to the Serial Monitor?

    If you don't have physical access to the Arduino, try:

    1. Check the list of devices in the router (see Method 2).
    2. If you have a sketch running on your Arduino with mDNS, try connecting by name. arduino.local (or another one if it has been changed in the code).
    3. If Arduino has previously sent an IP to an external server (for example, via an HTTP request or Telegram), check the logs of that service.
    4. As a last resort, reset the Arduino settings using the button RESET and connect to its access point (if the sketch supports AP mode).
    Is it possible to find out Arduino IP via Bluetooth or USB (without Wi-Fi)?

    No, an IP address is only assigned when connected to a network (Wi-Fi or Ethernet). However:

    • If the Arduino is connected to the computer via USB, you can interact with her through Serial Monitor or a virtual COM port, but in this case the IP is not assigned.
    • If there is an Arduino Bluetooth module (For example, HC-05), you can connect to it to transfer data, but it will not replace Wi-Fi and IP address.
    • For projects without Wi-Fi, use alternative protocols: I2C, SPI, or radio modules nRF24L01.
    How to protect Arduino from unauthorized IP access?

    If your Arduino is connected to the internet, follow these guidelines:

    • 🔐 Disable port forwarding on the router if it is not needed.
    • 🛡️ Use authorization in the Arduino web interface (for example, checking login/password in a sketch).
    • 🔄 Update your firmware router and Arduino (vulnerabilities are eliminated).
    • 🌍 For remote access Use VPN instead of direct port forwarding.
    • 📵 Disable unnecessary services (eg Telnet or FTP) if they are not used.

    Example code for basic authentication on a web server:

    void handleRoot() {
    

    if (!server.authenticate("admin", "your_password")) {

    return server.requestAuthentication();

    }

    // Your code for authorized users

    }