From 3e112a8e783694766323e8b9d102471cc4b53a4b Mon Sep 17 00:00:00 2001 From: Dano van den Bosch Date: Tue, 13 Feb 2024 15:46:09 +0100 Subject: [PATCH 1/5] Added raspberry py documentation --- .../InfrastructuurDocumentatie/raspberryPi.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/Sp1SchetsProject/InfrastructuurDocumentatie/raspberryPi.md b/docs/Sp1SchetsProject/InfrastructuurDocumentatie/raspberryPi.md index 35d3b94..21899c4 100644 --- a/docs/Sp1SchetsProject/InfrastructuurDocumentatie/raspberryPi.md +++ b/docs/Sp1SchetsProject/InfrastructuurDocumentatie/raspberryPi.md @@ -10,8 +10,14 @@ ##Introduction +The backend of this project there is a raspberry pi 3 for handeling the dev page (more on this later) and the database. The Esp nodes are going to send a api request to the dev page wich is going to make a POST request to the database. + ##Rasberry Pi +The Raspberry 3 can be descriped as a "little" computer running a quad-code 64-bit prossesor, the previus Raspberry witch is 50% slower than this one + +The Raspberry Pi 3 is equipped with a quad-core 64-bit Broadcom BCM2837 ARM Cortex-A53 SoC processor running at 1.2 GHz, making it about 50% more powerful than the Pi 2. + ###Dev Page ##Database From 41b159f6c5fb261fb9e22ed7c62afb321389ea17 Mon Sep 17 00:00:00 2001 From: Sietse Jonker Date: Tue, 13 Feb 2024 16:21:06 +0100 Subject: [PATCH 2/5] adds documentation on how to install mariadb on rpi --- .../rpi-documentation/mariadb-installation.md | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 docs/rpi-documentation/mariadb-installation.md diff --git a/docs/rpi-documentation/mariadb-installation.md b/docs/rpi-documentation/mariadb-installation.md new file mode 100644 index 0000000..85f2e0a --- /dev/null +++ b/docs/rpi-documentation/mariadb-installation.md @@ -0,0 +1,37 @@ +# Mariadb + +First we have to install the package. This is done by running the following command: + +```bash +$ sudo apt install mariadb-server +``` + +Now the raspberry pi will download the package and install it. After the installation is done, we have to secure the installation. This is done by running the following command: + +```bash +$ sudo mysql_secure_installation +``` + +This will ask you a couple of questions. The first question is if you want to set a password for the root user. We chose not to because we are the only ones that have access to the raspberry pi. The second question is if you want to remove the anonymous user. We chose to remove the anonymous user. The third question is if you want to disallow root login remotely. We chose NOT to disallow root login remotely, otherwise we wouldn't be able to login to the database remotely anymore. The fourth question is if you want to remove the test database. We chose yes because we made our own database. The fifth question is if you want to reload the privilege tables now. We chose yes, because we want to apply the changes we made. + +Now the installation is done and the database is secured. Now we can start using the database. + +# Create a database + +First we have to login to the database. This is done by running the following command: + +```bash +$ sudo mysql -u root +``` + +Now we are logged in to the database. We have created our database by using the forward engineer function of MySQL workbench and then exporting the sql file to the raspberry pi. + +# Create a user + +We have to create a user for the database. This is done by running the following command: + +```sql +GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION; +``` + +Replace username with the username you want to use and password with the password you want to use. This will create a user with all privileges on all databases. If you want to create a user with less privileges you can change the ALL PRIVILEGES to the privileges you want to give the user. We chose to give the user all privileges to make it easy for us to use the database. \ No newline at end of file From 25bb4d0f7b766682e623bc637ad5de8bfcfffa15 Mon Sep 17 00:00:00 2001 From: Sietse Jonker Date: Tue, 13 Feb 2024 16:21:25 +0100 Subject: [PATCH 3/5] adds documentation on how to install phpmyadmin on rpi --- .../phpmyadmin-installation.md | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 docs/rpi-documentation/phpmyadmin-installation.md diff --git a/docs/rpi-documentation/phpmyadmin-installation.md b/docs/rpi-documentation/phpmyadmin-installation.md new file mode 100644 index 0000000..6a5e073 --- /dev/null +++ b/docs/rpi-documentation/phpmyadmin-installation.md @@ -0,0 +1,20 @@ +# PHPMyAdmin + +## Installation + +```bash +$ sudo apt install phpmyadmin +``` + +The raspberry pi will download the package and install it. It will also ask a few questions. For the first question we selected the “apache2” option by pressing SPACE and then ENTER. Then it will ask us to configure the database using dbconfig-common, we selected “yes” and then pressed ENTER. Then it will ask us for the password of the root user of the database, we entered the password and then pressed ENTER. Then it will ask us to enter a password for the phpmyadmin application, we entered the password and then pressed ENTER. Then it will ask us to confirm the password, we entered the password again and then pressed ENTER. After this the installation is done and we can start using phpmyadmin. + +## Usage + +To use phpmyadmin we have to go to the following url in our browser: http://(ip adress of your pi)/phpmyadmin. This will open the phpmyadmin login page. We can login using the root user and the password we entered during the installation. After we have logged in we can start using the database. + +This didnt work for us, we first had to run this command on hte raspberry pi: +```bash +$ sudo apt install php +``` + +After this we could use phpmyadmin, access the database we've created and start using it. From 4cc7c2fa8b1f57b82efbd5fa29e8322fc68df957 Mon Sep 17 00:00:00 2001 From: Sietse Jonker Date: Tue, 13 Feb 2024 16:24:02 +0100 Subject: [PATCH 4/5] Add node power information and author details --- docs/node-documentation/node-sensors.md | 6 +++++- docs/rpi-documentation/mariadb-installation.md | 4 +++- docs/rpi-documentation/phpmyadmin-installation.md | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/node-documentation/node-sensors.md b/docs/node-documentation/node-sensors.md index df55b5b..f654fa3 100644 --- a/docs/node-documentation/node-sensors.md +++ b/docs/node-documentation/node-sensors.md @@ -19,4 +19,8 @@ We chose these sensors because they are cheap to buy and don't require a lot of ## Appearance of the nodes -Every node has the sensors listed above. The also have a little oled screen to display the current situation in the environment. This is used to show the current temperature, humidity, eCO2, TVOC. Next to it is also a little led matrix which will show the current sound level. \ No newline at end of file +Every node has the sensors listed above. The also have a little oled screen to display the current situation in the environment. This is used to show the current temperature, humidity, eCO2, TVOC. Next to it is also a little led matrix which will show the current sound level. + +## Power + +The nodes are powered by 2 lithium batteries. They will be removable to charge them. We might consider using double A batteries, but we are not sure yet, since lithium batteries are more powerful, last longer and AA batteries are not rechargeable, and we want to make the nodes as sustainable as possible. \ No newline at end of file diff --git a/docs/rpi-documentation/mariadb-installation.md b/docs/rpi-documentation/mariadb-installation.md index 85f2e0a..b561b6b 100644 --- a/docs/rpi-documentation/mariadb-installation.md +++ b/docs/rpi-documentation/mariadb-installation.md @@ -34,4 +34,6 @@ We have to create a user for the database. This is done by running the following GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION; ``` -Replace username with the username you want to use and password with the password you want to use. This will create a user with all privileges on all databases. If you want to create a user with less privileges you can change the ALL PRIVILEGES to the privileges you want to give the user. We chose to give the user all privileges to make it easy for us to use the database. \ No newline at end of file +Replace username with the username you want to use and password with the password you want to use. This will create a user with all privileges on all databases. If you want to create a user with less privileges you can change the ALL PRIVILEGES to the privileges you want to give the user. We chose to give the user all privileges to make it easy for us to use the database. + +**Written by Sietse** \ No newline at end of file diff --git a/docs/rpi-documentation/phpmyadmin-installation.md b/docs/rpi-documentation/phpmyadmin-installation.md index 6a5e073..0b4d7ae 100644 --- a/docs/rpi-documentation/phpmyadmin-installation.md +++ b/docs/rpi-documentation/phpmyadmin-installation.md @@ -18,3 +18,5 @@ $ sudo apt install php ``` After this we could use phpmyadmin, access the database we've created and start using it. + +**Written by Sietse** \ No newline at end of file From eb64ad653b9c1e5e0ff299adfa4fcdad3033a54f Mon Sep 17 00:00:00 2001 From: Sietse Jonker Date: Tue, 13 Feb 2024 16:26:08 +0100 Subject: [PATCH 5/5] adds websocket docu to rpi docu --- docs/rpi-documentation/websockets.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 docs/rpi-documentation/websockets.md diff --git a/docs/rpi-documentation/websockets.md b/docs/rpi-documentation/websockets.md new file mode 100644 index 0000000..ff80e29 --- /dev/null +++ b/docs/rpi-documentation/websockets.md @@ -0,0 +1,3 @@ +# Websockets + +## Introduction \ No newline at end of file