Created
December 29, 2022 10:21
-
-
Save badri/9e4af14f46ec45275c533f7542ffb9af to your computer and use it in GitHub Desktop.
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 paho.mqtt.client as mqtt | |
from random import randrange, uniform | |
import time | |
mqttBroker ="vernemq.itransz.in" | |
client = mqtt.Client("Temperature_Inside") | |
client.connect(mqttBroker, 443) | |
while True: | |
randNumber = uniform(20.0, 21.0) | |
client.publish("H1", randNumber) | |
print("Just published " + str(randNumber) + " to topic H1") | |
time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment