# Retry client loop if connection drops
def maintain_connection():
# client connection
client.username_pw_set(device_id, device_secret) # MQTT server credentials
client.connect('178.62.108.47') # MQTT server address
client.subscribe(in_topic, 0) # MQTT subscribtion (with QoS level 0)
# Continue the network loop, exit when an error occurs
rc = 0
while rc == 0:
rc = client.loop()
print('rc: ' + str(rc))
time.sleep(2)
maintain_connection()
--
You received this message because you are subscribed to the Google Groups "Lelylan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lelylan+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.