Last active
May 21, 2022 19:49
-
-
Save tolgahancepel/57a2a281ce0c898201022cdc0c0962c8 to your computer and use it in GitHub Desktop.
Monitoring IoT Sensor Data with Plotly Dash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import paho.mqtt.client as mqtt | |
mqttc = mqtt.Client() | |
mqttc.connect("mqtt.eclipseprojects.io", 1883, 60) | |
if __name__ == "__main__": | |
print("Publishing...") | |
while True: | |
temperature = 24 | |
mqttc.publish("myroom/temperature", temperature) | |
time.sleep(2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment