vinoblock

Assembling (List)

To assemble the system we need:

Costs

Product

Price

Product

Price

Raspberry pi model 3 B+

35,30 €

Heatsink and fan pack

5,99 €

MicroSDXC Card

17,59 €

DHT22

4,20 €

MicroUSB Charger

9,99 €

LCD 16x02 Display

2,95 €

Potentiometer

2,75 €

Total

78,77 €

PoC Assembling (List)

For the PoC assemble we'll need:

Costs

Product

Price

Product

Price

Protoboard

4,50 €

Dupont wires

2,45 €

Pin headers

3,24 €

Tin welder

9,95 €

Tin

8,79 €

Total

28,93 €

PoC Assembling

The first step we should take on is to place the heatsink and the fan. To do so we unpack following parts (raspberry pi, DHT22, heatsink and fan):

 

Once we have the parts prepared to install we can install the DHT22 taking into account the following gpio pin description from https://www.raspberrypi.org/documentation/usage/gpio/ :

 

 

 

 

 

 

So we going to connect the input to pin 1, the output to pin 4 and the ground to pin 5 as follows. In our case the orange wire is the voltage input one, the red one the output pin and the brown one representing ground. In this image we can also see how we've placed the heatsinks.

 

 

Finally we have have to assemble the fan. To do so and  just for this PoC (this will change in a future assembling method as the box will be changed) we have attached it to a raspberry box as follows and we have connected its cables to pin 13 and 14:

 

To end the assembling procedure we just close the box used (remember this is just for the PoC, so no documentation of the box is given) with the 4 screws given by the provider. The final result is:

Install and init the OS

 

Download the Raspbian Stretch Lite OS as zip file from: https://www.raspberrypi.org/downloads/raspbian/  or use the following command

computer$ wget https://downloads.raspberrypi.org/raspbian_lite_latest computer$ unzip raspbian_lite_latest 

Introduce the micro sd on the computer and check its identifier:

computer$ diskutil list

Unmount the disk to prepare it for the image installation:

computer$ diskutil unmountDisk /dev/disk2

Install the latest raspbian image that you have unzipped:

 

(Extra possibility) To work directly with ssh we can create a ssh file in the boot directory and it will allow ssh connections:

 

Eject the micro sd safely:

 

Ensure that your RPi is powered off. Insert the SD card on you RPi, connect the ethernet cable and power on the device. Your RPi will boot the image. Log in the RPi with the default credential is (Alternatively you can connect directly to the raspberry pi in case you don't have access to an ethernet cable but you'll need a screen and a keyboard) :

 

The RPi needs to be configured:

  • Change the keyboard layout (if required)

    Set the timezone: required to allow a blockchain synchronisation between nodes

    Enable SSH: securely access your RPi from your computer.

 

When everything has been modified, reboot the raspberry to apply changes:

 

Finally when the system has rebooted, change the password for the user pi:

 

(Only if using Wi-Fi) Setup your Wi-Fi interface:

 

(Only if using Wi-Fi)  Change the country code to set yours and add the following lines at the end of the file:

 

When everything has been modified, reboot the raspberry to apply changes:

 

Find the private ip of your raspberry pi to connect via ssh to it.

 

Finally to change the root password we just use the following command:

 

Update apt-get

Before starting to set up everything we'll make sure we have the last version of apt-get installed by:

Install npm and nodejs

We'll also need to install the javascript npm package manager and installer:

Install git

In order to be able to clone git repositories we must install the git toolkit, to do so:

 

Install geth

To run a local node connected to the Costaflores private network an Ethereum client is necessary. In this case we'll use geth to set it up, other clients such as Parity can be used too. To install it we need to know the type of cpu we are using:

Select the geth instance you want to install from https://geth.ethereum.org/downloads/  and retrieve the package from the raspberry:

Copy the Geth application to the /usr/local/bin folder:

 

Check it was installed correctly:

 

Install node-red

To implement the front-end of the temperature dashboard we will use nodered and its dht22 contributions, to do so, firstly we must install nodered by:

 

Now that we have installed nodred we will use npm to install the dht22 contributions:

 

Finally we test it works by using:

 

Once we've checked everything is working correclty we can enable it to run on boot:

 

Install MariaDB

In order to have a working database in the raspberry pi we've selected the mariadb sql one. To install it we must:

 

Once installed we have to initialise following the instructions displayed when using:

 

Finally we can test it by using:

 

Install python3 package manager and packages

Python comes already installed in the raspbian image so we can use it directly. To work with its packages we'll install the pip3 package manager. To install it:

 

Once we have python3 and pip3 installed we have to download the following packages:

 

Install and connect to OpenVPN

In order to be able to assure secure communications between nodes, just nodes inside the VPN can connect via HTTP, to do so, we'll install openvpn:

Once we have installed openvpn, we must get the vpn config files from the admin. Once received we just have to:

 

Finally we reboot the system to enable everything we have installed.