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
Upgrade Node.js Windows

Install and Upgrade Node.js on Windows the Easy Way

It’s easy to install and upgrade Node.js on the Raspberry Pi as explained in my guides on installing Node.js and upgrading Node.js on a Raspberry Pi. In fact, it’s easy on any Linux-based system. For Windows systems, however, the default installation routine of downloading and running MSI files from the Node.js website is not so streamlined. I was not keeping Node.js on my Windows systems up to date due to the activation energy required to do the installations. Today, however, everything changes. In this article, we will learn how to install and upgrade Node.js on Windows from the command line—and make the ongoing upgrade process as easy as double clicking Read More

Share
VS Code Syntax Highlighting

How to Copy Visual Studio Code with Syntax Highlighting to Other Applications

In this article, we learn how to copy from Visual Studio Code with color syntax highlighting to various other applications including Word, PowerPoint, Outlook, OneNote, and Gmail to achieve beautiful, clear code samples for documentation, presentations, and general communication. This will prove useful whether you are using JavaScript, JSON, HTML, CSS, TypeScript, Markdown, C++, Java, PHP, Python, Go, T-SQL, XML, C# or a host of other languages and data formats that Visual Studio Code supports. How is this accomplished? It’s very simple! When you are in VS Code copy your selected code to the clipboard, VS Code brings the color syntax formatting along for the ride so the formatted text Read More

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

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

Right click on Windows folder and open with Visual Studio Code

I’m all about using Visual Studio Code for Node.js development.  It is a lightweight code editor and runs on Windows, Mac OS X, and Linux.  I enjoy it so much that I also use it for Node.js projects on the Raspberry Pi.  To accomplish this, I create a Windows file share on the RasPi as described in my Beginner’s Guide to Installing Node.js on the Raspberry Pi and map a drive on my Windows system to the RasPi.  I am then able to use VS Code to create my Node.js code and jump onto the RasPi to run the actual code. Anyway, back to our regularly scheduled program…  Today’s topic is 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