However, I'm also trying to set up a captive portal so that any dns request within the WiPy's broadcasted network is redirected to the configuration page.
When I go to bind the socket to port 53, the execution just hangs forever. I simplified the code down to:
Code: Select all
import socket
import network
ap = network.WLAN()
ap.init(network.WLAN.AP, ssid='dns test')
def start():
udps = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
udps.setblocking(False)
udps.settimeout(10)#seconds
print('just before bind')
udps.bind(('',53))
print('just after bind')
Code: Select all
>>> start()
just before bind
The bind call on port 80 for my http setup works just fine and returns quickly.
Any idea what I'm doing wrong here?