Created
September 23, 2018 14:24
-
-
Save amanjeetsingh150/3f08e93430a324f68810a10cb228d814 to your computer and use it in GitHub Desktop.
This file contains 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
mqttc=mqtt.Client("DriverClient",clean_session=False) | |
#YOUR MQTT SERVER USERNAME PASSWORD HERE | |
mqttc.username_pw_set("username","password") | |
#YOUR MQTT SERVER URI AND PORT HERE | |
mqttc.connect("SERVER URI","PORT",60) | |
#Publishing the location update in interval of 1 second. | |
for latLng in latLngList: | |
s=str(latLng) | |
b = bytearray() | |
b.extend(s) | |
print latLng | |
mqttc.publish("location/track", b, qos=0) | |
time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment