1 parent 29c8c8a commit c888831Copy full SHA for c888831
1 file changed
esp8266/scripts/webrepl.py
@@ -1,6 +1,7 @@
1
# This module should be imported from REPL, not run from command line.
2
import socket
3
import uos
4
+import network
5
import websocket
6
import websocket_helper
7
@@ -13,13 +14,15 @@ def setup_conn(port):
13
14
listen_s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
15
16
ai = socket.getaddrinfo("0.0.0.0", port)
- print("Bind address info:", ai)
17
addr = ai[0][4]
18
19
listen_s.bind(addr)
20
listen_s.listen(1)
21
listen_s.setsockopt(socket.SOL_SOCKET, 20, accept_conn)
22
- print("WebREPL daemon started on port %d" % port)
+ for i in (network.AP_IF, network.STA_IF):
23
+ iface = network.WLAN(i)
24
+ if iface.active():
25
+ print("WebREPL daemon started on %s:%d" % (iface.ifconfig()[0], port))
26
27
28
def accept_conn(listen_sock):
0 commit comments