Developing the Node.js device app

Now we will set up the app and write the required code:

  1. From the Terminal, once you are inside the Azure-IoT-Device folder, run the following command:
$ npm init -y  
  1. Next, we will install azure-iot-device-mqtt from NPM (https://www.npmjs.com/package/azure-iot-device-mqtt). This module has the required client code to interface with Azure IoT.

Along with this, we are going to install the azure-iot-device (https://www.npmjs.com/package/azure-iot-device) and async modules (https://www.npmjs.com/package/async). Execute the following command:

$ npm install azure-iot-device-mqtt azure-iot-device async --save
  1. Next, we will install rpi-dht-sensor from NPM (https://www.npmjs.com/package/rpi-dht-sensor). This module ...

Get Enterprise Internet of Things Handbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.