cuongquay / node-red-contrib-aws-iot

Support ThingShadow and MQTT protocol with Certificate Store by clientId (thingName)
Apache License 2.0
11 stars 13 forks source link

host parameter: is now required for connection (?) #15

Closed merlinmb closed 7 years ago

merlinmb commented 7 years ago

Hi, it seems that the host is now required for a connection to AWS MQTT... I manually added host: with the fully qualified URL - this can be found in the start.sh example connection pack. My connection works after this.

Source: https://github.com/aws/aws-iot-device-sdk-js/blob/master/README.md#certificate-configuration

var awsIot = require('aws-iot-device-sdk');

var device = awsIot.device({ keyPath: , certPath: , caPath: , clientId: , host: });

cuongquay commented 7 years ago

I confirmed they changed from 'region' into 'host' as the following logs

-// Replace the values of '<YourUniqueClientIdentifier>' and '<YourAWSRegion>'
 -// with a unique client identifier and the AWS region you created your
 -// certificate in (e.g. 'us-east-1').  NOTE: client identifiers must be
 -// unique within your AWS account; if a client attempts to connect with a
 -// client identifier which is already in use, the existing connection will
 -// be terminated.
 +// Replace the values of '<YourUniqueClientIdentifier>' and '<YourCustomEndpoint>'
 +// with a unique client identifier and custom host endpoint provided in AWS IoT cloud
 +// NOTE: client identifiers must be unique within your AWS account; if a client attempts 
 +// to connect with a client identifier which is already in use, the existing 
 +// connection will be terminated.
  //
  var thingShadows = awsIot.thingShadow({
     keyPath: <YourPrivateKeyPath>,
    certPath: <YourCertificatePath>,
      caPath: <YourRootCACertificatePath>,
    clientId: <YourUniqueClientIdentifier>,
 -    region: <YourAWSRegion>
 +      host: <YourCustomEndpoint>
  });
cuongquay commented 7 years ago

I have just updated the host parameter. If you test with any error. Please let me know.

Many thanks,

merlinmb commented 7 years ago

Thank you for a great module & the quick response!