Remote Control With Node.js, React.js, and Raspberry Pi

The appearance of simple and cheap single-board computers (SBC) was a great promoting factor for the IoT world, providing a possibility to develop a wide range of control systems and devices for industrial, domestic, medical, and other usage. Now, everybody can develop stuff they need for their own needs, contribute to the development of public projects, and use products developed by others.

In this article, we are going to develop a control system to manage basic garden activities, like watering, illumination, etc. To make our application more flexible and expandable, we will develop it as a layered distributed system of loosely coupled components, communicating with each other via a standard (REST in our case) protocol. We will use well-known enterprise technologies, Node.js and React.js, and a Raspberry Pi Zero device for the sensor layer of our application.

File Server on Raspberry Pi

Having just acquired a Raspberry Pi Model 3, I am attempting to set it up as an NAS. So far I have set up the Raspberry Pi OS and configured samba. It appears to be working fine except for one minor problem. While I can remote in using TightVNC, I cannot map to any of my media folders from Windows 10 or Windows 11.

So far I have tried

  1. forcing SMB2 protocol on Pi by adding "protocol = smb2" to smb.conf
  2. enabling SMB1 in windows features

The instructions say to use "\raspberrypi\NAS" as the "browse to" folder. NAS is the name I set up in smb.conf. It asks for username/password but just responds with

2023-09-29_122752.jpg

I can browse to \10.0.0.177 or \raspberrypi and it shows my NAS share, but when I try to open NAS I just get the same error. There is probably some setting that needs to be tweaked that all the help sites I've been to are omitting because they are assuming I already know. Any suggestions will be much appreciated.

I already have file and printer sharing enabled (I can map to folders on other machines).

Setting Up a Dedicated Database Server on Raspberry Pi

There is certain gratification when you get a little “naked” mini-computer board to run the software you install on it. Maybe even your own application. Most (if not all) of the real-world applications I have implemented connect in one way or another to a database. It’s not a secret that relational databases are the most popular option in mission-critical applications that require truly ACID compliance. So, installing a good performant SQL database in a Raspberry Pi is, to say the least, a fun exercise to do. Even though the Raspberry Pi can connect to the Internet and consume a Database as a Service (DBaaS) like SkySQL, smaller applications might benefit from having a local-only database running on the same device.

In this article, I show you how to install and set up a MariaDB server on a Raspberry Pi 4 Model B with 8 GB of RAM that you can connect to your local network through WiFi or Ethernet. You can use models with much less RAM memory as well.

MQTT Messaging With Java and Raspberry Pi

In December 2021, I had the chance to write a three-post blog series for HiveMQ. They provide an MQTT compatible message broker you can install yourself, or through a cloud service they provide. That cloud service is free to connect up to 100 devices! Even for the most enthusiastic maker, that’s a lot of microcontrollers or computers! 

You can find example code for many programming languages on the HiveMQ site, but as a Java and Raspberry Pi fan, I wanted to add some extra examples. The full descriptions are available on the HiveMQ blog, so let me give you a short overview here on DZone to give you an idea of the possibilities.

Shaking Down the Raspberry Pi 400

I recently got my hands on the Raspberry Pi 400, the "$70 desktop PC," and I have now had the chance to try it out for a few days. As someone who has tinkered with Raspberry Pis since the beginning, I am always excited about new products. This one is drastically different from the others. Here are my thoughts.

What Is the Raspberry Pi 400?

How to Turn a Raspberry Pi Into a Crypto Trading Bot

This tutorial goes through the steps required to install the open-source software that deals with mining data from a crypto exchange, run backtests, and run live trading sessions. The key teaching focuses on setting up the Raspberry Pi the smart way to optimize the use of the limited resources by avoiding running the software GIU on the Pi itself, instead, providing the solution to run the GIU from a regular machine on the Local Area Network.

This Is What You'll Need

  • Raspberry Pi 2GB RAM ($40) - If you plan to run long (multi-year) backtests, you will likely need the 4GB or 8GB version (2 GB is enough for shorter backtests and trading live).
  • Flash-card, 16Gb ($7)
  • Raspberry Pi OS / Raspbian / Ubuntu ($0, open-source)
  • Node.JS ($0, open-source)
  • Git ($0, open-source)
  • Superalgos (0$, open-source)

Let's Start!

I'll assume your Raspberry is fully set up with the native OS or Ubuntu. If it's not, just follow the manufacturer's instructions.

IoT Around the House: Sensors, MongoDB, and REST API on the Onesait Platform (Part 1)

The good thing about summertime is that it gives you time for inventiveness (or maybe for boredom), so this year, I decided to carry out a personal project that I had been thinking about for some time: measuring the temperature at home.

It wasn't really the newest among ideas, or one of those world-changing ones, because a couple of years ago, I was measuring it with a Raspberry Pi and a thermometer, and displaying the information on a LCD screen. It was very cute and stuff, but there was no historical record nor could I see the information beyond that screen or anything.

How to Use the Open Source Tool Traefik to Direct Kubernetes Traffic

This tutorial will show you how to ingress traffic from external sources into a Kubernetes-Raspberry Pi cluster by using the open-source cloud-native edge router, Traefik. I’ll then detail how you can clean up Kubernetes resources afterward.

First things first, you’ll need a k3s Raspberry Pi cluster like the one I've detailed here. Your cluster will also need internet connectivity in order to access online images. All of the sample configuration and HTML files used below are available for download from GitLab.

Deep Neural Networks With OpenCV and Clojure on AWS Lambda

Learn more about Deep Neural Networks with OpenCV and Clojure

In our previous post, we managed to run a Yolo-based Deep Neural Network directly on a Raspberry Pi with object detection in semi-real-time on pictures and video streams. The processing was done locally, which is kind of optimum for a local video stream. But, it can be a little bit too power-hungry if you have a farm of these.

Here are some not-so-easy-to-get power consumption values for the Raspberry Pi. You can easily see that heavy CPU usage doubles energy consumption. In that case, a possible solution to offload processing out the Raspberry and onto servers is by using easy-to-set-up lambdas.

Raspberry Pi, OpenCV, Deep Neural Networks, and — Of Course— a Bit of Clojure

Learn more about Raspberry Pi, OpenCV, deep neural networks, and Clojure.

I had to write a simple IoT prototype recently that counted the number of people in a queue in real-time. Of course, I could have hired someone to do that and just keep counting people, or ... I could write a program in Clojure using a Raspberry Pi to detect the number of heads via a video stream.

You may also like: IoT OpenCV Scripting With Clojure on a Raspberry Pi

We learned recently that when using inlein, you can easily write scripts in Clojure with dependencies and run them just about anywhere, at a quite decent speed.

Marker Tracking via WebSockets With a Raspberry Pi

Imagine you intend to automatically move a couple of robots within a room. You need accurate position and orientation (direction frontside is pointing to) of each robot. Apparently, outdoor systems like GPS don't work and you have a small budget. What do you do?

After some research for easy-to-apply solutions, my students and I decided to visually track our robots. We put a camera at the ceiling continuously streaming a video of our robots below. What remained to be done was capturing the frames of the video stream, searching for the objects of interest inside and serving the findings.