Node.js: Sending Email Notifications Using Nodemailer and Gmail

Nodemailer

We all want to be in the loop and notified when certain events occur within our Node.js programs. For example, email notifications can be very important for creating situational awareness with IoT systems we develop that interact with our physical world. Email communication can be used to deliver messages to our inboxes as well as to deliver text messages in order to enable us to take more immediate action.

In today’s tutorial, we’ll walk through the steps of using the amazing Nodemailer package which has become the de facto standard for sending email messages in the Node.js world. Let’s get started so we can start seeing our own custom messages flow to our inbox! Continue reading

Share

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

raspi-crossover
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.

Raspberry PiHere’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. I also want to be able to get my Raspberry Pi system on the Internet. Additionally, I need my Raspberry Pi and my laptop to reside on the same network so I can easily connect and share files back and forth. Finally, I need this to be easy and foolproof so I’m not sweating on stage and trying to tweak Raspbian network configuration settings in order to establish network connectivity.

How about you? You might also have a similar need if you are seeking to get your Raspberry Pi on the Internet at a hotel, university, or other venue such as a conference. I’m going to show you how you can get your Raspberry Pi on the network when you are not connected to your home network using an Ethernet crossover cable.

I have read a lot of guides on the Internet, but they involve way too many steps. Surely there must be a better way that requires minimal fuss? Absolutely! Let’s get started! Continue reading

Share

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

IoT loggingThe 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. Continue reading

Share

Node.js IoT: Tracking the ISS through the Sky

ISS

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 on a Raspberry Pi.  You can also see my article on Using Visual Studio Code with a Raspberry Pi if you are in need of a development environment.

Let’s get started and progressively build a solution so we can track the ISS and ultimately monitor its location relative to our location on earth. Continue reading

Share