aws-iot

Publishing message from AWS Lambda to AWS IoT

偶尔善良 提交于 2021-01-01 03:38:40
问题 I am trying to publish message from AWS Lamba using Nodejs to AWS IoT . I have zipped the project and uploaded on to the AWS IoT below is the code snippet var awsIot = require('aws-iot-device-sdk'); var device = awsIot.device({ keyPath: 'keyfilepath', certPath: 'pem file path', caPath: 'root-CA.crt', clientId: 'iotTest7526532135', host: 'host id' }); device .on('connect', function() { console.log('connect'); device.subscribe('topic_3'); device.publish('topic_1', JSON.stringify({ message_id:23

Publishing message from AWS Lambda to AWS IoT

▼魔方 西西 提交于 2021-01-01 03:34:34
问题 I am trying to publish message from AWS Lamba using Nodejs to AWS IoT . I have zipped the project and uploaded on to the AWS IoT below is the code snippet var awsIot = require('aws-iot-device-sdk'); var device = awsIot.device({ keyPath: 'keyfilepath', certPath: 'pem file path', caPath: 'root-CA.crt', clientId: 'iotTest7526532135', host: 'host id' }); device .on('connect', function() { console.log('connect'); device.subscribe('topic_3'); device.publish('topic_1', JSON.stringify({ message_id:23

AWS IoT Connection error : Invalid “caCert” option supplied with aws-iot-device-sdk

我是研究僧i 提交于 2020-06-28 05:26:28
问题 I've provisioned a device in AWS with device Certificate which is signed by my CA. Also, I've registered my CA along with verificationCert in AWS previously. Now when I send the data, In the options, var awsIot = require('aws-iot-device-sdk'); var device = awsIot.device({ privateKey: '--BEGIN RSA PRIVATE KEY--', //private key of my device clientCert: '--BEGIN CERTIFICATE --', //cat deviceCertificate and registered CA caCert: '--BEGIN CERTIFICATE--', //Amazon root CA clientId: 'Thing01',

Use cognito login instead of certificates to authenticate and subscribe to aws IoT MQTT topics?

爷,独闯天下 提交于 2020-06-09 05:29:27
问题 I'm new to learning AWS and I'm trying to figure out if my use-case is possible. I want to create a mobile app where the user can login (email/facebook/google etc.) and then subscribe to a few MQTT topics on aws IoT to receive realtime sensor data for a gardening system. There are many tutorials on AWS that show you how to do this (prime example: https://github.com/awslabs/aws-sdk-android-samples/blob/master/AndroidPubSub/README.md) but all of them require you to download certificates, insert

Use cognito login instead of certificates to authenticate and subscribe to aws IoT MQTT topics?

不问归期 提交于 2020-06-09 05:29:12
问题 I'm new to learning AWS and I'm trying to figure out if my use-case is possible. I want to create a mobile app where the user can login (email/facebook/google etc.) and then subscribe to a few MQTT topics on aws IoT to receive realtime sensor data for a gardening system. There are many tutorials on AWS that show you how to do this (prime example: https://github.com/awslabs/aws-sdk-android-samples/blob/master/AndroidPubSub/README.md) but all of them require you to download certificates, insert

Can not connect to AWS Amplify PubSub -> Socket error:undefined

青春壹個敷衍的年華 提交于 2020-05-15 21:23:07
问题 I've been trying out all ways to get the Amplify/PubSub working without any luck. It seems all the documentation are rather outdated. Here is what I have done so far. Please note all hashes are made up ;-) Created a fresh React Native app Installed amplify packages Installed Amplify CLI Invoked $ amplify configure Invoked $ amplify init Invoked $ amplify add auth Invoked $ amplify push , which created the aws-exports.js object Created a super simple component import React from 'react'; import

Can not connect to AWS Amplify PubSub -> Socket error:undefined

南笙酒味 提交于 2020-05-15 21:21:50
问题 I've been trying out all ways to get the Amplify/PubSub working without any luck. It seems all the documentation are rather outdated. Here is what I have done so far. Please note all hashes are made up ;-) Created a fresh React Native app Installed amplify packages Installed Amplify CLI Invoked $ amplify configure Invoked $ amplify init Invoked $ amplify add auth Invoked $ amplify push , which created the aws-exports.js object Created a super simple component import React from 'react'; import

AWS IoT: Subscribe to Topic in Browser

烈酒焚心 提交于 2020-05-10 20:03:53
问题 I'm currently developing a Serverless App with AWS. I want to subscribe to a topic using plain JavaScript (No Node.js, React, Angular etc.) The IoT and IoTData SDK's doesn't support a "subscribe to topic" function. To achieve this, i need to implement the aws-iot-device sdk, via require('aws-iot-device') (which i can't use in plain JS). Unfortunatly this SDK only works with runtimes like Node.js or Browserify. So how can someone subscribe to a topic from browser? Is there a way to implement