ESP32: assign a static IP and reserve it in the router
Give an ESP32 a fixed IP with WiFi.config(), reserve it in your router with a DHCP reservation, and stop hunting the network for a device that moved.
Tag
3 tutorials
Give an ESP32 a fixed IP with WiFi.config(), reserve it in your router with a DHCP reservation, and stop hunting the network for a device that moved.
Every packet your ESP32 sends over WiFi goes through a TCP socket. Three-way handshake, WiFiClient, WiFiServer, the stuck connection gotcha, TCP_NODELAY.
Replace IP addresses with friendly names like 'kitchen-sensor.local'. mDNS is built into the ESP32 and most operating systems.