Update webSocket message format and add classes for websockets

This commit is contained in:
Sietse Jonker
2024-03-13 14:44:32 +01:00
parent 856775c2a8
commit 6c3b523208
2 changed files with 39 additions and 3 deletions

View File

@@ -14,7 +14,43 @@ We can only use certain ports like 113, 80, 443. These are common ports and are
A solution for this is to use a reverse proxy. (See [Reverse Proxy](./Reverse-Proxy.md))
## Classes
For the websockets we are going to use 2 classes. One for the nodes and one for the websites. The nodes are going to send data to the website and have multiple variables like temperature, humidity, eCO2, TVOC and sound. The website is going to send data to the nodes like names and settings. For this they have to use a userName and password.
``` mermaid
classDiagram
client --> Website : website client
client --> Node : esp32 client
Website --> Node : settings
namespace raspberry pi clients {
class client {
+MacAdress
sendData()
}
class Node {
+eCO2
+Temperature
+Humidity
+TVOC
+Sound
+Settings
changeNodeName(name)
updateData(data)
}
class Website {
+userName
+password
changeNodeName(data)
}
}
```
#### Sources:
* https://websockets.readthedocs.io/en/stable/index.html
**Written by Sam**
**Written by Sam & Sietse**