15 tools to prime your Raspberry Pi for IoT

Low-cost, low-effort enterprise IoT is within reach, thanks to powerful tools tuned for the Raspberry Pi

15 ways to prime your Raspberry Pi for IoT
Logo by Raspberry Pi Foundation

Prime your Pi for enterprise IoT

IoT is a sparkly new term for what the scientific community has been doing for a long time. But now, in its enterprise incarnation, we’re trying to place those data-gathering devices closer to the edge. Both researchers and businesses are essentially looking for “time series” data -- in other words, time-stamped data about the physical world around you. A great example of this can be found in the power industry, where companies are trying to obtain detailed information on power usage closer to their consumers, so they can build better usage models for the likes of rooftop solar.

The vast majority of IT pros I have spoken with note that the perceived development cost for an IoT solution is the primary reason management has been preventing them from pursuing it. But an IoT project doesn’t have to be costly, thanks in large part to the Raspberry Pi and its developing ecosystem. For example, the latest Interop in Las Vegas included an array of IoT demonstrations that are both low-cost and low-effort, with several leveraging zero-coding IoT systems.

Following are 15 IoT solutions centered largely around the Raspberry Pi, many of which we highlighted at Interop and a few that I’ve been exploring for use at the University of Hawaii School of Ocean and Earth Science and Technology. You’ll find tools that can be combined to create meaningful solutions for getting data from nontraditional locations such as freezers, datacenter raised floors, or remote locations that offer little visibility.

[ Intel, Apache, Amazon, and more: See the 2017 open source rookies of the year. | Cut to the key news in technology trends and IT breakthroughs with the InfoWorld Daily newsletter, our summary of the top tech happenings. ]

Drag-and-drop design with MyDevices Cayenne

Drag-and-drop design with MyDevices Cayenne

MyDevices Cayenne is a drag-and-drop project builder for designing IoT systems. It is by far the easiest way to start creating IoT solutions with the Raspberry Pi and now also supports the Arduino. It features a cloud-based dashboard, as well as apps for iOS and Android. Its help system includes step-by-step picture instructions for hooking up sensors, and it provides links to help you easily purchase components for your project.

It takes only two commands on the Pi to download and install the system, and Cayenne’s install wizard generates them for you for pasting onto the Pi: The first is a download command (wget), and the second sets up credentials for each Raspberry Pi in your collection and configures Cayenne for operation. This cloud-based system can be drag-and-drop configured from a web browser or from your Android or iOS device. It allows you to create triggers using if-then statements based on IoT sensor data and actions and to schedule automated actions, such as turning off lights at a set time each day.

Cayenne offers a wide collection of historical graphs and widgets in your dashboard, along with a spreadsheet option for downloading historical data. Two huge new developments are the integration of MQTT IoT gateways for linking to otherwise proprietary IoT systems, and the LoRa long-range radio system. The free version of Cayenne stores only a certain amount of data over a specific amount of time. Pay versions extend both limitations.

Analyze data with Initial State
Initial State

Analyze data with Initial State

Initial State provides data analytics for your IoT solutions. With it, you can stream data from your IoT devices into your Initial State account to view and analyze what is transpiring with your IoT system. I first got started with Initial State to harvest data off my Seeed Studio Wio Link that uses the Grove connector system (no soldering required). Initial State has since added support for several new platforms, including Arduino, Raspberry Pi, BeagleBone, and Particle. It has also added interfaces for several programming toolkits, such as Python, Java, C, Ruby, Thingsee, and Node.js.

Initial State is what I would call a low-programming system, allowing you to capture and visualize basic data from your IoT projects on a web-based dashboard. But Initial State also includes options for a rich programming environment, enabling you to integrate data visualization into your existing environment. Additionally, Initial State has accelerated its integration with a very large collection of systems, including Fitbit, Alexa, IFTTT, and even Amazon Dash Buttons. Initial State’s free version stores only a certain amount of date over a specific amount of time. Pay versions extend those limitations.

Wire your project with Node-Red
Node-Red

Wire your project with Node-Red

Node-Red is a visual tool for wiring together IoT projects. While not specific to the Raspberry Pi, the Node-Red graphical programming system offers a plethora of examples on how to use the sensor interfaces on the device. This Java-based system does require using the Raspberry Pi command line to install several software packages. Fortunately, there is a collection of step-by-step tutorials and some decent how-to videos available on the site.

