sam
2024-02-13 16:26:57 +01:00
5 changed files with 75 additions and 1 deletions

View File

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

View File

@@ -20,3 +20,7 @@ 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.
## 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.

View File

@@ -0,0 +1,39 @@
# 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.
**Written by Sietse**

View File

@@ -0,0 +1,22 @@
# 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.
**Written by Sietse**

View File

@@ -0,0 +1,3 @@
# Websockets
## Introduction