Merge branch 'main' of gitlab.fdmci.hva.nl:propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59
This commit is contained in:
@@ -25,58 +25,59 @@ At the lowest level of our system we are showing how the software is designed. T
|
||||
``` mermaid
|
||||
classDiagram
|
||||
|
||||
Node --> Raspberry pi : Websocket
|
||||
Raspberry pi --> Website : getData
|
||||
Raspberry pi <--> EnqueteNode : Websocket
|
||||
Node --> Raspberry pi : Websocket
|
||||
Raspberry pi --> Website : getData
|
||||
Raspberry pi <--> EnqueteNode : Websocket
|
||||
|
||||
namespace Server {
|
||||
class Raspberry pi {
|
||||
+MariaDB
|
||||
+Apache2
|
||||
+Python
|
||||
Database()
|
||||
Webserver()
|
||||
Websocket()
|
||||
|
||||
}
|
||||
class Node {
|
||||
+Co2
|
||||
+Temperature
|
||||
+Humidity
|
||||
+Tfok
|
||||
+Sound
|
||||
collectData()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
namespace User {
|
||||
class Website {
|
||||
+Co2
|
||||
+Temperature
|
||||
+Humidity
|
||||
+Tfok
|
||||
+Sound
|
||||
+Graph
|
||||
+Map
|
||||
+Settings
|
||||
GetData()
|
||||
}
|
||||
class EnqueteNode {
|
||||
+Co2
|
||||
+Temperature
|
||||
+Humidity
|
||||
+Tfok
|
||||
+Sound
|
||||
+Graph
|
||||
+Map
|
||||
+QuestionResponse
|
||||
EnqueteDisplay()
|
||||
EnqueteButtons()
|
||||
GetData()
|
||||
namespace Server {
|
||||
class Raspberry pi {
|
||||
+MariaDB
|
||||
+Apache2
|
||||
+Python
|
||||
Database()
|
||||
Webserver()
|
||||
Websocket()
|
||||
|
||||
}
|
||||
class Node {
|
||||
+Co2
|
||||
+Temperature
|
||||
+Humidity
|
||||
+Tfok
|
||||
+Sound
|
||||
collectData()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
namespace User {
|
||||
class Website {
|
||||
+Co2
|
||||
+Temperature
|
||||
+Humidity
|
||||
+Tfok
|
||||
+Sound
|
||||
+Graph
|
||||
+Map
|
||||
+Settings
|
||||
GetData()
|
||||
}
|
||||
|
||||
class EnqueteNode {
|
||||
+Co2
|
||||
+Temperature
|
||||
+Humidity
|
||||
+Tfok
|
||||
+Sound
|
||||
+Graph
|
||||
+Map
|
||||
+QuestionResponse
|
||||
EnqueteDisplay()
|
||||
EnqueteButtons()
|
||||
GetData()
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
```
|
@@ -5,9 +5,12 @@ The data we collected originated from live "nodes" which were small boxes equipp
|
||||
|
||||
This collected data needed to be transmitted to a database to facilitate its presentation on a website we were developing. The website would retrieve the data from the database and display it in various formats.
|
||||
|
||||
Given the critical nature of this data connection for our project, it was imperative that it functioned reliably. Bram was tasked with designing a connection in Python between the WebSocket (live server) and the database (data storage).
|
||||
This is what the connection would be inserted.
|
||||

|
||||
|
||||
Since we had the WebSocket data on a Raspberry Pi, it made sense to implement the connection on the Pi itself. This presented an opportunity for Bram to acquire knowledge about Python, considering he initially lacked experience with this programming language.
|
||||
Given the high demand of this data connection for our project, it was imprtant that it was reliably. Bram was given the task to designing a connection in Python between the WebSocket (live server) and the database (data storage).
|
||||
|
||||
Since we had the WebSocket data on a Raspberry Pi, it made sense to make the connection on the Pi itself. This became an opportunity for Bram to gain knowledge about Python, considering he originaly didn't have experience with this programming language.
|
||||
## Python code + explaination
|
||||
In the given Raspberry Pi, a file named "data.py" was created, from which this script could be called when needed.
|
||||
|
||||
@@ -68,7 +71,6 @@ The MAC address is then taken and turned into a tuple. This is done because the
|
||||
#make a tuple of the MAC by placing a comma.
|
||||
MACTuple = (processedMAC,)
|
||||
```
|
||||
|
||||
Coming back to the previous lines of code, the data which was first asked for is now gathered and put into an array.
|
||||
|
||||
This array is then examined, and all the data is compared to the newly obtained MAC address.
|
||||
|
BIN
docs/rpi-documentation/MyConnection.png
Normal file
BIN
docs/rpi-documentation/MyConnection.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
Reference in New Issue
Block a user