Programming with MicroPython: WiFi & IoT
Import FutureBoard Library
from future import *07: WiFi & IoT
1. Connect to WiFi
wifi.connect('router','password')2. Get the Connection Status
wifi.sta.isconnected()3. Get the Connection Configuration
wifi.sta.ifconfig()4. Get the MAC Address
import machine
import ubinascii
x = ubinascii.hexlify(machine.unique_id()).decode().upper()5. File Download
Sample Program 1~4
Import MQTT Library
5. Set up an MQTT object
6. Connect to the MQTT Server
7. Disconnect the MQTT Server
8. Subscribe to a MQTT Topic
9. Publish a Message to a MQTT Topic
10. Read the Message from the MQTT Topic
11. Read the Last Message of the MQTT Topic
12. Wait until a MQTT Message is Published
13. Define MQTT Event Trigger Function
Sample Program 1
Sample Program 2
urequests and ujson Libraries
Import urequests and ujson Libraries
PreviousProgramming with MicroPython: NeoPixelNextProgramming with MicroPython: Network Time Protocol
Last updated