December 2017
Intermediate to advanced
296 pages
5h 56m
English
Now that we are able to test the camera, we will integrate this setup with our IoT platform. We are going to stream these images 100ms apart continuously to our API engine and then through web sockets update the UI on the web.
To get started, we will make a copy of chapter4 and dump it into a folder named chapter8. Inside the chapter8 folder, open pi/index.js 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 raspistill = new Raspistill({ noFileSave: true, encoding: 'jpg', width: 640, height: 480 }); var crypto = require("crypto"); var fs = require('fs'); var client = mqtt.connect({ port: ...