In the previous tutorial, we have seen how to setup the ESP-01 module as an access point and running a TCP server on it. In this tutorial, I will explain how to setup the ESP module as a station (WiFi device) and connects to an existing access point. The ESP module is configured as a TCP client, so it can connect to any TCP server. This is the block diagram that explain the system in this tutorial.
In this system, I will setup a PC as a WiFi soft access point (using Connectify software). The PC also runs a TCP server on port 23 using Hercules TCP terminal. The ESP module which acts as a WiFi station can connect to the PC access point. The ESP module which also acts as a TCP client can make a connection to the TCP server on the PC. After the connection is created, we can exchange data with the server. Serial to USB converter and serial terminal (Hercules) is used for controlling the ESP module.