0

When I am trying to run the following node.js example from AWS IoT I get this error(following this tutorial):

pi@raspberrypi:~/aws-iot-device-sdk-js/examples $ node device-example.js -g

private.pem.key doesn't exist (--help for usage)

However I have the private.pem.key in ~/certs folder as requested by the tutorial.

pi@raspberrypi:~/aws-iot-device-sdk-js/examples $ vi device-example.js 
pi@raspberrypi:~/aws-iot-device-sdk-js/examples $ ls ~/certs/private.pem.key 
/home/pi/certs/private.pem.key
Mona Jalal
  • 34,860
  • 64
  • 239
  • 408

2 Answers2

3

The device-example.js program is designed to be run in pairs; each process communicates with the other through the AWS IoT platform. You'll need to start another copy of the program (it can be on another host) in order to see them communicating. More information about running the example programs can be found here. Thanks for using AWS IoT.

garyw_aws
  • 101
  • 3
0

Solved the problem by giving the paths like the following: pi@raspberrypi:~/aws-iot-device-sdk-js/examples $ node device-example.js --aws-region=us-west-2 --certificate-dir=/home/pi/certs --test-mode=2

Mona Jalal
  • 34,860
  • 64
  • 239
  • 408
  • On a sidenote, should it just get stuck at the "connect" message? pi@raspberrypi:~/aws-iot-device-sdk-js/examples $ node device-example.js --aws-region=us-west-2 --certificate-dir=/home/pi/certs --test-mode=2 connect – Mona Jalal Mar 07 '16 at 00:45
  • I am stuck at message attempting new mqtt connection. Not going ahead of it. anything wrong? – SangamAngre Apr 21 '16 at 12:49