Home > other >  5 g band MicroPython microcontroller WiFi connection
5 g band MicroPython microcontroller WiFi connection

Time:12-29

MicroPython has official transplant to realtek RTL8722 dual-band WiFi + 5.0 BLE microcontroller, more wonderful function will soon add up, let us first to see what use MicroPython can to control the WiFi do,

According to the official document information (https://www.amebaiot.com/cn/amebad-micropython-wifi/, RTL8722 support 2.4 G and 5 G wifi agreement, we can through the following a few simple Python code to easily scan lines near the wifi signal,

The from wireless import WLAN
Wifi=WLAN (mode=WLAN. The STA)
Wifi. Scan ()

Scan the result of real-time display,



We can according to the need to connect to any of the WiFi Access Point, the code is as follows,

The from wireless import WLAN
Wifi=WLAN (mode=WLAN. The STA)
Wifi. Connect (ssid="YourWiFiName", PSWD="YourWiFiPassword")

As you can see, in addition to the import library function and two lines of code to create objects that really need to perform only one line of code, very simple, and the measured under RTL8722 can easily connect WiFi AP 5 G band, directly to avoid the crowded 2.4 G band, very convenient,
  • Related