enebular / enebular-agent-aws-iot

enebular agent with AWS IoT
0 stars 2 forks source link

AWS IoT の Device Shadow に `desired.power = "on"` を設定してからエージェントを起動しないと、起動エラーになる #3

Open satour opened 7 years ago

satour commented 7 years ago
$ ./node_modules/.bin/enebular-agent-aws-iot run ./node_modules/.bin/node-red -s settings.js
>> connected to AWS IoT
/home/ubuntu/enebular/node_modules/enebular-agent-aws-iot/index.js:93
    if (state.desired.power) {
                     ^

TypeError: Cannot read property 'power' of undefined
    at ThingShadowsClient.<anonymous> (/home/ubuntu/enebular/node_modules/enebular-agent-aws-iot/index.js:93:22)
    at ThingShadowsClient.g (events.js:260:16)
    at emitMany (events.js:108:13)
    at ThingShadowsClient.emit (events.js:182:7)
    at ThingShadowsClient._handleMessages (/home/ubuntu/enebular/node_modules/enebular-agent-aws-iot/node_modules/aws-iot-device-sdk/thing/index.js:318:12)
    at DeviceClient.<anonymous> (/home/ubuntu/enebular/node_modules/enebular-agent-aws-iot/node_modules/aws-iot-device-sdk/thing/index.js:355:21)
    at emitThree (events.js:97:13)
    at DeviceClient.emit (events.js:175:7)
    at MqttClient.<anonymous> (/home/ubuntu/enebular/node_modules/enebular-agent-aws-iot/node_modules/aws-iot-device-sdk/device/index.js:693:12)
    at emitThree (events.js:97:13)
satour commented 7 years ago

ワークアラウンドとして、手動で device shadow にdesired.power = "on" を設定すると回避できる。