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

ThermostatSimulator device #44

Closed escissorshand closed 7 years ago

escissorshand commented 7 years ago

HI, i have problem running the ThermoStatSimulator.py. it provides an invalid syntax error on line 7.

image image

And on my serial monitor the setup monitor just hang on the following.

image image

However, i have shadow updates on the AWS IOT console. i believe the connection to the AWS IOT console is successful.

image image

thanks in advance for your help.

liuszeng commented 7 years ago

Hi @escissorshand ,

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

It seems that there is a line of <!DOCTYPE html> at the beginning of your ThermostatSimulatorApp.py. Can you open the file and check it again? You should be able to find the script in the SDK repo here: https://github.com/aws/aws-iot-device-sdk-arduino-yun/blob/master/ExampleAppScript/ThermostatSimulatorApp/ThermostatSimulatorApp.py

One other thing worth mentioning here is, the application script is operation on the device shadow with a fixed name room. See details here: https://github.com/aws/aws-iot-device-sdk-arduino-yun/blob/master/ExampleAppScript/ThermostatSimulatorApp/ThermostatSimulatorApp.py#L154

To get the application script working with the Arduino Yun sketch, you want to keep the device shadow name same so that they can interacting with each other via the same shadow. For more details about the sample, you can check out the documentation here: https://github.com/aws/aws-iot-device-sdk-arduino-yun#simple-thermostat-simulator

Thanks, Liusu

escissorshand commented 7 years ago

thanks Liusu,

I can now launch the ThermostatSimulatorApp.py application.

However, when i launch the Arduino IDE serial monitor there is no print logs. but i know its at the void (loop) function through some serialprint statement.

image

the data is also being updated on the shadow on the AWS IOT

image

the reported temperature is also not capture on the ThermostatSimulatorApp.py application.

image

how do i keep the device shadow name same?

To get the application script working with the Arduino Yun sketch, you want to keep the device shadow name same so that they can interacting with each other via the same shadow. For more details about the sample, you can check out the documentation here:

escissorshand commented 7 years ago

I think the device shadow name is change under the aws_iot_config file

define AWS_IOT_MY_THING_NAME "room"

After changing that. it works.

image