Skip to content

cobanov/python-mqtt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python MQTT RPi

MQTT Service for Raspberry Pi using Python

  flowchart LR;
      RPi --> MQTT_Broker;
      MQTT_Broker <--> Consumer1;
      MQTT_Broker <--> Consumer2;

Loading

Installation

Use the package manager pip to install foobar.

pip install paho-mqtt
pip install adafruit-circuitpython-dht
sudo apt-get install libgpiod2

Usage

# pub
dhtDevice = adafruit_dht.DHT11(board.D17)
mqttBroker = "test.mosquitto.org"

# sub
client.connect("test.mosquitto.org", 1883, 60)
client.loop_forever()

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT