0
我已經創建了AWS物聯網一個東西叫做RasberryPi,我試圖用下面的代碼它的身影登記註冊:AWS IOT:不能與影子
var awsIot = require('aws-iot-device-sdk');
var thingShadows = awsIot.thingShadow({
keyPath: "./certs/private.pem.key",
certPath: "./certs/certificate.pem.crt",
caPath: "./certs/root-CA.crt",
clientId: "RasberryPi1",
region: "eu-west-1",
port: "8883",
debug: true
});
thingShadows.on('connect', function() {
console.log('connected');
thingShadows.register('RasberryPi1', function() {
console.log('registered');
...
我連接成功,但我從來沒有註冊。也就是說,第二個console.log語句永遠不會運行。任何人都可以爲我的錯誤提供建議嗎?我對AWS IoT非常陌生,我的錯誤可能很基本。
非常感謝