O'Reilly logo

Practical Internet of Things with JavaScript by Arvind Ravulavaru

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Deploying to Raspberry Pi

Now that we have seeded a Rekognition collection, as well as tested it (an optional step), we are now going to start setting up the Raspberry Pi code.

We will be using all the other code pieces from the chapter8 folder as is and only modifying the Raspberry Pi client in the chapter9 folder.

Copy the entire code from the chapter8 folder into the chapter9 folder. Then, open the pi-client folder either on your desktop or on the Raspberry Pi itself, and update it as follows:

var config = require('./config.js'); var mqtt = require('mqtt'); var GetMac = require('getmac'); var Raspistill = require('node-raspistill').Raspistill; var crypto = require("crypto"); var Gpio = require('onoff').Gpio; var exec = require('child_process').exec; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required