Xiao ESP32C3 (in arduino-esp32 framework) act as socket client, connect to HC-25 WiFi Module.
Last post show my first test HC-25 WiFi Module, with AT Command; act as AP, setup socket server . Here is my exercise using Xiao ESP32C3 (in arduino-esp32 framework) to implement the client side: act as STA, join HC-25 WiFi network, connect to HC-25 socket server, receive and echo back in upper case. Exercise code: XiaoESP32C3_TCPclient.ino /* A simple TCP client run on ESP32-C3, * connect socket server run on HC-25 as AP. * * Have to set WAP in HC-25 using AT command: * AT+WMODE=AP * AT+WAP=myHC-25,password * * 192.168.4.1:8080 is the socket server on HC-25 */ #include <WiFi.h> // AP of HC-25 const char *ssid = "myHC-25"; const char *password = "password"; // server IP and port const IPAddress serverIP(192,168,4,1); uint16_t serverPort = 8080; WiFiClient client; void setup() { delay(200); Serial.begin(115200); delay(200); Serial.println("\n\r- Socket Client run on Xiao ESP32C3 (arduino-esp32) -"); Serial.printl...