WiFi - Connect to WiFi networks

Materials

  • AmebaD [ AMB23 / AMB21 / AMB22 / BW16 / BW16-TypeC ] x 1

Example

Ameba can connect to WiFi access point with open security or WPA2 security type, which is the most common security type used in household wireless routers. Here we are going to connect to a WiFi access point.

Code

Copy and paste the following code line by line into REPL to see their effects.

WiFi connection with WPA Encryption

from wireless import WLAN
wifi = WLAN(mode = WLAN.STA)
wifi.connect(ssid = "YourWiFiName", pswd = "YourWiFiPassword")

WiFi connection with Open Security

from wireless import WLAN
wifi = WLAN(mode = WLAN.STA)
wifi.connect(ssid = "YourWiFiName", security = WLAN.OPEN)
Please confirm that QQ communication software is installed