Using MicroPython on a NodeMCU as a MQTT publisher
Scenario
We will be setting up
- The Mosquitto MQTT Broker running inside a Docker conatiner on a laptop.
- MicroPython on a NodeMCU to send data to the Mosquitto MQTT Broker
Local MQTT Broker Docker container for testing
Pull the MQTT Docker container
Start local MQTT Broker Docker container for testing
Enter the container and subscribe to the topic
From Normal Python
Use pip to instal paho-mqtt
Use the Paho MQTT Client to publish to the MQTT test server.
From MicroPython