为什么通过thonny软件输入代码后,所填写的Wi-Fi密码名称是正确的,却不能显示地址

import network

为开发板创建网络,模式为STA模式

wlan = network.WLAN(network.STA_IF) # create station interface

激活STA

wlan.active(True) # activate the interface

ESP32开发板扫描网络

wlan.scan() # scan for access points

判断是否连接。没连接上返回false

wlan.isconnected() # check if the station is connected to an AP

连接网络,ssid指WIFI名字,key指密码

wlan.connect('ssid', 'key') # connect to an AP

连接后,获取ESP32开发板的MAC地址

wlan.config('mac') # get the interface's MAC address

获取开发板的IP地址,子网掩码,网关,DNS

wlan.ifconfig() # get the interface's IP/netmask/gw/DNS addresses