So Easy MicroPython — WiFi Connection, MCU as IoT

Step 1: Upload library to your MCU

  • MyWifi: A basic library for WiFi connection

Step 2: My some demos

Example 1 — Nearby WiFi AP Scanner

from MyWifi import myWifi
my = myWifi()
print(my.scan())

Example 2: Let your MCU connect to a WiFi AP

from MyWifi import myWifi
my = myWifi(YOUR_WIFI_SSID, YOUR_WIFI_PWD)
my.connect()

Example 3: Make your MCU play as a WiFi AP

from MyWifi import myWifiAP

my = myWifiAP('ESPxx_AP', '*123456789*')
my.start()
your can change the SSID and Password of your AP to another you want

Example 4: Try and connect to your MCU AP

That’s all, so easy right ? Hope this helps !

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store