Smart companies never stands still trying to determine new technologies and leverage them. Therefore, as tech enthusiasts, we always try to dig something interesting; and this time our attention is focused on two modern trends: The Internet of Things and Node.js. Each one provides tons of new opportunities when used separately, but both can be combined within a single system as well. Below, we explain how these phenomenons are used together, demonstrate why Node.js is ideal for the creation of the Internet of Things ecosystems, and talk about some Node-based services related to the IoT development.
Unfortunately, most IoT products do not provide a unified experience for communicating between business systems and appropriate devices. Moreover, some of modern IoT technologies are very expensive, but still don’t offer enough flexibility and agility. Therefore, developers are looking for new ways to reduce the price of their products and make them more useful and feature-rich.
It is also necessary to mention a wide variety of Node.js tools. Such frameworks as Hapi, Express, or Restify have essentially changed the process of APIs development in Node.js. Even without a huge experience and any powerful pre-built solutions, it takes only a few lines of code and a short amount of time to create a simple API.
As for IoT devices, all possible sensors, wearables, and beacons, they generate a plethora of requests. Not every platform can handle such a great amount of data, but Node.js can. It is well-suited for managing these requests, since the platform relies on stream instances which are basically Unix pipes. Streams are monitored and processed very efficiently, can be writable, readable, or both, and are easy to use. Due to a streaming nature, Node.js provides users with the ability to stream data directly to its destination or pipe requests to each other without caching or using temporary data. As a result, you get a stream from one place to another which is crucial for the Internet of Thing, since such approach helps to reduce the usage of resources significantly.
Node.js community is another reason to use the platform with the IoT. You might have noticed that the Node.js npm repository contains dozens of packages aimed at the Internet of Things devices and apps. For instance, there are 80+ packages for the Arduino controller, more than 10 for Bluetooth Low Power, and a lot of tools for Pebble, Fitbit, and other wearables.
Very low resource requirements, proven performance, and the simplicity of use make Node.js the number-one tool for creating IoT apps. Here are some advices for developing an IoT API-first architecture with Node.js. First of all, you should rely on several simple apps instead of a complex one. Use small independent components connected via APIs, and you will provide your system with robust scalability and failover. If one instance crashes, the whole system will be still available. Besides, an API-based architecture makes it possible to produce a clean and extensible design.
Thus, Node.js provides much wider opportunities for building IoT applications than its counterparts. Someone still uses Java to master the Internet of Things, but this approach has too much drawbacks in comparison with Node.js. Therefore, we propose you to examine the following Node.js services related to the IoT.
Table of contents
The lightweight Node.js runtime provides the full advantage of event-driven, non-blocking nature and make it possible to write Internet of Things applications for a low-cost hardware and cloud usage.
As for available tools, the Node.js npm repository offers more than 120,000 modules; and all of them are available through Node-RED platform. It is also necessary to mention, that Node-RED stores flows via JSON, so all your IoT projects can be easily shared with others.
- Arduino YUN
- Beaglebone Black
- Intel Galileo
- Intel IoT Analytics
- Leap Motion
- Raspberry Pi
- WICED Sense
Besides, there are platforms developed by Cylon users: Parrot Rolling Spider, iBeacon, PCDuino, and Belkin Wemo.
It is also worth mentioning that Cylon.js can be run directly in your browser with the browserify NPM module, within a Chrome connected app, or a PhoneGap mobile app. The platform is heavily based on an API plugin system and uses the Gort toolkit, so you can utilize the command line. Moreover, there is a separate CLI tool for generating new modules, robots, and drivers within Cylon.
Being an open source API-First Internet of Things platform built on Node.js, Zetta provides all the necessary tools for creating IoT servers that run across geo-distributed computers and in the cloud. The platform combines WebSockets, REST APIs, and reactive programming for combining various devices and data-intensive, real-time apps into complex IoT systems.
Zetta allows you to observe and react to the behavior of your devices and systems in code and via visualization tools. Besides, you can stream data into Splunk or other machine analytics platforms.
With the help of Zetta, you will be able to assemble all possible applications together into a complex adaptive system that operates in the physical world of wearable computing, home automation, smart transportation, etc. Its servers run in the cloud, on single-board computers, or on PCs; and it turns any device into an API, providing you with the ability to connect everything together. Thus, Zetta is another prominent IoT Node.JS example.
deviceJS makes it possible to connect Node.js Web apps with smart devices of any brand or protocol into a single system with just one language. Or you can build your own system for controlling the Internet of Things as you wish.
Tessel 2 is an open source software and hardware solution which provides everything you need to get up and running with the Internet of Things systems. It introduces the ability to add sensors and actuators in one step, use such peripherals as cameras and 3G/4G dongles, and program your systems wirelessly. Besides, Tessel 2 offers an ultra-reliable wired connection, fast program execution, and plenty of space for your code. It is also necessary to draw your attention to power and tethered programming, realtime I/O, and advanced power management. Discover some crazy Tessel projects in the video below:
Each module related to Tessel 2 has an open source library on NPM and a dedicated documentation. You just need to connect, npm install, and write a few lines of code to get started. Thus, the system offers endless combinations of modules for creating new devices; and you can use your favorite text editor and libraries to program hardware component of Tessel 2.
Mosca is a Node.js MQTT broker, which can be used as a standalone module or embedded in another Node.js application. In its turn MQTT is a simple and lightweight publish/subscribe connectivity protocol for Internet of Things and machine-to-machine systems. It is designed with constrained devices and unreliable networks in mind, so resource requirements are minimized, which makes MQTT ideal for the Internet of Things world of connected devices. As for Mosca, it simplifies the development based on the protocol, being another good example of Node.js usage in the IoT.
This package provides an I2C serial bus access via io.js or Node.js. It supports the following Linux boards: Raspberry Pi (1 and 2), BeagleBone (original and Black), and Intel Edison. It is also necessary to mention that all methods have asynchronous and synchronous forms. Thus, i2c-bus is another reliable tool for building IoT systems with Node.js.
In order to effectively exploit the IoT developers must consider products and processes that will help them build useful, user-friendly, and secure solutions; and Node.js is a tool that everyone can leverage to design leading Internet of Things devices, applications, and ecosystems. For further information on IoT with Node.js, check the below video.