Skip to Content
Enterprise Internet of Things Handbook
book

Enterprise Internet of Things Handbook

by Arvind Ravulavaru
April 2018
Intermediate to advanced
332 pages
8h 5m
English
Packt Publishing
Content preview from Enterprise Internet of Things Handbook

Reading the data from the IoT Thing

To read the data from the device, you can either use the same Raspberry Pi 3 or another computer. I am going to use my MacBook as a client that is interested in the data sent by the device:

  1. Create a folder named test_client. Inside the test_client folder, run the following command:
$ npm init --yes  
  1. Next, install the azure-event-hubs module (https://www.npmjs.com/package/azure-event-hubs) using the following command:
$ npm install azure-event-hubs --save  
  1. Create a file named index.js inside the test_client folder and update it as detailed in the following code snippet:
var EventHubClient = require('azure-event-hubs').Client;var connectionString = 'HostName=Pi3-DHT11-Nodes.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=J0MTJVy+RFkSaaenfegGMJY3XWKIpZp2HO4eTwmUNoU='; ...
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

Embedded Software for the IoT

Embedded Software for the IoT

Klaus Elk
Building Sensor Networks

Building Sensor Networks

Ioanis Nikolaidis, Krzysztof Iniewski
Architecting the Industrial Internet

Architecting the Industrial Internet

Robert Stackowiak, Carla Romano, Shyam Varan Nath

Publisher Resources

ISBN: 9781788838399Supplemental Content