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 – 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

Create a Web Server in Node without any Code

Welcome back!  In a previous tutorial (Beginners Guide to Installing Node.js on a Raspberry Pi), we installed Node.js on a Raspberry Pi. We are now ready to continue our LTM (Learning through Making) tutorial series and build a simple web server without any code.  While this tutorial is geared toward the RasPi, the instructions can be easily mapped over to other platforms such as Windows, Linux, and OS X.  Let’s get started!

Share

Solution for Can’t Ping Raspberry Pi Hostname on the Network

In preparing for my upcoming tutorial which is a beginner’s guide to installing Node.js on a Raspberry Pi 2, I ran into an issue. After getting the RasPi is up and running on the network, I was not able to ping its hostname (raspberrypi, by default) from another machine and find it so I could connect to it through Putty, xrdp, VNC, etc.  After all, I wanted to be able to run headless and disconnect the monitor, USB keyboard/mouse, and still connect to it from another machine on my network. One option was to run ifconfig on the RasPi and take note of the IP address for eth0 (if connected through Ethernet) or wlan0 Read More

Share