Instantly share code, notes, and snippets.

Embed
What would you like to do?
def systemInit():
global port, loraM, client
obtain_port()
gpio_init()
emergencyVehicleState.setdefault("state",0)
#loraM handles all the loraEvents
loraM = MCLoRa(port)
success = loraM.testOK()
if success:
print "Traffic Controller Gateway Init Success"
print (success)
else:
print("Traffic Controller Gateway Init FAILURE")
loraM.pause()
#Twilio Client
client = mqtt.Client(client_id="rpi", clean_session=False)
client.tls_set(None, pem_location, key_location)
client.on_message = handleEmergencyMessage
#
# Use qos=1 to get your device caught up right away.
#
client.connect('mqtt-sync.us1.twilio.com', 8883, 60)
client.subscribe('sync/docs/gpsData', qos=1)
client.loop_start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment