Skip to content

Instantly share code, notes, and snippets.

@tolgahancepel
Last active May 21, 2022 19:49
Show Gist options
  • Save tolgahancepel/57a2a281ce0c898201022cdc0c0962c8 to your computer and use it in GitHub Desktop.
Save tolgahancepel/57a2a281ce0c898201022cdc0c0962c8 to your computer and use it in GitHub Desktop.
Monitoring IoT Sensor Data with Plotly Dash
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