Esp32 As A Tcp Client In Uart-Wi-Fi Passthrough (Single Connection Mode) - Espressif Systems ESP32 Instruction Set

At instruction set and examples
Hide thumbs Also See for ESP32:
Table of Contents

Advertisement

!
9.3.1.

ESP32 as a TCP Client in UART-Wi-Fi Passthrough (Single Connection Mode)

Here is an example of the ESP32 Station working as a TCP client in single connection
mode of transparent transmission.
1. Set the Wi-Fi mode:
AT+CWMODE=3 // SoftAP+Station mode
Response:
OK
2. Connect to the router:
AT+CWJAP="SSID","password" // SSID and password of router
Response:
OK
3. Query the device's IP:
AT+CIFSR
Response:
192.168.101.105 // device's IP that got from router
4. Connect the PC to the same router to which ESP32 is connected. Use a network tool
on the PC to create a TCP server.
- For example, the PC's IP address is 192.168.101.110 and the port is 8080.
5. Connect the device to the TCP server as a TCP client:
AT+CIPSTART="TCP","192.168.101.110",8080 // protocol, server IP & port
Response:
OK
6. Enable the transparent transmission mode:
AT+CIPMODE=1
Response:
OK
7. Send data:
AT+CIPSEND
Response:
> // From now on, data received from UART will be transparent transmitted
to server
8. Stop sending data:
Espressif
71 97
!
/!
9. AT Commands Examples
2019.06

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32 and is the answer not in the manual?

Questions and answers

Table of Contents