Count array items in JavaScript

How to Count Unique Items in JavaScript Arrays

The fish 🐟 in our home aquarium aren’t very communicative. I don’t necessarily need them to communicate their deepest emotions, but it would be helpful if they would at least tell me when they are hungry. Believe it or not, they don’t. Alas, when I peer inside the aquarium, I don’t know if they are hungry or if someone else in the family has already fed them breakfast🍩 or dinner🍕. IoT to the rescue! I am in the process of creating a system that enables our family to log when the fish have been fed. The feeding times can be logged by pressing a push-button on a circuit board connected Read More

Share

Node.js: Sending Email Notifications Using Nodemailer and Gmail

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