aws / aws-iot-device-sdk-arduino-yun

SDK for connecting to AWS IoT from an Arduino Yún.
Apache License 2.0
163 stars 77 forks source link

Shadow update fails after 10 seconds #49

Closed hyunraider closed 7 years ago

hyunraider commented 7 years ago

I modified the ThermostatSimulatorDevice such that the delay at the end of the loop is 10 seconds instead of 1 second. For some reason, for any delay time less than 10 seconds works as intended but as soon as the delay is 10 seconds or higher I get this error:

Exception in thread Thread-4 (most likely raised during interpr [ERR] command: shadow update code: -1

And shadow updates no longer work. I'd ideally like to add some trigger in the arduino that would update the shadow, which might have a delay time of more than 10 seconds. I also changed the CMD_TIME_OUT to 400 in the config file, but the code is still timing out after 10 seconds.

liuszeng commented 7 years ago

Hi @hyunraider ,

Thank you very much for your interest in AWS IoT Arduino Yun SDK.

Yun SDK relies on the Python runtime running on embedded Linux to do the heavy lifting work. There is a timeout configuration in serial1 read in the Serial Communication Server, which is 10 sec: https://github.com/aws/aws-iot-device-sdk-arduino-yun/blob/master/AWS-IoT-Python-Runtime/runtime/runtimeHub.py#L104

If you need to increase the idle time allowed for the Python Runtime to accept the serial command, you can increase the value there and do a re-upload to AR9331 to update the change.

Hope the above helps.

Thanks, Liusu

hyunraider commented 7 years ago

Thank you so much! This did the trick.