Open
Description
Device: Raspberry Pi Pico W
mDNS seems to not work when combining the two basic examples from the project: Manual AP & mDNS.
I can reach the page when going directly to my ip address on port 5000, however when trying to reach it on abcd.local:8080 it doesn't do anything.
import wifi
import socketpool
from adafruit_httpserver import Server, Request, Response, FileResponse
import mdns
# Set up access point
print("Creating access point...")
wifi.radio.start_ap(ssid="MyNetwork", password="SomePassword!")
print(f"Created access point {SSID}")
#Set up mDNS
mdns_server = mdns.Server(wifi.radio)
mdns_server.hostname = "abcd"
print("MDNS Hostname: " + mdns_server.hostname)
mdns_server.advertise_service(service_type="_http", protocol="_tcp", port=8080)
# Set up web server
pool = socketpool.SocketPool(wifi.radio)
server = Server(pool, "/static", debug=True)
@server.route("/", methods=['GET'])
def index(request):
""" Render the Index page"""
if request.method == 'GET':
return FileResponse(request, "index.html", "/static")
server.serve_forever(str(wifi.radio.ipv4_address_ap))
settings.toml file is deleted.
Did I do something wrong, or is it some bug?
Thanks