Skip to Content
Practical Internet of Things with JavaScript
book

Practical Internet of Things with JavaScript

by Arvind Ravulavaru
December 2017
Intermediate to advanced
296 pages
5h 56m
English
Packt Publishing
Content preview from Practical Internet of Things with JavaScript

Developing the logic

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: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Test-Driving JavaScript Applications

Test-Driving JavaScript Applications

Venkat Subramaniam
Web Caching and Replication

Web Caching and Replication

Michael Rabinovich, Oliver Spatscheck

Publisher Resources

ISBN: 9781788292948Supplemental Content