Closed
Description
CircuitPython version
dafruit CircuitPython 9.0.0 on 2024-03-19; Raspberry Pi Pico W with rp2040
Code/REPL
import socketpool
import wifi
from adafruit_httpserver import Server, Request, Response
ssid = "Unintended Consequences"
password = "xxxx"
print("Connecting to", ssid)
wifi.radio.connect(ssid, password)
print("Connected to", ssid)
pool = socketpool.SocketPool(wifi.radio)
server = Server(pool, "/static", debug=True)
@server.route("/")
def base(request: Request):
"""
Serve a default static plain text message.
"""
return Response(request, "Hello from the CircuitPython HTTP Server!")
server.serve_forever(str(wifi.radio.ipv4_address))
Behavior
code.py output:
Connecting to Unintended Consequences
Connected to Unintended Consequences
Traceback (most recent call last):
File "code.py", line 25, in
File "adafruit_httpserver/server.py", line 185, in serve_forever
File "adafruit_httpserver/server.py", line 228, in start
File "adafruit_httpserver/server.py", line 207, in _create_server_socket
OSError: [Errno 95] EOPNOTSUPP
Description
Test code taken from first example here: https://docs.circuitpython.org/projects/httpserver/en/latest/examples.html
Additional information
No response