Skip to Content
Learning AWS IoT
book

Learning AWS IoT

by Agus Kurniawan
January 2018
Intermediate to advanced
278 pages
5h 13m
English
Packt Publishing
Content preview from Learning AWS IoT

Developing a sensor publisher

In this section, we will develop a sensor publisher. A sensor publisher is a system that generates sensor data and then perform to publish that sensor to a certain server. We can implement this application by using Node.js. Ensure your computer has Node.js installed. A sensor publisher will send sensor data at certain periods. For the demo, I generated a random value between 10 and 35 for the temperature sensor. Consider the following steps:

  1. Firstly, we create a folder named sensor-publisher and initialize the project using npm init:
$ mkdir sensor-publisher$ cd sensor-publisher/$ npm init
  1. Then, we install AWS IoT SDK for JavaScript/Node.js. For this, type the following command:
$ npm install aws-iot-device-sdk ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learn AWS Serverless Computing

Learn AWS Serverless Computing

Scott Patterson

Publisher Resources

ISBN: 9781788396110Supplemental Content