Update de grbl avec un plus grand buffer et un peu de doc en plus
This commit is contained in:
52
Grbl_Esp32-master/libraries/ESP32SSDP/examples/SSDP/SSDP.ino
Normal file
52
Grbl_Esp32-master/libraries/ESP32SSDP/examples/SSDP/SSDP.ino
Normal file
@ -0,0 +1,52 @@
|
||||
#include <WiFi.h>
|
||||
#include <WebServer.h>
|
||||
#include <ESP32SSDP.h>
|
||||
|
||||
const char* ssid = "********";
|
||||
const char* password = "********";
|
||||
|
||||
WebServer HTTP(80);
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
Serial.println();
|
||||
Serial.println("Starting WiFi...");
|
||||
|
||||
WiFi.mode(WIFI_STA);
|
||||
WiFi.begin(ssid, password);
|
||||
if(WiFi.waitForConnectResult() == WL_CONNECTED){
|
||||
|
||||
Serial.printf("Starting HTTP...\n");
|
||||
HTTP.on("/index.html", HTTP_GET, [](){
|
||||
HTTP.send(200, "text/plain", "Hello World!");
|
||||
});
|
||||
HTTP.on("/description.xml", HTTP_GET, [](){
|
||||
SSDP.schema(HTTP.client());
|
||||
});
|
||||
HTTP.begin();
|
||||
|
||||
Serial.printf("Starting SSDP...\n");
|
||||
SSDP.setSchemaURL("description.xml");
|
||||
SSDP.setHTTPPort(80);
|
||||
SSDP.setName("Philips hue clone");
|
||||
SSDP.setSerialNumber("001788102201");
|
||||
SSDP.setURL("index.html");
|
||||
SSDP.setModelName("Philips hue bridge 2012");
|
||||
SSDP.setModelNumber("929000226503");
|
||||
SSDP.setModelURL("http://www.meethue.com");
|
||||
SSDP.setManufacturer("Royal Philips Electronics");
|
||||
SSDP.setManufacturerURL("http://www.philips.com");
|
||||
SSDP.setDeviceType("upnp:rootdevice"); //to appear as root device
|
||||
SSDP.begin();
|
||||
|
||||
Serial.printf("Ready!\n");
|
||||
} else {
|
||||
Serial.printf("WiFi Failed\n");
|
||||
while(1) delay(100);
|
||||
}
|
||||
}
|
||||
|
||||
void loop() {
|
||||
HTTP.handleClient();
|
||||
delay(1);
|
||||
}
|
Reference in New Issue
Block a user