Micro Python on ESP32 to send telemetry to Azure IoT Hub with MQTT
Published Mar 18 2020 11:29 AM 7,439 Views
Microsoft

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

4 Comments
Copper Contributor

can you please share the sample code ?

 

thank you

Microsoft

Hi agrebianis,

The code is available in the github repo mentioned in the first line: MQTT with Micro Python on ESP32.

Have a look at the main.py IoTMQTTSample/main.py at master · Azure-Samples/IoTMQTTSample (github.com)

MVP

MicroPython code can not access any more.

Microsoft

Hi Hao,

 

The MicroPython sample was deprecated on the main branch, however you can still access this in the Git history for reference.

 

Thanks

Ryan

 

 

Version history
Last update:
‎Mar 18 2020 11:29 AM
Updated by: