How to Install or Upgrade to Node.js v7 on the Raspberry Pi

It’s here! The Node.js Foundation has released version 7 of Node.js, an open-source, cross platform JavaScript runtime environment. Node.js provides an event-driven architecture capable of asynchronous I/O and allows us to build a gamut of software from highly scalable networked applications to CLI (Command-line Interface) applications. It’s a great fit for building IoT systems, and there’s never been a better time to get in the Node game with the Raspberry Pi! Our friends at NodeSource host a package repository that makes installing and maintaining Node on the Raspberry Pi easy.  Keep reading to learn how to get started.

Share

Connecting a Raspberry Pi Using an Ethernet Crossover Cable and Internet Connection Sharing

I’m preparing for an upcoming speaking engagement around the topic of using Node.js and the Raspberry Pi for IoT applications. While at home, I enjoy the luxury of being the owner of my network which provides complete freedom in network configuration. On the road, I will not have this luxury whether it is at a hotel or when speaking at the conference. Here’s the problem I am trying to solve. While on the road, I want to be able to connect my laptop to the Wi-Fi hotspot on my phone rather than utilizing the wireless network at the conference location which might be fraught with both security and reliability issues. Read More

Share

Node.js IoT: Logging Data That Is Out of This World

The ability to log data is an important capability in IoT applications. In this tutorial, we learn how to use Node.js to log data by utilizing built-in Node modules. There are certainly excellent logging modules available including pino and Winston (see my Winston tutorial here); however, our goal today is to deepen our knowledge of Node by implementing some simple logging code ourselves in order to become better Node developers.

Share

Node.js IoT: Tracking the ISS through the Sky

We’re back today to embark on another cool Node.js IoT project.  This time, we’re going to interact with the International Space Station (ISS) and track it as it flies through the sky.  We’ll eventually work with physical sensors that sit right on our desk, but at this stage we won’t need to buy parts or read resistor color codes in order to retrieve values from the ISS GPS “sensor” in the cloud—or actually 250 miles above the clouds. While our tutorials are geared toward creating awesome Node.js IoT projects on the Raspberry Pi, any Node.js-capable machine will suffice for today’s tutorial.  Other useful articles to help you may include my Beginner’s Guide to Installing Node.js Read More

Share

Node.js IoT – Data Visualization of Sensor Values

In today’s article, we’re moving beyond printing numbers in the console and creating some data visualization plots in both the terminal and in a graphical window. We’re also going to have fun!  😀 Today, I’m going to make the inductive leap that you’re making all of this happen using a Raspberry Pi. You may be able to implement these amazing ASCII terminal plots in the Windows world using Bash on Windows, but I have not tested in that context.  In addition to Raspbian, these steps will also generally work for other Linux distros as well as OS X.  If you are not running Node.js on your Raspberry Pi, please see my Beginner’s Guide to Installing Node.js Read More

Share

Node.js IoT – Create Local Module for CPU Sensor

We’re back and ready to do some refactoring of our CPU sensor so we can learn about Node.js modules and how to create them.  Building small, focused modules is one of the key tenets of the Node.js philosophy as summarized in The Node Way: Building small, single-purpose modules is at the heart of the Node.js philosophy. Borrowing from Unix, Node.js encourages composing the complex and powerful out of smaller, simpler pieces. This idea trickles down from entire applications (using the best tool for the job vs. a full suite) to how the tools themselves are built.

Share

Node.js IoT – Build a Cross Platform CPU Sensor

I took a little hiatus in our series to take my family on a trip to Japan with layovers on each end of the trip in China which included a ride on the Shanghai Maglev Train, the fastest train in the world.  We had a fantastic time, and it was a great educational experience for the kids.  It is also good to be back home! We are back again with our Node.js IoT tutorial series and ready to continue developing our “CPU sensor” as CPU loading/utilization is a “sensor” we can measure, record, and ultimately stream to other locations.  Today, we will expand our CPU sensor and make it cross platform—and learn more about Node.js in Read More

Share

Node.js Learning through Making – Build a CPU Sensor

We are back with our LTM (Learning through Making) tutorials and ready to hit the ground running and write some real Node.js code!  In this series, we will learn about Node.js in the context of creating IoT (Internet of Things) projects.  We will build a “CPU Sensor” in this first project since CPU loading/utilization is a “sensor” we can measure, record, and ultimately stream to other locations.  In future tutorials, we will harness the power of Node.js to interact with physical sensors that live outside of our computing environment.

Share

Using Visual Studio Code with a Raspberry Pi (Raspbian)

We’re back with our LTM (Learning through Making) series of Node.js tutorials and we’re gearing up and getting ready to write some code!  We’ve learned how to build a Raspberry Pi from the ground up including Node.js, we’ve created a web server in Node without code, and we’ve even managed to get this web server on the Internet as a cool trick. So how are we going to write Node.js code? There’s nothing that would stop us from simply jumping onto our RasPi and using the Leafpad text editor or even the nano console-based editor to write our code.  I propose that we use some more robust tools in the form of an IDE (Integrated Development Read More

Share

Make Your Raspberry Pi Web Server Available on the Internet with Node.js

Note: Please see my updated article entitled How to Host a Raspberry Pi Web Server on the Internet with ngrok.  The current article you are reading describes a Node module (localtunnel) which no longer works reliably. In Create a Web Server in Node without any Code, we used the http-server npm module to create a web server and serve up files in record time.  Today I will share a way you can take the web server you built and make it available beyond your local network and on the public Internet.  This is pretty cool trick, but I recommend that you use this with caution as this will open up a hole in your Read More

Share