Connecting a microcontroller to WiFi is never so easy with Python -- Ameba MicroPython

MENG XI

Mar 18, 2020
52
Joined
Mar 18, 2020
Messages
52
For an IoT development board, the tricky part is connecting to other wireless devices, for example wifi router or bluetooth sensor, now with MicroPython, you can connect to any wifi device with only few line of code typed in real time, no compilation is needed! Check out how ameba RTL8722DM does that as follows,

Materials

  • Ameba x 1

Steps

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 using code below, copy and paste the following code line by line into REPL to see their effects.



 




from wireless import WLAN



wifi = WLAN(mode = WLAN.STA)



wifi.connect(ssid = "YourWiFiName", pswd = "YourWiFiPassword")



 
Last edited by a moderator:
Top