Node-Red’s primary user interface is accessible via a web browser, either on the Raspberry Pi or nearly any modern web browser over the network. You'll need to use one of the community’s “modules” to store your data and/or connect your data to another data storage system. In my tinkering, I found some module descriptions lacking in detail with a decent amount of duplication of functions, but overall the collection had everything I was looking for. With Node-Red, I was able to harvest data off of a temperature and humidity sensor and store that data onto a network MySQL server fairly easily. Linux experience is very helpful, but many of the tutorials have clear step-by-step instructions for newbies.

Go deep on data with Splunk

Go deep on data with Splunk

Splunk is a great indexing and visualization system that, like Hadoop, is a major player in the big data world. I’ve been following Splunk for quite a while, and it has broken out of the mold of being only for syslog data. I include it here because it deals fantastically with time-series data, giving you the ability to more efficiently store your data without the need for a full-on database administrator. Folks like American Express, Ford, and Coca-Cola have been using Splunk to mine huge amounts of transaction data, with the ability to expand their programmatic reach with nearly any popular programming language.

A great example is how a school in America used it to create an energy-generation dashboard for its wind and photovoltaic generation, all from fairly standard energy data sources. Depending on how many fields and how often you need it, you can spool up additional indexing machines/VMs to handle the indexing load as you see fit. It involves a learning curve, but Splunk’s collection of tutorials and videos can get you up and running quickly.

Control your power with Adafruit’s Power Relay Module

Control your power with Adafruit’s Power Relay Module

I dearly love controllable power distribution units (PDUs) like the ones from Server Technologies, but I can’t always justify the cost. For certain locations, a simple Raspberry Pi connected to a relay to provide remote control power is a great solution. Of course, having an open relay and partially exposed wires will give your safety folks conniptions, so instead check out Adafruit’s Controllable Four Outlet Power Relay Module, a sealed-up power strip that’s still easily controllable by the Pi. I taught a class using Cayenne with a waterproof temperature sensor and a single outlet version of this unit to show how easy it is to control the heater for a saltwater fish tank.

Ditch the solder with PiFace Digital 2

Ditch the solder with PiFace Digital 2

Another comment I heard from the folks at this past year’s Interop IoT Demo lab was that they didn’t want to have to design and solder together sensors. PiFace Digital 2 is an add-on board that breaks out the input/output pins of the Raspberry Pi onto easy to use screw terminals. It also adds a couple of relays that can easily control power to other devices. In addition, PiFace Digital 2 has a few buttons and LEDs so that you can more easily perform shutdowns or get system status without needing to hook up a monitor, keyboard, and mouse. The PiFace Digital 2 makes running a headless (aka lights out) Raspberry Pi as easy as pie.

Ride out power outages with Pi UPS
Pi Supply

Ride out power outages with Pi UPS

One significant downside to the Raspberry Pi is the Micro SD card used for storage. If the system is trying to write data to the card and the power goes out, it can easily corrupt the file system. In fact, the No. 1 cause for Raspberry Pi’s failing in the field is improper shutdown when power fails. Enter Pi UPS, a stackable board (aka shield) that provides an integrated uninterruptable power supply. Pi UPS can perform a graceful shutdown or let you ride out the power outage without losing data. Sadly, there was a supercapacitor version that appeared, then failed on Kickstarter; if it were available, it would catapult you past issues with batteries getting cooked in hot environments or losing power in cold environments.

Roll your own LCD to display clock and IP address

Roll your own LCD to display clock and IP address

The massive hassle of running a Raspberry Pi headless (no monitor, mouse, or keyboard) is that if you run it using DHCP for a wired or wireless network connection, you don’t normally have an easy way to find the IP address so that you can SSH/remote in and make changes. Michael Sklar solves this issue nicely, going as far as demonstrating how to use a serial LCD combination to show the time and current IP address on a very inexpensive LCD. Combine this with the PiFace Digital 2 and some IDC crimp connectors, and you can cobble together this solution without soldering. (Note: IDC connectors have a very specific wire size, and too small or too large makes for unreliable connections. Here’s a YouTube video on using these great connectors.)

Go remote with VNC

Go remote with VNC

Sometimes you want remote access to the GUI on your Raspberry Pi. My favorite way is using VNC, which lets you “slave” your Raspberry Pi and display the GUI on your computer, tablet, or smartphone. The folks at Dexter Industries have done a bang-up job creating a step-by-step tutorial on how to set up VNC on a tablet to take remote control of the Raspberry Pi’s GUI. I should point out that VNC in most cases sends the password in clear text (unsecure), so if you plan on doing this from far away, you might want to take the time to also learn how to “tunnel” VNC through SSH so that everything is encrypted. Think of it as a poor man’s VPN.

Containerize your Pi app with Docker

Containerize your Pi app with Docker

I love Docker. The fact that a Docker container is inherently read-only and runs a single application will remove some of the biggest objections to running Raspberry Pi’s in the enterprise by your security auditor. Andrew Mallett of the Urban Penguin shows you how to Dockerize your Pi application in this video. Dockerize your remote temperature sensor web app, a flood sensor for under your datacenter raised floor, or maybe an inexpensive night vision camera to peek at a nest of baby birds.

Tweet your Pi

Tweet your Pi

Social media has taken the world by storm -- so wouldn’t it be great if you could tweet the temperature of your company’s walk-in refrigerator/freezer or tweet if the Pi detects water under your datacenter’s raised floor? I like to equate the Pi to a Swiss Army knife, lots of different ways to achieve what you want, and having your Pi tweet your data is certainly a tasty way to keep tabs on key infrastructure. Victoryking offers a great Instructables tutorial for rigging your Raspberry Pi to send status updates to Twitter.

Control your Pi with Alexa

Control your Pi with Alexa

Ever since we saw Scotty say “hello computer" in "Star Trek IV: The Voyage Home," we’ve all wanted to talk to our systems. Well, with the Amazon Echo we’re taking our first steps toward this future. Rajarshi Nigam’s Hackster.io tutorial shows us how. Simply put, his tutorial outlines how to add some inexpensive wireless modules to your Raspberry Pi, which can then control some superinexpensive remote wireless outlets. What’s nice is the whole project is less than $50 and could as easily control the power and lights for your company’s conference room.

Build an SSL-VPN server for your Pi
InfoWorld

Build an SSL-VPN server for your Pi

Since you’re most likely running a Linux variant on your Pi, traditional IPSec for site-to-site VPNs is pretty easy, but going that extra step by implementing an SSL-VPN for traveling users is a bit more difficult. Two tutorials show you how to do that based on the open source OpenVPN system. (Better yet, OpenVPN is going through an audit for that extra sense of security that comes from a third party checking the safety of the implementation.)

I’ve linked to two tutorials above; the first goes through the install on a Pi, and the second gives quite a bit more detail on the OpenVPN SSL/TLS client VPN feature of OpenVPN. The project group has taken most of the pain out of the install, and you would then place the Raspberry Pi into a DMZ area of your firewall and create rules for users to access trusted areas. Once that’s done, you’re set for an inexpensive way to add a few SSL-VPN users.

Track movements with an RFID log

Track movements with an RFID log

Rob Pinson outlines on Hackster.io a rocking Pi application that taps Microsoft Windows IoT and a Raspberry Pi Zero to log people’s movements with MiFare RFID cards. While this is not physical access control (yet), it is a fairly complex app. Here’s the basic description: “Recording movements through a Web API hosted in the cloud to a SQL DB, with an ASP.Net 5 MVC 6 admin website with the ability to add people profiles and images and issue RFID cards.” I imagine this would work great for schools that need automated attendance, but are on a tiny budget.

Sprinkle with your Pi

Sprinkle with your Pi

Clean water is a scarce commodity almost everywhere, and most municipalities tie your sewage as a multiplier of the reading on your water meter. However, in many cases, if you can prove how much water you use for irrigation, you can get them to subtract that water usage from your sewer fees. What Jason Gleim has done is to get rolling on both control and metering of his sprinkler system and gone as far as cloud-enabling it using Windows IoT and Azure. Perhaps if your irrigation water feed is small enough, you too can reduce your company sewage fees and keep your utilities company honest. To scale this up, even the larger water meters have a small magnet on a spinning rotor inside the meter that translates a fixed number of turns into a gallons reading on the dial. You can use a magnetometer on the outside of the housing to do the same and send that count to the Pi for posting to the cloud or wherever.