Introduction: So Easy MicroPython - My WiFi Connection

*** Just add 2~3 lines, then your MCU will be an IoT enabled device ***

This is a very useful WiFi library to let your MCU connects to network in easy and fast way.

Step 1: Upload MyWifi to MCU

Upload the library MyWifi to your MCU first ! [Download MyWifi HERE]

If you have no idea how to do it, read my another article "So Easy - ESP8266/ESP32 File Management" first.

Step 2: Example 1: Nearby WiFi AP Scanner

from MyWifi import myWifi

my = myWifi()

print(my.scan())

Step 3: Example 2: MCU Connect to Your AP

from MyWifi import myWifi

my = myWifi('YOUR_WIFI_SSID', 'YOUR_WIFI_PWD')

my.connect()

Step 4: Example 3: Client Connect to MCU AP

from MyWifi import myWifiAP

my = myWifiAP('ESPxx_AP', '*123456789*') # ('Your Wifi SSID', 'Your Wifi Password')

my.start() # start as an AP

-----

*** The IP of MCU AP is default to 192.168.4.1 ***

Step 5: Test Your MCU AP Connection

As you can see, my mobile has connected to ESPxx_AP (MCU's AP SSID), and also the information of MCU AP connection displayed.

Step 6: That's So Easy, Hope to Help a Little Bit !

Posted by Yungger

If it help you, and want to give some encouragement, just go HERE 😘 😘 !!