Open
Changes from all commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Failed to load files.
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,6 +18,9 @@
<head> <title>Pico W</title> </head>
<body> <h1>Pico W</h1>
<p>%s</p>
<a href="/light/off">Turn off</a>
<br>
<a href="/light/on">Turn on</a>
</body>
</html>
"""
Expand All@@ -40,10 +43,12 @@
addr = socket.getaddrinfo('0.0.0.0', 80)[0][-1]

s = socket.socket()
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind(addr)
s.listen(1)

print('listening on', addr)
stateis = "LED is ?"

# Listen for connections
while True:
Expand DownExpand Up@@ -77,4 +82,4 @@

except OSError as e:
cl.close()
print('connection closed')
print('connection closed')