thisdaveJ

Beginner’s Guide to Installing Node.js on a Raspberry Pi

This article has been updated to cover the installation of both Rasperry Pi OS Bullseye and the latest version of Node at the time of this writing which is Node .x. In this installment of my LTM (Learning through Making) series of Node.js tutorials, I will show you how to get Node.js up and running on a Raspberry Pi 4 (or Pi 3, or Pi 2).  I’m focusing on the Raspberry Pi 4/ Pi 3 / Pi 2 rather than older versions such as the Raspberry Pi Model B+ since these are the latest models at the time of this writing.  The Raspberry Pi 4, for example, sports a 1.5 Read More

Share
Raspberry Pi ngrok

How to Host a Raspberry Pi Web Server on the Internet with ngrok

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 cool trick, but I recommend that you use this with caution as this will open a hole in your router/firewall when you make your web server available to the world. Let’s get started!

Share

Creating a Raspberry Pi Pandora Player with Remote Web Control

In our last article, we learned how to control a Raspberry Pi from a mobile device and, as a bonus, we created a menu to make it even easier to issue commands and control our Pi. We’re back today to put that remote menu to good use because we’re building an amazing Pandora music player we can connect to a stereo in our living room, for example, without a monitor, keyboard, or mouse. Our system will include a web interface served through Node.js so we can control our Pandora player remotely from a mobile phone—all from the comfort of our couch. 🙂 Follow along with me and let’s make this happen! Read More

Share
Install Redis on a Raspberry Pi using Docker

How to install Redis on a Raspberry Pi using Docker

I’m a big fan of Redis, a fast in-memory database that persists on disk, and I’ve previously written a Guide to Using Redis with Node.js which provides a fairly comprehensive overview of using Redis from the command line and using it in conjunction with Node.js.
With the introduction of the new Stream data type in Redis 5.0, I decided it was time to get the new Redis 5.0 bits up and running on my Raspberry Pi as Redis Streams looked like it could be useful in a number of IoT scenarios.

I updated my Raspbian package list using “sudo apt update” and, much to my chagrin, the most recent version of Redis available was Redis 3.2.6 which was almost two years old. Since the Raspbian package repository follows the LTS (long term support) Debian releases, the packages available are conservative and stable, but often dated.

How did I solve this dilemma and install the latest version of Redis given the obsolescing packages housed in Raspbian repository? My ship ⛵️ came in with Docker!😀 In this article, we learn how to install Redis on a Raspberry Pi using Docker. Using Docker provides many benefits including the ability to install the latest releases of Redis long before they are available in the Raspbian package repository—without the need to compile the Redis source code ourselves.

Share
Raspberry Pi firewall

How to Set up a Firewall for Redis using ufw

Here’s the scenario: we have a Redis server running on a Raspberry Pi and we want to make it available to other machines on a network rather than just using the Redis server in a localhost context. We have already added a password to the Redis server instance; however, due to the high-performance capabilities of Redis, it is possible for outside systems to barrage it with massive number of passwords in parallel to break in. It’s time for a firewall.

In this tutorial, we will learn how to set up a firewall for Redis using ufw. The steps we describe will be useful for any Debian-based distribution such as Debian, Ubuntu, or Raspbian, and will equip you to create firewall rules for other applications too.

Share

While I napped, we got a new apt – Debian apt command cheat sheet

I’m now awake, everyone!  I must have been asleep (and perhaps you were too) since the Debian apt ecosystem now includes an “apt” binary that vastly improves the way we interact with the Debian package management ecosystem.  You can now use the single apt executable instead of apt-get, apt-cache, etc. for many common use cases.  These are groundbreaking changes for the better! My hope is that this post will accelerate your productivity whether you are using Ubuntu, Raspbian, or one of the many other other Linux distros based on Debian. Scenario: You want to install the cowsay package because you know that a Linux system is not complete without it. 🙂 Given this context, let’s get started using Read More

Share
Raspbian Lite

Create a Lightweight Raspberry Pi System with Raspbian Lite

In this tutorial, we’re going to build a highly optimized Raspberry Pi system that runs very lean on resources with the help of Raspbian Lite.  Whereas a baseline Raspbian system consumes around 158 MB of RAM, Raspbian Lite runs at a mere 34 MB.  To achieve this lighter weight footprint, we must give up the graphical user interface (GUI); however, we’ll include steps in the build (and tips) to help us work productively without a GUI. This guide follows the same flow as my popular Beginner’s Guide to Installing Node.js on a Raspberry Pi, and I recommend that you use that guide if you are a beginner or if you simply Read More

Share

Controlling a Raspberry Pi from a Mobile Device with Bonus Menu Too

In my Beginner’s Guide to Installing Node.js on a Raspberry Pi, I equipped you with the knowledge needed to build an awesome Raspberry Pi system that could also run in a headless mode. We’re able to avoid a dedicated monitor, keyboard, and mouse, and this opens a whole new world of possibilities! This brings us to today’s scenario: you’ve deployed your headless Raspberry Pi in the living room and connected it to your speaker system, soaking in the full stereo sound of your favorite music using pianobar, the console-based Pandora player. It’s eventually time for bed and you’re tired. Should you yank the power cord on your Raspberry Pi and Read More

Share

Node.js: Playing Sounds to Provide Notifications

In a previous tutorial, we learned how to send email notifications Using Nodemailer and Gmail. In today’s session, we will learn how to play sounds using Node.js. As a bonus, we will learn how to continue to play a sound until our notification has been acknowledged by pressing a key on the keyboard. How does that sound? 🙂 Enough bad puns! 🙂 Let’s get started!

Share

Upgrading to more recent versions of Node.js on the Raspberry Pi

I’ve received questions from readers of my Beginner’s Guide to Installing Node.js on a Raspberry Pi wanting to know how to upgrade to more recent versions of Node.js on the Raspberry Pi.  The steps are quite easy and can be adapted to other Debian variants as well including Ubuntu.  I’m assuming you followed the steps in my Beginners’ Guide, especially under the “Install Node.js” section where we update the Raspbian/Debian package repository to include the Node.js binaries provided by NodeSource.  Let’s get started!

Share