Skip to content

Commit 25a3e50

Browse files
authored
host and socket that yields a response
I'm open to any other suggestions. The following is received back: `b'HTTP/1.1 403 Forbidden\r\nServer: nginx/1.10.3 (Ubuntu)\r\nDate: Mon, 15 Mar 2021 22:52:10 GMT\r\nContent-Type: text/html\r\nContent-Length: 178\r\nConnection: close\r\n\r\n'`
1 parent 643b462 commit 25a3e50

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

examples/esp32spi_tcp_client.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010

1111

1212
TIMEOUT = 5
13-
# adjust host and port to match server
14-
HOST = "192.168.10.179"
15-
PORT = 5000
13+
# edit host and port to match server
14+
HOST = "wifitest.adafruit.com"
15+
PORT = 80
1616

17-
# PyPortal or similar; adjust pins as needed
17+
# PyPortal or similar; edit pins as needed
1818
spi = board.SPI()
1919
esp32_cs = DigitalInOut(board.ESP_CS)
2020
esp32_ready = DigitalInOut(board.ESP_BUSY)
@@ -37,7 +37,7 @@
3737
s.connect(socketaddr)
3838

3939
print("Sending")
40-
s.send(b"Hello, world")
40+
s.send(b"HEAD / HTTP/1.0\r\n\r\n")
4141

4242
print("Receiving")
43-
print(s.recv(128))
43+
print(s.recv(1024))

0 commit comments

Comments
 (0)