def on_init(self, controller): print "Initialized" # Connect to IoT Gateway and subscribe to topics client = iot_connect.connectIot() if client: print("successfully connected to AWS IoT") client.subscribe(topicMove, 1, callbackMove)
servo(angle) elif cmd == "reset": servo(90) else: print "Wrong Command, Please Enter Again" global angle, polly, reko, model, synsets # Reset servo to center position enable_servo() angle = 90 servo(angle) # Connect to IoT Gateway and subscribe to topics client = iot_connect.connectIot() client.subscribe(topicMove, 1, callbackMove) client.subscribe(topicScan, 1, callbackScan) client.subscribe(topicSpeak, 1, callbackSpeak) client.subscribe(topicSee, 1, callbackSee) polly = PollyApi.connectToPolly() reko = RekognitionApi.connectToRekognition() model, synsets = inception.load_inception_model() while True: time.sleep(10) client.unsubscribe(topicMove) client.unsubscribe(topicScan) client.unsubscribe(topicSpeak)