void loop() { // put your main code here, to run repeatedly: while (client.available()) { // 读取服务器端数据 char c = client.read(); Serial.print(c); } Serial.flush(); // 从串口读取数据并发送到服务端 while (Serial.available() > 0) { char inChar = Serial.read(); if (client.connected()) { client.print(inChar); } }
// 检查服务器是否断开连接 if (!client.connected()) { Serial.println(); Serial.println("disconnecting."); client.stop(); // do nothing: while (true) { delay(1000); } } delay(10); }
void printWifiStatus(){ Serial.print(F("You're connected to the network, IP = ")); // WiFi IP地址 Serial.println(WiFi.localIP());
void loop() { // put your main code here, to run repeatedly: while (client.available()) { // 读取服务器端数据 char c = client.read(); Serial.print(c); } Serial.flush(); // 从串口读取数据并发送到服务端 while (Serial.available() > 0) { char inChar = Serial.read(); if (client.connected()) { client.print(inChar); } }
// 检查服务器是否断开连接 if (!client.connected()) { Serial.println(); Serial.println("disconnecting."); client.stop(); // do nothing: while (true) { delay(1000); } } delay(10); }
6)ESP模块信息输出实现
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
void printWifiStatus(){ Serial.print(F("You're connected to the network, IP = ")); // WiFi IP地址 Serial.println(WiFi.localIP());