Skip to content

Commit a7c2468

Browse files
committed
update example
1 parent 2691249 commit a7c2468

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

examples/Client/Client.ino

+9-9
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
#include <AsyncTCP.h>
33
#include <WiFi.h>
44

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
118
#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"
1313

1414
// 16 slots on esp32 (CONFIG_LWIP_MAX_ACTIVE_TCP)
1515
#define MAX_CLIENTS CONFIG_LWIP_MAX_ACTIVE_TCP
@@ -48,7 +48,7 @@ void makeRequest() {
4848
// Serial.printf("** data received by client: %" PRIu16 ": len=%u\n", client->localPort(), len);
4949
});
5050

51-
client->write("GET / HTTP/1.1\r\nHost: " HOST "\r\nUser-Agent: ESP\r\nConnection: close\r\n\r\n");
51+
client->write("GET /README.md HTTP/1.1\r\nHost: " HOST "\r\nUser-Agent: ESP\r\nConnection: close\r\n\r\n");
5252
});
5353

5454
if (client->connect(HOST, PORT)) {
@@ -63,7 +63,7 @@ void setup() {
6363
continue;
6464

6565
WiFi.mode(WIFI_STA);
66-
WiFi.begin("IoT");
66+
WiFi.begin(WIFI_SSID);
6767
while (WiFi.status() != WL_CONNECTED) {
6868
delay(500);
6969
Serial.print(".");

0 commit comments

Comments
 (0)