Now, we will set up the app and write the required code:
- From the Terminal, once you are inside the IBM-IoT-Device folder, run the following:
$ npm init -y
- Next, we will install the ibmiotf module (https://www.npmjs.com/package/ibmiotf) from npm. Run the following:
$ npm install ibmiotf --save
- Next, we will install rpi-dht-sensor (https://www.npmjs.com/package/rpi-dht-sensor) from npm. This module will help in reading the DHT11 temperature and humidity values:
$ npm install rpi-dht-sensor --save
- Your final package.json file should look like this:
{ "name": "IBM-IoT-Device", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo "Error: no test specified" && exit 1" }, ...