enableiot / iotkit-agent

Edge agent to abstract cloud connectivity complexities
BSD 2-Clause "Simplified" License
82 stars 49 forks source link

Problems receiving IoT Actuations #81

Closed tyspa1 closed 9 years ago

tyspa1 commented 9 years ago

Hello, I am having trouble getting the Actuation to work with my Intel Edison. After switching to the MQTT protocol iotkit-admin protocol mqtt running iotkit-admin test returns the following error:

{"level":"error","message":"Connection to MQTT broker is closed. Retrying...","timestamp":"2015-10-06T15:57:14.741Z"}

Any ideas? Thank you, Tyler

marcinma commented 9 years ago

Hi Tyler,

Please check if you are behind proxy or have any other type of firewall which may block mqtt connections. If that is the case you can use rest+ws (websockets) feature in agent to receive actuations.

Best regards Marcin

tyspa1 commented 9 years ago

I switched back to the REST protocol and started sending data over websockets, but it still doesn't come to UDP. I am running the python test script (https://github.com/enableiot/iotkit-samples/blob/master/python/IoTkitActuationExample.py) (unmodified) and nothing comes through. When I run iotkit-admin pull-actuations I get:

2015-10-07T19:04:19.341Z - info: Sending actuation: {"component":"lamp","command":"LED.v1.0","argv":[{"name":"LED","value":"1"}]} UDP Closing from undefined

Tyler

mtomczew commented 9 years ago

To support actuations along with REST you need to set rest+ws protocol using iotkit-admin protocol rest+ws and wait for a message WSConnector: Connection successful to: ws.us.enableiot.com:443 It is a bit later than TCP\UDP listener started.

Script connects locally to already working iotkit-agent so if agent had problem connecting to the Cloud, script won't receive anything.

tyspa1 commented 9 years ago

Thanks for the help. The above fixed it :+1: