Micro Python on ESP32 to send telemetry to Azure IoT Hub with MQTT

This post has been republished via RSS; it originally appeared at: New blog articles in Microsoft Tech Community.

We, recently, published a sample of code using MQTT with Micro Python on ESP32. ESP Board can run micro Python, use the esp tool to flash a MicroPython binary on your board, play with interactive Python from the board connected via COM port.

In this sample, we use picocom to monitor and trace execution on the board from the WSL (Windows Subsystem Linux). We also use rshell to allow copying files from your system to the board. Once micro python is installed on your board, it executes at boot time, boot.py and then main.py automatically. Use boot.py to initiate the Wi-Fi connection. In the main.py we use a MQTT client library to send telemetry message to Azure IoT Hub (and receiving message from the cloud)

Enjoy this sample, and open issue or propose PR if you hit problem with this sample or want to enrich it.

Happy coding

Eric

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.