aws / aws-iot-device-sdk-js

SDK for connecting to AWS IoT from a device using JavaScript/Node.js
Apache License 2.0
964 stars 384 forks source link

connecting with AWS IOT: Error "INVALID_CONNECT_OPTIONS" #132

Closed sushantbisht closed 7 years ago

sushantbisht commented 7 years ago

I am trying to connect using aws IOT

var thingShadows = awsIot.thingShadow({ keyPath: '/home/pi/AAA/Key/abcdc-private.pem.key', certPath: '/home/pi/AAA/Key/abcdc-certificate.pem.crt', caPath: '/home/pi/AAA/Key/root-CA.crt', clientId: ThingName, region: 'us-east-1' });

However i am getting the following error code /home/pi/node_modules/aws-iot-device-sdk/device/index.js:406 throw new Error(exceptions.INVALID_CONNECT_OPTIONS); ^ Error: Invalid connect options supplied. at new DeviceClient (/home/pi/node_modules/aws-iot-device-sdk/device/index.js:406:13) at Function.DeviceClient (/home/pi/node_modules/aws-iot-device-sdk/device/index.js:201:14) at new ThingShadowsClient (/home/pi/node_modules/aws-iot-device-sdk/thing/index.js:123:30) at Object.ThingShadowsClient [as thingShadow] (/home/pi/node_modules/aws-iot-device-sdk/thing/index.js:89:14)

at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
fengsongAWS commented 7 years ago

Hi @sushantbisht , Please provide your host endpoints in your config. This is a breaking change in v2.0.0. Thanks

dom-white commented 7 years ago

It might have been worth mentioning this as a breaking change in the changelog. Currently it states this is a deprecation and certainly does not hint at the fact that it will now cause an exception if the new host endpoint is not provided