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; var AWS = require('aws-sdk'); var pir = new Gpio(17, 'in', 'both'); var raspistill = new Raspistill({ noFileSave: true, encoding: 'bmp', width: 640, height: 480 }); // Rekognition config var config = { ...