Automatically Connect ESP-32 TCP Client to Server Running On Computer

ScumDrumCity
Posts: 2
Joined: Thu Dec 12, 2019 6:03 pm

Automatically Connect ESP-32 TCP Client to Server Running On Computer

Postby ScumDrumCity » Thu Dec 12, 2019 6:11 pm

Hey everybody,

I have several sparkfun ESP-32 "Thing"'s that connect and send data to a python server running on my PC. However, the IP address of my laptop changes, so I have to flash new firmware to my ESP-32's every time to specify the new IP address of my PC. I was wondering if there was a good way to get around this? Would it be possible to start my ESP-32's with a fixed IP TCP server that retrieves the IP address of my PC. The ESP then disconnects and restarts as a TCP client that connects to the IP address it just recieved? I could run a simple TCP client in another thread in my server software that just serves the PC's IP address to anything that connects to it. Is this a good idea?

ESP_Sprite
Posts: 9730
Joined: Thu Nov 26, 2015 4:08 am

Re: Automatically Connect ESP-32 TCP Client to Server Running On Computer

Postby ESP_Sprite » Fri Dec 13, 2019 1:32 am

mDNS is more or less made to solve this problem.

Who is online

Users browsing this forum: Basalt and 84 guests