You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To upload through terminal you can use: curl -F "[email protected]" esp32-webupdate.local/update
3
+
*/
4
+
5
+
#include<WiFi.h>
6
+
#include<WiFiClient.h>
7
+
#include<WebServer.h>
8
+
#include<ESPmDNS.h>
9
+
#include<HTTPUpdateServer.h>
10
+
11
+
#ifndef STASSID
12
+
#defineSTASSID"your-ssid"
13
+
#defineSTAPSK"your-password"
14
+
#endif
15
+
16
+
constchar* host = "esp32-webupdate";
17
+
constchar* ssid = STASSID;
18
+
constchar* password = STAPSK;
19
+
20
+
WebServer httpServer(80);
21
+
HTTPUpdateServer httpUpdater;
22
+
23
+
voidsetup(void) {
24
+
25
+
Serial.begin(115200);
26
+
Serial.println();
27
+
Serial.println("Booting Sketch...");
28
+
WiFi.mode(WIFI_AP_STA);
29
+
WiFi.begin(ssid, password);
30
+
31
+
while (WiFi.waitForConnectResult() != WL_CONNECTED) {
32
+
WiFi.begin(ssid, password);
33
+
Serial.println("WiFi failed, retrying.");
34
+
}
35
+
36
+
MDNS.begin(host);
37
+
if (MDNS.begin("esp32")) {
38
+
Serial.println("mDNS responder started");
39
+
}
40
+
41
+
42
+
httpUpdater.setup(&httpServer);
43
+
httpServer.begin();
44
+
45
+
MDNS.addService("http", "tcp", 80);
46
+
Serial.printf("HTTPUpdateServer ready! Open http://%s.local/update in your browser\n", host);
0 commit comments