ESP32-S3 wifi支持众所周知的,加上Mu,使开发更快捷。
只要几句话就可连上wifi:
import os
import wifi
import board
# Get WiFi details secrets.py file
try:
from secrets import secrets
except ImportError:
print("WiFi secrets are kept in secrets.py, please add them there!")
raise
# Connect to WiFi
print("Connecting to %s"%secrets["ssid"])
wifi.radio.connect(secrets["ssid"], secrets["password"])
print("Connected to %s!"%secrets["ssid"])
print("My IP address is", wifi.radio.ipv4_address)
while True:
pass
开发板连上的显示:
连接WIFI的视频:
把开发板当成Ap热点更简单,这里要注意,这里的名字和密码可以随便改的,并不是你家里的WIFI名字和密码
import os
import wifi
import secrets
#import adafruit_requests
print("ESP32-S3 Access Point Test")
print(f"My MAC address: {[hex(i) for i in wifi.radio.mac_address]}")
wifi.radio.start_ap("DD", "12345678")
while True:
pass
从手机可以找到DD