Automatically Connect ESP-32 TCP Client to Server Running On Computer
Posted: 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?
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?