Skip to content
espore complete documentation
Share
Explore

Buying the raspberry pi

You can buy the raspberry pi from you preferred hardware supplier. I’m also using a special enclosure that helps the Raspberry pi to cool. You can buy both of them from the following links (as an example)

Raspberry pi
Raspberry pi 4 case
Raspberry pi official charger
The SD card

Setting up OS

So we are going to the basics to be very very pragmatic: Raspbian OS Full:
We will have to go to the Raspberry docuentation center:
TIP: there is a video summarizing all the steps in that page
And read a little bit. By the middle of the first article, it will lead us to the Raspberry pi OS page. In my case, I’m using windows to develop all this, so I chose the appropiate Raspberry pi Imager (the raspberry pi OS installation wizard):
Loading…
By downloading the imager file (imager_1.7.1.exe in my case by the time of today), we will need to install it to start the process of installing the OS in a SD card

The SD card

We wil need an SD card to install and run the OS in the raspberry pi. I’m particularily using a 128GB Sand Disk SD card (see first section). I am using it because I will use the Raspberry pi as a data storage too.

Inserting the SD card into the raspberry pi and startup

The Raspberry pi has already been configured (I pre-configured the wifi and keyboard settings with the Raspberry pi Imager, as described in the official documentattion)

Interfacing with the raspberry pi

You can either use one of the following methods:
Using an external monitor+keyboard+mouse
Using a Virtual Network computing (VNC, which is like a monitor you can open in your windows PC and use its keyboard an mouse. You will need to have access to the raspberry pi, for example through your home wifi network or ethernet connection)
You will need VNC access enabled in your raspberry pi
Using SSH
You will need to hace SSH access enabled in the raspberry pi

Installing the server basics for the basic server implementation:

We will need the following to start everything up:
Node-red
Influx DB
Grafana

Installing Node-red

image.png
We will go to the terminal:
image.png
and type the following commands:
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
We will want node-red to start up always as a service, so as we won’t have to start it manually every time the raspberry pi boots. To do so, you only have to do the following (after the previous command finnished):
sudo systemctl enable nodered.service
And you can also start it right now if you want:
node-red-start

Installing influx DB

image.png
Let’s make sure everything is up to date:
sudo apt update sudo apt upgrade
We will then add the InfluxDB key by running the following command:
curl https://repos.influxdata.com/influxdb.key | gpg --dearmor | sudo tee /usr/share/keyrings/influxdb-archive-keyring.gpg >/dev/null
Now enter the following command to add the InfluxDB repository to the sources list. (command for raspbian)
echo "deb [signed-by=/usr/share/keyrings/influxdb-archive-keyring.gpg] https://repos.influxdata.com/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
Run the following command on your Raspberry Pi to update the package list.
sudo apt update
Now that we have set up the repository, we can now move on to installing the InfluxDB software
sudo apt install influxdb
Run the following two commands to enable InfluxDB to start at boot on your Raspberry Pi.
sudo systemctl unmask influxdb
sudo systemctl enable influxdb
Now that everything has been set up, we can now proceed to start up InfluxDB on our Raspberry Pi.
sudo systemctl start influxdb

Installing Grafana

image.png
So to install Grafana we will run the following commnad:
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
Then add the Grafana repository
echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
and install Grafana:
sudo apt-get update
sudo apt-get install -y grafana
And to make sure it will start when the raspberry pi is booted:
sudo /bin/systemctl enable grafana-server
We can now start the Grafnaa Server:
sudo /bin/systemctl start grafana-server
If you now go to both node-red interface or the grafana interface you will check if they are working properly:
http://<raspberry pi IP address or localhost>:1880 for node-red
http://<raspberry pi IP address or localhost>:3000 for grafana
For example (I am connecting the raspberry pi through my wifi network):
image.png
image.png

Installing mosquitto

image.png
Follow the instructions here:
Loading…
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.