Mandatory assignment 2 - Group 31
- Station client, randomly using UDP / TCP
- Storage server accepting UDP and TCP connections
- MongoDB for storing sensor data
- WebServer for rendering the web page displaying sensor data from MongoDB
- Frontend with some simple Javascript code for fetching data from the server.
docker-compose up
- Visit
localhost:5000
in browser - Success
- Close current running docker-compose by either interrupting the terminal or
docker-compose down
- Delete old docker images:
docker image rm web-server storage-server station -f
- Rebuild and start:
docker-compose up
- Answer
y
when asked to replace old containers
-
Run the following command in the root folder:
pip install -r requirements.txt
. -
Set up a .env file with the following variables in the web-server folder:
- APP_PORT
- MONGODB_DATABASE
- MONGODB_USERNAME
- MONGODB_PASSWORD
- MONGODB_HOSTNAME
-
Run the following command
python server.py
in the web-server folder to start the server.
- It consists of at least three Python scripts, one for each of the aforementionedprocesses.
- At least one TCP socket is used.
- At least one UDP socket is used.
- The provided script station.py is used by the weather station process to simulate the readings of weather sensors. Note that you only need to import a class from this script. You do not need to understand the code in it.
- The storage server process periodically stores data in a file or database.
- The storage server process provides remote access to the stored data.
- The FMI process(user agent) runs in a CLI and, upon request, displays all the data available in the storage server.
- [] Requests
- Flask
- Docker (and Docker Compose)
- [] SQL
- MongoDB
- A GUI