配置WebREPL
实现远程调试与上传程序
Last updated
Was this helpful?
Was this helpful?
import network
import time
import webrepl
def do_connect():
# WiFi SSID and Password
wifi_ssid = "YOUR SSID" # YOUR WiFi SSID
wifi_password = "YOUR PASSWORD" # YOUR WiFi PASSWORD
# Wireless config : Station mode
station = network.WLAN(network.STA_IF)
station.active(True)
# Continually try to connect to WiFi access point
while not station.isconnected():
# Try to connect to WiFi access point
print("Connecting...")
station.connect(wifi_ssid, wifi_password)
time.sleep(10)
# Display connection details
print("Connected!")
print("My IP Address:", station.ifconfig()[0])
if __name__ == "__main__":
do_connect()
webrepl.start()Connected!
My IP Address: 192.168.xxx.xxx
WebREPL daemon started on ws://192.168.xxx.xxx:8266
Started webrepl in normal mode