I'm using an ESP8266 board, and have a small program which creates an AP and waits for a Wifi connection,
then opens a TCP/IP port and waits for a 'telnet' type connection on port 23:
Code: Select all
while station.isconnected() == False:
pass
print('Wifi Connection successful')
print(station.ifconfig())
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print('Bind')
s.bind(('', 23))
print('Bound')
print('Listen')
s.listen(5)
print('Listening')
print('Accept')
conn, addr = s.accept()
print('Accepted')
conn.setblocking(False)
print('Got a TCP/IP connection from %s' % str(addr))
Code: Select all
conn, addr = s.accept()
How do I detect that condition? I tried it, and disconnection the WiFi at that point does nothing. It just stays at that point.
Thanks, Dave