Tag: esp32 wifi setup

  • esp32 wifimanager: The Ultimate Easy Guide for a Seamless and Powerful WiFi Setup

    Beginner-friendly ESP32 WiFiManager tutorial to easily set up WiFi, save credentials, add custom parameters, and build smart IoT projects with simple Arduino code.

    If you’ve ever worked on an ESP32 project, you already know the most annoying part: connecting your board to WiFi without hard-coding the SSID and password every single time. It feels okay during early testing, but the moment you want to give the device to someone else, or move it to a different network, it becomes painful.

    This is where esp32 wifimanager steps in. Think of it as a simple helper that lets your ESP32 create a temporary WiFi Access Point and a small configuration portal. You connect your phone to that portal, type your WiFi name and password, save it, and the ESP32 connects automatically. No more changing code just to update the WiFi.

    This tutorial is a complete walk-through. We’ll talk like we’re sitting over coffee: direct, clear, and simple. By the time you finish reading, you’ll know exactly how to use wifimanager esp32, how to add custom parameters, how OTA works with it, how EEPROM can store passwords safely, and how people use it in real projects like esp32 blynk wifimanager or an esp32 ds18b20 webserver wifimanager setup.

    What Is ESP32 WiFiManager and Why Do We Even Need It?

    Let’s be honest. Hard-coding WiFi credentials is fine if you’re playing around. But once your ESP32 project needs to be installed somewhere—your home, someone else’s home, a school, a farm, anything—hard-coded credentials become a headache.

    You don’t want to open the code and flash the ESP32 every time the router password changes.
    You don’t want to ship devices that can’t be updated easily.
    And you definitely don’t want to ask people for their WiFi password so you can write it inside the source code.

    WiFiManager for ESP32 solves all of this by creating a simple flow:

    1. The ESP32 turns into a hotspot.
    2. You open that hotspot on your phone.
    3. A configuration page appears.
    4. You select your WiFi network, type password, click save.
    5. ESP32 stores it in non-volatile memory.
    6. Reboots and connects automatically next time.

    In short, WiFiManager removes the single most annoying part of using WiFi on microcontrollers.

    The original library by tzapu became super famous on ESP8266. Today, tzapu wifimanager esp32 also works nicely on ESP32 through ports and community updates.

    Why ESP32 WiFiManager Is So Useful for Real Projects

    If you’re making any of the following:

    • Smart home device
    • Web server that controls relays
    • IoT weather station
    • Farming sensor network
    • ESP32 Blynk IoT project
    • ESP32 DS18B20 web server
    • Anything that needs WiFi configuration

    …WiFiManager saves time, reduces user frustration, and makes your project feel polished.

    Think about a finished IoT gadget. People expect a small webpage where they can configure WiFi—just like connecting a smart plug or smart bulb. WiFiManager gives your ESP32 that user-friendly behavior, without you writing hundreds of lines of backend code.

    If you’re using Arduino IDE, PlatformIO, or even the ESP-IDF, there are clean ways to integrate wifimanager esp32 code smoothly.

    How WiFiManager Works behind the Scenes

    Even though it feels magical, the idea is pretty simple:

    • ESP32 tries connecting to saved WiFi credentials.
    • If connection fails (e.g., wrong password, router changed), ESP32 switches to AP mode.
    • It starts a captive portal—like when you connect to coffee shop WiFi.
    • You connect your phone to the ESP32 AP.
    • A small web server runs on the ESP32, showing a config page.
    • You pick an SSID from the scan list and type the password.
    • It stores the password in EEPROM, flash, NVS, etc.
    • Then ESP32 reboots and automatically joins the saved WiFi.

    Everything happens automatically. Your code just says:
    “If WiFi is not configured, launch the configuration portal.”

    That’s it.

    The Easiest Way to Use WiFiManager on ESP32

    The most beginner-friendly way is using the arduino esp32 wifimanager setup. You only install a library and write a few lines of code.

    Step 1: Install the WiFiManager Library

    Open Arduino Library Manager and search for:

    “WiFiManager by tzapu”

    This library includes ESP8266 support by default, but ESP32 versions are maintained by the community and work properly under names like:

    • wifimanager esp32
    • tzapu wifimanager esp32
    • wifimanager esp32 master
    • esp32 arduino wifimanager library

    The ESP32-compatible versions usually appear as forks, but the experience is the same.

    A Simple esp32 wifimanager example

    Here’s a minimal ESP32 WiFiManager example beginners use. This works great in Arduino IDE or PlatformIO.

    You’ll see how simple it is:

    • It starts WiFiManager.
    • If ESP32 can’t connect, it opens a portal.
    • You configure with your phone.

    Why ESP32 WiFiManager Is Better Than Hardcoding Credentials

    Let’s compare:

    Hardcoding method

    • SSID stored in code
    • Password stored in code
    • Must recompile when router changes
    • Not safe
    • Not user-friendly

    With WiFiManager

    • User sets SSID and password themselves
    • Stored in flash memory
    • Auto-connects on next boot
    • No re-flashing needed
    • Works even if users have no coding skills
    • Your project becomes “consumer-ready”

    If you’re new to ESP32 networking, you can also explore a simple web server setup here: ESP32 Web Server Tutorials
    It keeps things easy because you don’t have to expose your router password to anyone, you don’t have to worry about the code breaking due to a wrong WiFi entry, and if the router changes, users simply reconnect through the portal.

    Where WiFiManager Stores WiFi Credentials in ESP32

    Different versions use different places:

    • EEPROM
    • NVS (Non-Volatile Storage)
    • Flash memory

    That’s why you’ll see tutorials showing:

    esp32 password eeprom wifimanager
    or
    esp32 read eeprom for ssid and pass wifimanager

    Some libraries prefer NVS because it’s safer and faster. EEPROM works too, but you need to allocate space manually.

    The good news is you don’t have to dig deep into the memory system. WiFiManager abstracts most of it.

    When ESP32 Requires Login Before Configuring WiFi

    Some people want security.
    Imagine shipping an IoT device and you don’t want strangers connecting to the ESP32 setup portal.

    You can require:

    • A custom username/password
    • A unique AP name
    • A unique password based on device ID
    • Locked configuration screen

    This feature is often used in:

    esp32 requires login wifimanager
    esp32 wifimanager custom parameters

    The portal feels like a normal login page. You enter a password, and only then you can change WiFi details.

    WiFiManager Works on Arduino IDE, PlatformIO, and ESP-IDF

    Whatever you’re using:

    • esp32 wifimanager arduino ide
    • wifimanager esp32 platformio
    • esp32 wifimanager idf

    …WiFiManager integrates smoothly.

    Arduino IDE is the simplest.
    PlatformIO gives better structure and debugging.
    ESP-IDF requires more control and is slightly more complex.

    WiFiManager Makes OTA Updates Easier

    You can pair WiFiManager with OTA (Over-the-Air updates) so the device updates itself without USB flashing. People often search for:

    esp32 wifimanager ota

    With OTA, your device can:

    • Update firmware wirelessly
    • Stay up-to-date without manual flashing
    • Serve new device features
    • Fix bugs remotely

    Imagine flashing 50 devices one-by-one.
    OTA + WiFiManager solves that headache by allowing users to upload updates through a browser or cloud.

    Real Projects Where People Use ESP32 WiFiManager

    Here are common projects where people use WiFiManager naturally:

    ESP32 Blynk WiFiManager
    This lets you link Blynk IoT dashboard with WiFi configuration.

    ESP32 DS18B20 Web Server WiFiManager
    You show temperature data in a browser and also configure WiFi easily.

    Smart home switches
    Where users configure WiFi through a small configuration page.

    Weather stations & IoT sensors
    That work in fields or farms and must reconnect even if the router changes.

    Home automation hubs
    That act as local servers.

    In all these cases, WiFiManager feels almost necessary.

    Setting Up WiFiManager for ESP32 in Arduino IDE

    If you are using Arduino IDE, this is the easiest path. Make sure you’ve installed the ESP32 boards package from the Board Manager.

    Then install the library:

    Search for
    WiFiManager by tzapu

    Even though this library was originally made for ESP8266, many ESP32-compatible versions exist. You’ll see community ports listed as:

    • wifimanager esp32
    • tzapu wifimanager esp32
    • esp32 arduino wifimanager versions
    • wifimanager.h esp32 forks

    Choose the one that clearly mentions ESP32 support.

    If you prefer PlatformIO, don’t worry; I’ll show the wifimanager esp32 platformio install later in this article.

    Your First Simple esp32 wifimanager example

    Let’s make a basic example. This code allows your ESP32 to:

    • Try connecting to WiFi
    • If connection fails, open configuration portal
    • Let you set the WiFi through the portal
    • Save SSID + password automatically

    This is the version most beginners use.

    Simple ESP32 WiFiManager Code (Beginner-Friendly)

    #include <WiFi.h>
    #include <WiFiManager.h>  
    
    void setup() {
      Serial.begin(115200);
    
      WiFiManager wm;
    
      bool res = wm.autoConnect("ESP32-Setup");
    
      if (!res) {
        Serial.println("Failed to connect. Restarting...");
        ESP.restart();
      }
      else {
        Serial.println("Connected to WiFi!");
        Serial.println(WiFi.localIP());
      }
    }
    
    void loop() {
    }
    

    This tiny code does a lot.

    When the ESP32 boots:

    • It tries using stored credentials
    • If no credentials are saved or connection fails
    • ESP32 becomes a hotspot named “ESP32-Setup”
    • You connect to that hotspot
    • A WiFiManager page opens
    • You choose your home router
    • Enter password
    • Save
    • ESP32 stores it
    • Reboots
    • Connects automatically

    This is why people love wifimanager esp32 code — it’s simple and it works.

    Using WiFiManager on ESP32 with EEPROM

    Many newcomers wonder how to store credentials in EEPROM. WiFiManager already manages storage internally, but some versions use EEPROM explicitly. You’ll see tutorials mentioning:

    • esp32 password eeprom wifimanager
    • esp32 read eeprom for ssid and pass wifimanager

    EEPROM can be used if you want to store extra passwords, tokens, or offline settings.

    Here’s an example showing how you could write and read EEPROM manually (not required for normal WiFiManager use):

    #include <EEPROM.h>
    
    void writeCredentials(String ssid, String pass) {
      EEPROM.begin(128);
      EEPROM.writeString(0, ssid);
      EEPROM.writeString(32, pass);
      EEPROM.commit();
    }
    
    void readCredentials() {
      EEPROM.begin(128);
      String ssid = EEPROM.readString(0);
      String pass = EEPROM.readString(32);
      Serial.println("Stored SSID: " + ssid);
      Serial.println("Stored Password: " + pass);
    }
    

    Again, WiFiManager handles almost everything, so you only need this if your project demands full control.

    Adding Custom Parameters with esp32 wifimanager custom parameters

    Sometimes you need more than just WiFi credentials.
    Maybe:

    • A Blynk token
    • A device name
    • A server address
    • An MQTT username/password
    • A unique API key

    WiFiManager lets you create custom fields in the portal.

    Think of it like:
    “Along with SSID and password, also ask the user for whatever else my project needs.”

    Here’s a friendly example.

    Example: Custom Parameters in WiFiManager

    #include <WiFi.h>
    #include <WiFiManager.h>
    
    char deviceName[40] = "MyESP32";
    
    void setup() {
      Serial.begin(115200);
    
      WiFiManager wm;
    
      WiFiManagerParameter custom_device_name("devname", "Device Name", deviceName, 40);
    
      wm.addParameter(&custom_device_name);
    
      bool res = wm.autoConnect("ESP32-Config");
    
      if (!res) {
        Serial.println("Failed to connect");
        ESP.restart();
      }
    
      Serial.println("Connected!");
      Serial.print("Device Name: ");
      Serial.println(custom_device_name.getValue());
    }
    
    void loop() {
    
    }
    

    Now your portal shows:

    • SSID field
    • Password field
    • Device name text box

    Users can enter custom data. This is a must-have in advanced IoT setups, and this is why esp32 wifimanager custom parameters is a very popular search topic.

    ESP32 WiFiManager OTA (Over-the-Air Updates)

    Adding OTA makes the project feel professional. Imagine shipping sensors everywhere and updating them without touching a USB cable. That’s the power of esp32 wifimanager ota projects.

    The flow is simple:

    • WiFiManager helps ESP32 join WiFi
    • OTA update server becomes active
    • You upload new firmware from your browser or Arduino IDE

    A basic OTA setup looks like this:

    #include <WiFi.h>
    #include <WiFiManager.h>
    #include <ArduinoOTA.h>
    
    void setup() {
      Serial.begin(115200);
    
      WiFiManager wm;
      wm.autoConnect("ESP32-OTA");
    
      ArduinoOTA.begin();
    
      Serial.println("OTA Ready");
    }
    
    void loop() {
      ArduinoOTA.handle();
    }
    

    Once the user sets WiFi credentials with WiFiManager, OTA becomes fully available.

    If you want rock-solid IoT devices, OTA is essential.

    Using WiFiManager for ESP32 on PlatformIO

    If you prefer PlatformIO over Arduino IDE, installation is simple.

    Add this to your platformio.ini:

    lib_deps =
      tzapu/WiFiManager
    

    If that version doesn’t support ESP32, use one of the ESP32 forks:

    lib_deps =
      WiFiManager-ESP32
    

    PlatformIO will automatically pull the correct version.

    Then the code you write is identical.
    If you’re using VS Code, debugging becomes much easier.

    Using WiFiManager with ESP-IDF

    If you’re building professional-grade applications, you might use ESP-IDF.
    While there’s no official WiFiManager for ESP-IDF, several community ports exist.

    This helps fulfill:
    esp32 wifimanager idf

    Developers build:

    • Captive portal
    • AP mode
    • WiFi scanning
    • A tiny HTTP server

    The logic remains the same as the Arduino version, just more hands-on.

    Real-World Example: ESP32 Blynk WiFiManager

    Let’s say you’re building a Blynk IoT device.
    Hardcoding your Blynk token isn’t ideal since you might want to change it later.

    With WiFiManager:

    • Add a field for Blynk token
    • Save it
    • Connect to WiFi
    • Connect to Blynk automatically

    This is why tutorials for esp32 blynk wifimanager are so popular.

    Real-World Example: ESP32 DS18B20 Webserver WiFiManager

    Imagine a temperature monitoring project.

    You use:

    • DS18B20 sensor
    • ESP32 web server
    • WiFiManager portal

    Users can configure WiFi, then see temperature in a browser.

    This makes esp32 ds18b20 webserver wifimanager a real and practical topic.

    Troubleshooting: When ESP32 Requires Login to Access Portal

    Some people face this issue:

    esp32 requires login wifimanager

    This usually happens because:

    • You are using a custom password
    • Browser caches old config pages
    • Captive portal logic tries redirecting to a login page

    Most fixes include:

    • Clearing browser cache
    • Changing AP name
    • Using a unique portal password
    • Updating the library version

    How to Trigger WiFi Reset with a Button

    A very common request is:

    “How do I erase WiFi settings and reopen the WiFiManager portal again?”

    Because sometimes you ship a device to someone, but they change their router.
    Your ESP32 can’t magically guess the new WiFi credentials.

    So you need a reset option.

    Here’s a simple and clean way to do it:

    #include <WiFi.h>
    #include <WiFiManager.h>
    
    #define RESET_PIN 0
    
    void setup() {
      Serial.begin(115200);
    
      pinMode(RESET_PIN, INPUT_PULLUP);
    
      if (digitalRead(RESET_PIN) == LOW) {
        WiFiManager wm;
        wm.resetSettings(); 
        delay(1000);
        ESP.restart();
      }
    
      WiFiManager wm;
      wm.autoConnect("ESP32-Resettable");
    }
    
    void loop() {
    }
    

    Hold the button at boot → ESP32 wipes stored WiFi → Portal opens again.
    This solves a lot of real-world user frustrations.

    Captive Portal Behavior Explained

    Have you ever connected to hotel WiFi and a page pops up automatically?
    Same idea.

    WiFiManager tries to:

    • Force the browser to load the config page
    • Redirect all connections to itself

    But sometimes you may see issues like:

    • The portal doesn’t pop automatically
    • Browser shows “Login Required”
    • You manually open 192.168.4.1

    This is one of the reasons search phrases like:

    • esp32 requires login wifimanager
    • wifimanager esp32 examples

    are so popular.

    Why it happens:

    Browsers cache DNS aggressively.
    Phones wait for a specific “captive portal detection URL.”
    Different devices behave differently.

    Quick tips:

    • Use a unique AP name
    • Avoid special characters
    • Update your WiFiManager library
    • Restart your phone WiFi
    • Try opening any HTTP website (not HTTPS)

    It’s normal behavior, not a problem with your code.

    Auto-Reconnect Logic for Unstable WiFi

    Sometimes routers reboot, or signals drop. The ESP32 tries reconnecting but may fail silently.

    You can add a simple reconnect loop:

    void loop() {
      if (WiFi.status() != WL_CONNECTED) {
        WiFi.reconnect();
        delay(1000);
      }
    }
    

    This ensures your IoT device doesn’t get “lost” after a temporary WiFi outage.

    Many real-world IoT devices use this logic, especially for smart farming, home automation, and remote sensors.

    Using WiFiManager with MQTT or API Services

    If your project uses:

    • Blynk
    • Node-RED
    • Home Assistant
    • Thingspeak
    • Firebase
    • AWS / Azure MQTT

    You often need more than SSID + password.

    This is where esp32 wifimanager custom parameters becomes the true hero.

    You can add custom fields like:

    • MQTT server
    • MQTT port
    • MQTT username
    • MQTT password
    • Device name
    • Access token

    Your ESP32 becomes a fully customizable device without touching code again.

    Using WiFiManager for Professional IoT Deployment

    If you’re building a product (even a small DIY product), WiFiManager gives you:

    • User-friendly WiFi setup
    • No hardcoding of credentials
    • Quick recovery after router change
    • Captive portal onboarding
    • Optional password protection

    This is why it’s still one of the most loved ESP32 utilities.

    Securing Your WiFiManager Portal

    Security matters.
    You don’t want someone nearby hijacking your WiFi portal.

    You can add a password:

    wm.autoConnect("MyESP32", "mysecretpass");
    

    Now, the WiFi AP needs a password before access.

    If this is for a real device deployed in public, always use at least WPA2.

    Common Issues and Fixes

    Let’s go over the big ones.

    Problem: ESP32 Keeps Rebooting After Connection

    This happens when:

    • WiFi credentials are wrong
    • Router signal is weak
    • ESP32 brownout due to bad power supply

    Fix:
    Use a good 5V 2A adapter.
    ESP32 is sensitive to power dips during WiFi.

    Problem: WiFiManager Portal Doesn’t Open Automatically

    This is extremely common.
    Phones sometimes ignore captive portals.

    Fix:
    Open these in browser:

    192.168.4.1
    

    or try:

    • Turn WiFi off → on
    • Forget the ESP32 setup network
    • Try a different phone

    Problem: ESP32 Connects but No Internet

    Sometimes routers block unknown MAC addresses.

    Fix:
    Allow new devices in router settings.

    Problem: WiFiManager not saving credentials

    Your library may be outdated.

    Fix:
    Use an ESP32-supported fork of:

    • tzapu wifimanager esp32
    • wifimanager esp32 library
    • wifimanager esp32 master branch

    Different forks handle storage differently.

    WiFiManager with ESP32 and EEPROM Explained Simply

    People often search for:

    • esp32 password eeprom wifimanager
    • esp32 read eeprom for ssid and pass wifimanager

    Here’s a simple way to think about it:

    WiFiManager stores credentials internally, usually in Non-Volatile Storage (NVS).
    This is safer and more reliable than EEPROM.

    But if you want total control, EEPROM is still an option.

    Think of it as writing a note into flash memory that stays even after reboot.
    Very helpful in custom authentication setups or offline projects.

    WiFiManager + ESP32 Web Server Combo

    If your project has a web interface, WiFiManager acts as the initial gateway.
    After WiFi is configured:

    • ESP32 connects
    • Starts a web server
    • Serves pages like a mini IoT dashboard

    This is popular with sensors like DS18B20.

    The search term esp32 ds18b20 webserver wifimanager basically refers to this combo.

    WiFiManager + Blynk Setup (Real Use Case)

    WiFiManager + Blynk = perfect pair.

    You can:

    • Add custom parameter for Blynk token
    • Save it
    • Use it inside your code
    • Avoid hardcoding secrets

    If you ever switch your Blynk template or token, you don’t need to reflash the device.

    This is why esp32 blynk wifimanager tutorials are everywhere.

    WiFiManager with OTA to Update Code Wirelessly

    OTA is one of the most powerful features in ESP32 development.

    The flow looks like:

    • Set up WiFi using WiFiManager
    • Connect ESP32 to WiFi
    • Activate OTA service
    • Upload new firmware from PC
    • No physical device access needed

    This is crucial for remote projects.

    Using WiFiManager in Commercial-Grade Projects

    Lots of DIY tutorials stop at basic examples.
    But real IoT products rely heavily on the following:

    • Custom parameters
    • Reset button
    • Protected WiFi portal
    • Auto-reconnect
    • OTA support
    • Stable hardware power
    • Clean fallback logic

    I’ve seen full home automation systems built around the simple idea of “configure WiFi only once.”

    And yes, WiFiManager makes that possible for the ESP32.

    Real-Time ESP32 WebSocket Example With Sensor Data (DHT11,MQ135,OLED, RTC etc.)

    If you’re building real IoT dashboards, you often need real-time updates without refreshing the page. WebSockets are perfect for showing live sensor values like temperature, humidity, air quality, RTC time, or even switching GPIO pins.

    Below is a simple structure you can expand:

    Example Use Case

    Your ESP32 collects:

    • Temperature & humidity from DHT11
    • Air-quality values from MQ135
    • Real time from RTC module
    • Display on OLED screen
    • And sends all data to browser via WebSocket

    Why WebSocket Works Best Here

    • Real-time data (no refresh)
    • Low bandwidth usage
    • Works great for dashboards
    • Perfect for sensor-based IoT projects
    • Smooth UI (graphs, counters etc.)

    Complete WebSocket Message Structure (Recommended)

    You can send a single JSON string containing all sensor values:

    {
      "temperature": 29.4,
      "humidity": 52,
      "air_quality": 210,
      "rtc_time": "2025-11-22 23:20:00",
      "status": "OK"
    }
    

    On the browser, you decode it like:

    let data = JSON.parse(event.data);
    document.getElementById("temp").innerHTML = data.temperature;
    

    ESP32 Code Example: Sending Sensor Values via WebSocket

    Below is a beginner-friendly example you can expand later:

    #include <WiFi.h>
    #include <WebSocketsServer.h>
    #include <DHT.h>
    
    #define DHTPIN 4
    #define DHTTYPE DHT11
    DHT dht(DHTPIN, DHTTYPE);
    
    const char* ssid = "YourWiFi";
    const char* password = "YourPass";
    
    WebSocketsServer webSocket = WebSocketsServer(81);
    
    void setup() {
      Serial.begin(115200);
      dht.begin();
    
      WiFi.begin(ssid, password);
      while (WiFi.status() != WL_CONNECTED) {
        delay(500);
      }
    
      webSocket.begin();
    }
    
    void loop() {
      webSocket.loop();
    
      float t = dht.readTemperature();
      float h = dht.readHumidity();
    
      String json = "{\"temperature\":" + String(t) +
                    ",\"humidity\":" + String(h) +
                    "}";
    
      webSocket.broadcastTXT(json);
      delay(2000);
    }
    

    This acts like a real-time data server.

    Client Side (Browser) HTML/JS Example

    <!DOCTYPE html>
    <html>
    <body>
    
    <h2>ESP32 WebSocket Live Dashboard</h2>
    
    <p>Temperature: <span id="temp">--</span> °C</p>
    <p>Humidity: <span id="hum">--</span> %</p>
    
    <script>
    let socket = new WebSocket("ws://192.168.1.10:81/");
    
    socket.onmessage = function(event){
        let d = JSON.parse(event.data);
        document.getElementById("temp").innerHTML = d.temperature;
        document.getElementById("hum").innerHTML = d.humidity;
    };
    </script>
    
    </body>
    </html>
    

    Just paste it into your browser, and it will update live.

    Adding GPIO Control via WebSocket (Turn LED ON/OFF)

    You can also allow control + monitoring from a single WebSocket.

    Example message:

    {"led": "on"}
    

    ESP32 receives it:

    if (data.indexOf("on") > 0) {
      digitalWrite(2, HIGH);
    }
    

    Browser sends it:

    socket.send('{"led":"on"}');
    

    Now your dashboard becomes two-way real-time control.

    Best Practices for ESP32 WebSocket Projects

    Use JSON

    Easy to parse, clean, expandable, and readable.

    Keep messages light

    Avoid very long or repeated strings.

    Send at fixed intervals

    1–2 seconds is enough for sensors.

    Avoid delays in main loop

    Use millis() for stable timing.

    Use separate WiFi channel

    ESP32 WiFi can get slow if overloaded.

  • ESP32 Static IP: 7 Powerful Ways to Easily Set a Stable IP Address

    Learn how to set ESP32 static IP easily with step-by-step tutorials. Fix ESP32 static IP issues, set WiFi and Ethernet IP, and master ESP32 networking.

    If you’re working with the ESP32 for home automation, IoT dashboards, security cameras, or any smart system, at some point you will face one annoying problem: the ESP32 keeps changing its IP address. One day your ESP32 is working fine, and the next day Home Assistant cannot reach it. Your mobile app cannot connect. Your web server breaks. Your automation fails silently.

    This happens because, by default, the ESP32 uses DHCP, where your router dynamically assigns an IP address. That means the IP might change anytime the device reboots, reconnects, or the router resets.

    The solution is simple: set a static IP.

    In this tutorial, you’ll learn everything about configuring an ESP32 static IP, regardless of the platform you use. Whether you’re working with the Arduino IDE, ESP-IDF, MicroPython, ESPHome, or Home Assistant, I will walk you through it step by step.

    We’ll also cover esp32 static ip not working issues, Ethernet static IP, AP mode fixed IP, and real examples such as esp32 cam static ip address.

    What Is a Static IP on ESP32?

    A static IP is a permanent IP address that you manually assign to the ESP32. This ensures that your device always uses the same IP every time it connects to your WiFi or Ethernet network.

    Why does this matter?

    Because many projects depend on stable communication:

    • Home Assistant dashboards
    • Local web servers
    • ESP32 security camera streaming
    • MQTT brokers
    • REST API endpoints
    • ESP32 remote sensors
    • IoT automations

    If the IP changes, you lose connection. Not fun.

    That’s why setting an esp32 static fixed IP address is almost a must for any serious project. And if you are also exploring WiFi-related setups, you can check this helpful guide on ESP32 WiFi scanning here: ESP32 WiFi Scan Tutorials
    It fits perfectly with learning how your ESP32 behaves on the network before assigning a stable IP.

    Where You Should Use a Static IP Address

    Here are the most common real-world cases:

    1. Home Assistant ESP32 Static IP

    If you add your ESP32 to Home Assistant and its IP changes, HA will show it as offline. So you must use a home assistant esp32 static ip setup to keep your sensors and ESPHome devices stable.

    2. ESPHome ESP32 Static IP

    ESPHome YAML configurations often use manual_ip: to ensure the device stays reachable.

    3. ESP32 WiFi Server

    If you host:

    • Web server
    • REST API
    • Camera feed
    • Control dashboard

    Then you must use esp32 server static ip or clients will lose access.

    4. ESP32 Websocket Server

    Websocket connections break if the IP changes.

    5. ESP32 MQTT

    MQTT brokers rely on stable client addresses.

    6. ESP32 Ethernet Projects

    If you use LAN8720 or W5500, setting esp32 ethernet static ip example is required for stability.

    Choosing the Right IP for Your ESP32

    Before jumping into code, you need to pick the correct IP address.

    Rule of thumb: choose an IP outside the DHCP range.

    Example:

    • Router DHCP range: 192.168.1.100 – 192.168.1.200
    • Good static IP choices:
      • 192.168.1.50
      • 192.168.1.60
      • 192.168.1.90

    Subnet mask:
    255.255.255.0

    Gateway:
    Your router IP (usually 192.168.1.1 or 192.168.0.1).

    DNS:
    Prefer Google DNS: 8.8.8.8 (optional but reliable)

    ESP32 Static IP Using Arduino

    Let’s start with the most common environment: Arduino IDE.

    Here is the simplest arduino esp32 set static ip code:

    #include <WiFi.h>
    
    const char* ssid = "YourWiFi";
    const char* password = "YourPassword";
    
    // Static IP configuration
    IPAddress local_IP(192.168.1.60);
    IPAddress gateway(192.168.1.1);
    IPAddress subnet(255.255.255.0);
    IPAddress dns(8.8.8.8);
    
    void setup() {
      Serial.begin(115200);
    
      if (!WiFi.config(local_IP, gateway, subnet, dns)) {
        Serial.println("Static IP failed");
      }
    
      WiFi.begin(ssid, password);
    
      Serial.print("Connecting");
      while (WiFi.status() != WL_CONNECTED) {
        delay(500);
        Serial.print(".");
      }
    
      Serial.println();
      Serial.println("Connected!");
      Serial.print("IP Address: ");
      Serial.println(WiFi.localIP());
    }
    
    void loop() {
    
    }
    

    This covers:

    • esp32 static ip address
    • esp32 wifi static ip address
    • esp32 set static ip address
    • esp32 wifi begin static ip

    Once uploaded, your ESP32 will always get 192.168.1.60.

    ESP32 Static IP Not Working? Fix It

    The most common reason esp32 static ip not working happens is incorrect configuration.

    Here are the real causes beginners face:

    1. IP Already in Use

    Use:
    arp -a
    to check connected devices.

    2. Wrong Gateway

    If your router uses 192.168.0.1, you must match it.

    3. Router Blocking Manual IP

    Some routers force devices to use DHCP.

    Fix:
    Enable Static Lease / IP Reservation in router settings.

    4. Wrong Subnet Mask

    Should be:
    255.255.255.0 for most home networks.

    5. WiFi.config() Called After WiFi.begin()

    Static IP won’t apply.

    ESP32 AP Mode Static IP

    If your ESP32 is working as a hotspot (Access Point), you can use esp32 ap mode static ip.

    WiFi.softAPConfig(
      IPAddress(192.168.4.1),
      IPAddress(192.168.4.1),
      IPAddress(255.255.255.0)
    );
    WiFi.softAP("ESP32_AP", "12345678");
    

    The default AP IP is 192.168.4.1, but you can change it.

    ESP32 CAM Static IP Address

    ESP32-CAM becomes more stable with a static IP because the camera stream breaks if DHCP changes the IP.

    WiFi.config(local_IP, gateway, subnet, dns);
    WiFi.begin(ssid, password);
    

    Most people use:
    192.168.1.200 or 192.168.1.210

    ESP32 Static IP with ESPHome + Home Assistant

    For Home Assistant users, ESPHome is common.

    Here is esp32 static ip yaml:

    wifi:
      ssid: "MyWiFi"
      password: "MyPassword"
    
      manual_ip:
        static_ip: 192.168.1.90
        gateway: 192.168.1.1
        subnet: 255.255.255.0
        dns1: 8.8.8.8
    

    This covers:

    • esphome esp32 static ip
    • home assistant esp32 static ip

    ESP32 Static IP Using MicroPython

    If you’re coding in MicroPython, here’s a simple esp32 micropython static ip example:

    import network
    
    station = network.WLAN(network.STA_IF)
    station.active(True)
    
    station.ifconfig((
      '192.168.1.80',  # static IP 
      '255.255.255.0',  # subnet
      '192.168.1.1',  # gateway
      '8.8.8.8'       # DNS
    ))
    
    station.connect("MyWiFi", "MyPassword")
    
    print(station.ifconfig())
    

    MicroPython makes IP setting straightforward.

    ESP32 Static IP in ESP-IDF

    ESP-IDF gives full control. This is the esp32 static ip idf approach:

    Key steps:

    1. Stop DHCP client
    2. Set IP info
    3. Start WiFi

    Snippet:

    tcpip_adapter_dhcpc_stop(TCPIP_ADAPTER_IF_STA);
    
    tcpip_adapter_ip_info_t ipInfo;
    IP4_ADDR(&ipInfo.ip, 192,168,1,70);
    IP4_ADDR(&ipInfo.gw, 192,168,1,1);
    IP4_ADDR(&ipInfo.netmask, 255,255,255,0);
    
    tcpip_adapter_set_ip_info(TCPIP_ADAPTER_IF_STA, &ipInfo);
    

    This is for WiFi. Ethernet uses similar logic.

    ESP32 Ethernet Static IP Example (LAN8720 / W5500)

    If you’re using Ethernet instead of WiFi, here’s an esp32 ethernet static ip example in Arduino:

    ETH.begin(1);
    ETH.config(
      IPAddress(192.168.1.55),
      IPAddress(192.168.1.1),
      IPAddress(255.255.255.0),
      IPAddress(8.8.8.8)
    );
    

    Same concept, just using Ethernet instead of WiFi.

    ESP32 Get IP Addres

    At any time, you can check your current IP:

    Serial.println(WiFi.localIP());
    

    This is handy when testing DHCP vs static IP.

    Assign Static IP to ESP32 via Router

    Some people prefer setting a MAC-based static lease in their router instead of writing code.

    This is called:

    • dhcp reservation
    • ip lease
    • assign static ip to esp32

    Steps:

    1. Log in to router
    2. Find ESP32 MAC address
    3. Reserve an IP

    Why Static IP Matters for Real Projects

    If you’ve ever built a project like:

    • Smart home sensor
    • ESP32 cam streaming live feed
    • Home security dashboard
    • MQTT-based automation
    • ESP32 web server or API
    • Home Assistant integration

    Then you already know that IP changes are your biggest enemy.

    Imagine hosting an ESP32 server at /temperature that your automation reads every minute. If the IP changes from 192.168.1.150 to 192.168.1.181, everything breaks—Home Assistant shows errors, your app becomes unreachable, and debugging becomes a headache.

    That’s why using a esp32 set static ip address or assigning static IP via your router is almost a requirement for any real world IoT deployment.

    DHCP vs Static IP – The Real Difference

    Let’s break it down in simple terms.

    DHCP (Dynamic Host Configuration Protocol)

    • Router assigns IP automatically
    • IP can change anytime
    • ESP32 doesn’t control its address
    • Great for casual use
    • Bad for servers and automation

    Static IP (Manual IP)

    • You choose a fixed IP
    • ESP32 uses it forever
    • Perfect for servers, APIs, HA, dashboards
    • Zero breakage in automation
    • More reliable

    So, if you want long-term stability, static IP is the way.

    Two Ways to Use Static IP on ESP32

    A lot of beginners get confused here. There are only two reliable methods:

    1. Set static IP inside ESP32 code

    Examples:

    • Arduino
    • MicroPython
    • ESP-IDF
    • ESPHome YAML

    This is what you did earlier.

    2. Assign static IP from Router (Static Lease)

    This is sometimes better.

    You map ESP32’s MAC address → fixed IP.

    Advantages:

    • IP never changes
    • No need to modify code
    • Works with firmware updates
    • Router handles all IP logic

    Search your router admin page for:

    • “Static IP assignment”
    • “Address reservation”
    • “DHCP reservation”
    • “Bind IP + MAC”

    Both methods work. You can choose whichever fits your setup.

    Deep Dive: ESP32 in Server Mode with Static IP

    When ESP32 acts as a server, you absolutely must use a static IP.

    Why?

    Because clients rely on the address. A web browser, mobile app, or Home Assistant all connect to the same endpoint.

    Example request:
    http://192.168.1.90/data

    If the IP changes, the entire system breaks.

    This is why you should always configure esp32 server static ip whenever you serve:

    • HTML pages
    • JSON data
    • REST API endpoints
    • WebSockets
    • Live video streams

    A stable IP makes everything predictable.

    ESP32 Static IP with Web Server Example (Arduino)

    Here’s a friendly and clean example for a web server using static IP:

    #include <WiFi.h>
    #include <WebServer.h>
    
    const char* ssid = "MyWiFi";
    const char* password = "MyPassword";
    
    IPAddress local_IP(192.168.1.60);
    IPAddress gateway(192.168.1.1);
    IPAddress subnet(255.255.255.0);
    
    WebServer server(80);
    
    void handleRoot() {
      server.send(200, "text/plain", "Hello from ESP32");
    }
    
    void setup() {
      Serial.begin(115200);
      WiFi.config(local_IP, gateway, subnet);
      WiFi.begin(ssid, password);
    
      while (WiFi.status() != WL_CONNECTED) {
        delay(500);
      }
    
      server.on("/", handleRoot);
      server.begin();
    }
    
    void loop() {
      server.handleClient();
    }
    

    This ensures your server always lives at 192.168.1.60.

    ESP32 Static IP Ethernet Setup (Deep Explanation)

    Earlier we saw a quick esp32 ethernet static ip example. Now let’s go deeper.

    You may use:

    • LAN8720 Ethernet PHY
    • W5500 SPI Ethernet module
    • Built-in ESP32-Ethernet (in ESP32-S3, ESP32-S2, some modules)

    Ethernet is far more stable than WiFi for industrial IoT.

    The logic is:

    1. Initialize Ethernet
    2. Disable DHCP
    3. Set static IP
    4. Start Ethernet

    Full example:

    #include <ETH.h>
    
    static bool eth_connected = false;
    
    void setup() {
      Serial.begin(115200);
    
      ETH.begin(
        1,       // Address
        0,       // Power pin
        23,      // MDC pin
        18       // MDIO pin
      );
    
      ETH.config(
        IPAddress(192.168.1.55),
        IPAddress(192.168.1.1),
        IPAddress(255.255.255.0),
        IPAddress(8.8.8.8)
      );
    }
    
    void loop() {
      if (ETH.linkUp()) {
        if (!eth_connected) {
          Serial.println("Ethernet Connected");
          eth_connected = true;
        }
      }
    }
    

    This example ensures Ethernet always stays at a known IP.

    ESP32 Fix IP Address Using Router Only

    Many professional developers actually prefer handling static IP at the router level.

    Why?

    • Cleaner firmware
    • Less risk of conflicts
    • Works across reboots
    • Easier maintenance

    You usually find this in router UI under “LAN Settings”.

    Here’s the required information:

    ESP32 MAC Address

    You can print it in Arduino:

    Serial.println(WiFi.macAddress());
    

    Then assign an IP like 192.168.1.77 to that MAC.

    This is known as:

    • assign static ip to esp32
    • reserved IP lease
    • static DHCP

    This method also helps when your esp32 static ip not working in code.

    ESP32 Static IP in ESP-IDF (Advanced Users)

    The ESP-IDF method gives you full control.

    Newer IDF versions use:

    esp_netif_dhcpc_stop(netif);
    esp_netif_set_ip_info(netif, &ipInfo);
    

    The older method uses:

    tcpip_adapter_dhcpc_stop()
    

    You also need to use:

    esp_netif_create_default_wifi_sta();
    esp_wifi_connect();
    

    A complete ESP-IDF static IP setup includes:

    • Creating network interface
    • Stopping DHCP
    • Configuring IP
    • Applying DNS
    • Connecting

    It feels a bit heavy for beginners, but it’s the most reliable method in professional systems.

    Why ESP32 Static IP Sometimes Fails

    Let’s break down real reasons behind esp32 static ip not working. Most people blame the code, but the issue is usually the network.

    Here’s the complete truth.

    Reason 1: IP Already Taken

    Two devices cannot share the same IP. This is the most common beginner mistake.

    Check devices on your network using:

    • Router admin
    • arp -a command
    • Network scanner apps

    Reason 2: Wrong Gateway

    If router is 192.168.0.1, but you enter 192.168.1.1, nothing will work.

    Gateways must match your network.

    Reason 3: Wrong Subnet Mask

    Most networks use:
    255.255.255.0

    But some fiber routers use:
    255.255.254.0

    Mismatch = no connection.

    Reason 4: WiFi.config() Used After WiFi.begin()

    Order matters.

    Wrong order:

    WiFi.begin();
    WiFi.config();
    

    Correct order:

    WiFi.config();
    WiFi.begin();
    

    Reason 5: Router Blocking Manual IP

    Some routers require IP reservations for manual IPs.
    Simple fix: add ESP32 MAC in Router → DHCP Reservation.

    Reason 6: DNS Missing

    If DNS is not set, internet requests fail.

    Fix:

    WiFi.config(localIP, gateway, subnet, dns);
    

    Use Google DNS: 8.8.8.8.

    Reason 7: Using IP Outside Network Range

    Example mistake:
    Router is 192.168.0.x but you assign 192.168.1.50.

    Different network = no chance of connecting.

    ESP32 AP Mode Static IP (More Details)

    The AP mode (Access Point mode) turns your ESP32 into a hotspot.

    Default AP IP is:
    192.168.4.1

    You can update it like this:

    WiFi.softAPConfig(
      IPAddress(192.168.10.1),
      IPAddress(192.168.10.1),
      IPAddress(255.255.255.0)
    );
    WiFi.softAP("ESP32_AP", "12345678");
    

    Why use AP mode static IP?

    • Offline control system
    • Robot control
    • Local WiFi mesh
    • Direct ESP32 device access without router

    It guarantees predictable access.

    ESP32 CAM Static IP: Stability Boost

    The esp32 cam static ip address setup makes your camera:

    • load faster
    • stream reliably
    • reconnect without losing IP
    • work perfectly with Home Assistant

    A recommended IP range for cameras:
    192.168.1.200–220

    Camera streams can be sensitive. If the IP changes, your RTSP or HTTP stream breaks instantly, so using a fixed IP is a common practice.

    ESPHome ESP32 Static IP: More Examples

    Here’s an advanced esp32 static ip yaml configuration:

    wifi:
      ssid: "HomeWiFi"
      password: "Password123"
    
      manual_ip:
        static_ip: 192.168.1.91
        gateway: 192.168.1.1
        subnet: 255.255.255.0
        dns1: 8.8.8.8
        dns2: 1.1.1.1
    
    api:
    ota:
    logger:
    

    Why ESPHome + static IP is powerful:

    • Works perfectly with Home Assistant
    • ESPHome devices reboot often
    • DHCP can break sensors
    • YAML is simple and human-readable
    • You control everything

    This solves home assistant esp32 static ip issues permanently.

    ESP32 Get IP Address, Gateway, and More

    You can print full IP info:

    Serial.println(WiFi.localIP());
    Serial.println(WiFi.gatewayIP());
    Serial.println(WiFi.subnetMask());
    

    Useful while testing static vs dynamic IP.

    Full Troubleshooting Guide for ESP32 Static IP

    Even experienced developers face issues with static IP. Networks vary, routers behave differently, and DHCP servers sometimes interfere. So let’s look at real-world problems and solutions.

    Problem 1: ESP32 won’t connect when static IP is used

    Possible causes:

    • Wrong gateway
    • Wrong subnet
    • IP conflict
    • DHCP still active
    • Wrong order of WiFi calls

    Fix

    Double-check:

    WiFi.config(localIP, gateway, subnet);
    WiFi.begin(ssid, password);
    

    If you reverse the order, it fails.

    Problem 2: ESP32 Static IP Not Working After Reboot

    This is very common.

    Reason:
    Your router forces DHCP for unknown devices.

    Fix

    Add ESP32 MAC address to your router’s DHCP reservation.

    Search your router page for:

    • Reserved IP
    • DHCP static lease
    • Bind IP to MAC

    This is the best long-term method to assign static ip to esp32.

    Problem 3: ESP32 connects but has no internet

    This happens when:

    • DNS not set
    • Gateway wrong
    • Router blocks manual DNS

    Fix

    WiFi.config(localIP, gateway, subnet, dns1, dns2);
    

    Use Google DNS:
    8.8.8.8
    1.1.1.1

    Problem 4: ESP32 Ethernet Static IP Not Working

    Reasons:

    • PHY not initialized
    • Wrong wiring (MDIO/MDC)
    • Static IP outside LAN
    • DHCP not disabled

    Fix

    Use this flow:

    ETH.begin();
    ETH.config(ip, gateway, subnet, dns);
    

    Check link status:

    if (ETH.linkUp()) {
        Serial.println("Ethernet Connected");
    }
    

    Problem 5: ESP32 AP Mode Static IP Not Responding

    When using esp32 ap mode static ip, clients must use the same network range.

    Example:
    If AP IP is 192.168.10.1, your phone might automatically use:

    192.168.10.x

    If not, AP will not respond.

    Fix

    Use this:

    WiFi.softAPConfig(AP_ip, AP_gateway, AP_subnet);
    

    Problem 6: ESP32 Camera Freezes Without Static IP

    The ESP32-CAM is sensitive. When IP changes, the stream drops.

    Fix

    Use a high-range stable IP like:

    192.168.1.210

    And configure static IP in router.

    Best Practices for ESP32 Static IP

    If you want your IoT system to run for years without touching it, follow these golden rules.

    1. Use Router Assigned Static IP (Recommended)

    When possible, always reserve IP from router.

    Advantages:

    • No code changes
    • Works even after firmware update
    • Prevents IP conflicts
    • Plays well with Home Assistant

    Search for:
    “DHCP Reservation” OR “Static Lease”.

    This solves nearly all esp32 static ip not working problems.

    2. Choose IPs Above DHCP Range

    Most routers assign IPs between:

    192.168.1.2 — 192.168.1.150

    So use something like:

    192.168.1.180
    192.168.1.200
    192.168.1.240

    This avoids conflicts.

    3. Use DNS from Google or Cloudflare

    This ensures stable internet.

    Good choices:

    • Google DNS: 8.8.8.8
    • Cloudflare DNS: 1.1.1.1

    4. Keep IP Settings the Same Across All ESP32 Boards

    If you deploy multiple ESP32 devices:

    • Keep subnet same
    • Keep gateway same
    • Only change last octet of IP

    Example:

    192.168.1.91  
    192.168.1.92  
    192.168.1.93  
    

    5. Print IP and Network Info During Boot

    Add:

    Serial.println(WiFi.localIP());
    Serial.println(WiFi.gatewayIP());
    Serial.println(WiFi.subnetMask());
    

    This makes debugging easy.

    6. For Home Assistant Users: Always Prefer Static IP

    If you integrate ESP32 with Home Assistant:

    • ESPHome
    • MQTT
    • HTTP sensors
    • ESP32 camera

    Then static IP is absolutely necessary.

    This solves issues with home assistant esp32 static ip always losing connection.

    7. Document Your IP Plan

    Keep a small note:

    Sensor 1: 192.168.1.90  
    Sensor 2: 192.168.1.91  
    Camera 1: 192.168.1.200  
    

    You’ll thank yourself later.

    Additional Examples

    Let’s cover a few scenarios beginners often ask about.

    ESP32 Static IP with mDNS Enabled

    You can use both static IP + mDNS.

    #include <ESPmDNS.h>
    MDNS.begin("esp32device");
    

    Then you can use:

    http://esp32device.local

    This helps when IP changes accidentally.

    ESP32 WiFi Begin Static IP Example

    Some boards behave better using:

    WiFi.begin(ssid, password, channel, bssid);
    

    If your router has bssid-locking, this improves stability.

    ESP32 Micropython Static IP Example (Simplified)

    import network
    
    sta = network.WLAN(network.STA_IF)
    sta.active(True)
    sta.ifconfig((
        '192.168.1.52',
        '255.255.255.0',
        '192.168.1.1',
        '8.8.8.8'
    ))
    sta.connect("WiFi", "Password")
    

    ESP32 Server Static IP Example (Advanced)

    If you’re hosting multiple endpoints:

    server.on("/json", handleJSON);
    server.on("/status", getStatus);
    server.on("/sensor", getSensorData);
    

    This setup requires a fixed IP so clients can always find the server.

    FAQ : ESP32 Static IP

    1. How to set static IP for ESP32?

    Use:

    WiFi.config(localIP, gateway, subnet);
    

    Then call:

    WiFi.begin(ssid, password);
    

    This sets an esp32 static ip address manually.

    2. Why is my esp32 static ip not working?

    Common reasons:

    • IP conflict
    • Wrong gateway
    • Wrong subnet
    • DNS missing
    • Wrong order of WiFi calls

    Fixing these resolves 99% of issues.

    3. How do I assign static IP to ESP32 from router?

    Go to router → DHCP Reservation → Add ESP32 MAC address → Assign IP.

    This is the safest way to assign static ip to esp32.

    4. How do I set esp32 wifi static ip address?

    Use:

    WiFi.config(localIP, gateway, subnet, dns);
    

    You can also use router-based static IP.

    5. Does ENC28J60 or LAN8720 support esp32 ethernet static ip example?

    Yes. After initializing Ethernet, use:

    ETH.config(ip, gateway, subnet);
    

    Works for both modules.

    6. Can ESP32 CAM use static IP?

    Yes. Setting esp32 cam static ip address improves video stability and prevents stream drops.

    7. What is esp32 ap mode static ip?

    In AP mode, ESP32 becomes WiFi hotspot. You can change default 192.168.4.1 to your own:

    WiFi.softAPConfig(AP_ip, AP_gw, AP_subnet);
    

    8. Can ESP32 static IP work in ESPHome?

    Yes. Use:

    manual_ip:
    

    This is the recommended esphome esp32 static ip method.

    9. How to write esp32 static ip yaml for Home Assistant?

    Example:

    manual_ip:
      static_ip: 192.168.1.91
    

    Perfect for home assistant esp32 static ip integration.

    10. How do I get ESP32 IP address?

    Use:

    WiFi.localIP();
    

    This returns the current IP.

    11. Can I use esp32 static ip idf in production?

    Yes. ESP-IDF allows low-level control for industrial IoT.

    12. What is the best way to fix esp32 static fixed ip address conflicts?

    Use an IP above the DHCP pool, like:

    192.168.1.200.

    13. Does esp32 server static ip improve reliability?

    Yes. A server must have a fixed IP so clients always know where to connect.

    14. Can ESP32 use static IP with MQTT?

    Absolutely. MQTT dashboards work better with a esp32 use static ip setup.