We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adafruit CircuitPython 8.2.0-rc.0 on 2023-06-23; Raspberry Pi Pico W with rp2040
from wifi import radio from socketpool import SocketPool from builtins import bytearray from time import sleep from secrets import secrets radio.connect(secrets['SSID'], secrets['PASSWD']) while not radio.connected: print("Connecting...") sleep(1) print(f"Connected at address: {radio.ipv4_address}") socket = SocketPool(radio) def send_file(conn, filename, content_type): with open(filename, "r") as f: f_content = f.read() conn.sendall(b"HTTP/1.1 200\nContent-Type: ") conn.sendall(content_type.encode("utf-8")) conn.sendall(b"\n\n") conn.sendall(f_content) with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.bind(("0.0.0.0", 6969)) s.listen(100) print("Listening...") paths = { "/": ("index.html", "text/html"), "/index.html": ("index.html", "text/html"), "/index.js": ("index.js", "application/javascript"), } while True: assert radio.connected conn, addr = s.accept() with conn: print(f"Connected by {addr}") data = bytearray([0x00]*1024) print(conn.recv_into(data)) path = data.decode("utf-8").split()[1] print(path) if path in paths: send_file(conn, *paths[path])
code.py output: Connected at address: xxx.xxx.xxx.xxx Listening...
The code hangs here as if no request are made even when they are.
The error doesn't happen on every single soft reboot, only randomly.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
CircuitPython version
Code/REPL
Behavior
The code hangs here as if no request are made even when they are.
Description
Additional information
The error doesn't happen on every single soft reboot, only randomly.
The text was updated successfully, but these errors were encountered: