Skip to Content
Hands-On Industrial Internet of Things
book

Hands-On Industrial Internet of Things

by Giacomo Veneri, Antonio Capasso
November 2018
Intermediate to advanced
556 pages
14h 42m
English
Packt Publishing
Content preview from Hands-On Industrial Internet of Things

Sending data through MQTT

To develop our simple device, we will create a basic application based on Node.js. However, it is also possible to use .NET, Java, Python, and ANSI C.

From the command console, we can create an empty directory and install the right packages. The commands required to do this are as follows:

mkdir my-iiot-devicecd my-iiot-devicenpm init -ynpm install azure-iot-device azure-iot-device-mqtt –save

A simple source code to develop our application is available on GitHub at https://github.com/Azure/azure-iot-sdk-node.

On the my-iiot-device path that we just created, we can create a new file called my-iiot-device.js and copy and paste the following code. Replace the connection string with your connection string:

'use strict'; ...
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

Internet of Things

Internet of Things

S. Velliangiri, Sathish A.P. Kumar, P. Karthikeyan
Industrial Internet Application Development

Industrial Internet Application Development

Alena Traukina, Jayant Thomas, Prashant Tyagi, Veera Kishore Reddipalli

Publisher Resources

ISBN: 9781789537222Supplemental Content