1. 整体思路
2. 代码
# 整体流程
# 1. 链接wifi
# 2. 启动网络功能(UDP)
# 3. 接收网络数据
# 4. 处理接收的数据
import socket
import time
import network
import machine
def do_connect():
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
if not wlan.isconnected():
print('connecting to network...')
wlan.connect('dongfeiqiu', 'wangmingdong1225')
i = 1
while not wlan.isconnected():
print("正在链接...{}