Cette page fournit une interface de navigation pour trouver toutes les valeurs d’une propriété et une page donnée. D’autres interfaces de recherche disponibles incluent la recherche de propriété, et le constructeur de requête ask.
/*
WebSerial Demo
------
This example code works for both ESP8266 & ESP32 Microcontrollers
WebSerial is accessible at your ESP's /webserial URL.
Author: Ayush Sharma
Checkout WebSerial Pro: https://webserial.pro
*/
#include
#if defined(ESP8266)
#include
#include
#elif defined(ESP32)
#include
#include
#endif
#include
#include
#define Relay 2
AsyncWebServer server(80);
const char* ssid = "ELDRADO"; // Your WiFi SSID
const char* password = "amazon123"; // Your WiFi Password
/* Message callback of WebSerial */
void recvMsg(uint8_t *data, size_t len){
WebSerial.println("Received Data...");
String d = "";
for(int i=0; i < len; i++){
d += char(data[i]);
}
WebSerial.println(d);
if (d == "ON"){
digitalWrite(Relay, HIGH);
}
if (d=="OFF"){
digitalWrite(Relay, LOW);
}
}
void setup() {
Serial.begin(115200);
pinMode(Relay, OUTPUT);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
if (WiFi.waitForConnectResult() != WL_CONNECTED) {
Serial.printf("WiFi Failed!\n");
return;
}
Serial.print("IP Address: ");
Serial.println(WiFi.localIP());
// WebSerial is accessible at "/webserial" in browser
WebSerial.begin(&server);
/* Attach Message Callback */
WebSerial.msgCallback(recvMsg);
server.begin();
}
void loop() {
} Node: Change the Wi-Fi credentials.In my case here is the response.
'''File > Preferences > Additional Boards Manager URLs''' and adding the ESP32 board manager URL. This will allow the Arduino IDE to recognize the ESP32 board and provide the appropriate options for programming it.
* '''Select the ESP32 Board''': Go to '''Tools > Board > ESP32 Arduino''' and select your ESP32 board. This tells the Arduino IDE that you will be programming an ESP32 board.board. This tells the Arduino IDE that you will be programming an ESP32 board. +Vous avez entré un nom de page invalide, avec un ou plusieurs caractères suivants :
< > @ ~ : * € £ ` + = / \ | [ ] { } ; ? #