File tree 1 file changed +9
-9
lines changed
1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 2
2
#include < AsyncTCP.h>
3
3
#include < WiFi.h>
4
4
5
- // #define HOST "homeassistant.local"
6
- // #define PORT 8123
7
-
8
- // #define HOST "www.google.com"
9
- // #define PORT 80
10
-
5
+ // Run a server at the root of the project with:
6
+ // > python3 -m http.server 3333
7
+ // Now you can open a browser and test it works by visiting http://192.168.125.122:3333/ or http://192.168.125.122:3333/README.md
11
8
#define HOST " 192.168.125.122"
12
- #define PORT 4000
9
+ #define PORT 3333
10
+
11
+ // WiFi SSID to connect to
12
+ #define WIFI_SSID " IoT"
13
13
14
14
// 16 slots on esp32 (CONFIG_LWIP_MAX_ACTIVE_TCP)
15
15
#define MAX_CLIENTS CONFIG_LWIP_MAX_ACTIVE_TCP
@@ -48,7 +48,7 @@ void makeRequest() {
48
48
// Serial.printf("** data received by client: %" PRIu16 ": len=%u\n", client->localPort(), len);
49
49
});
50
50
51
- client->write (" GET / HTTP/1.1\r\n Host: " HOST " \r\n User-Agent: ESP\r\n Connection: close\r\n\r\n " );
51
+ client->write (" GET /README.md HTTP/1.1\r\n Host: " HOST " \r\n User-Agent: ESP\r\n Connection: close\r\n\r\n " );
52
52
});
53
53
54
54
if (client->connect (HOST, PORT)) {
@@ -63,7 +63,7 @@ void setup() {
63
63
continue ;
64
64
65
65
WiFi.mode (WIFI_STA);
66
- WiFi.begin (" IoT " );
66
+ WiFi.begin (WIFI_SSID );
67
67
while (WiFi.status () != WL_CONNECTED) {
68
68
delay (500 );
69
69
Serial.print (" ." );
You can’t perform that action at this time.
0 commit comments