From 19d1e965fa1f374e5d8986794363ef0b15ffe350 Mon Sep 17 00:00:00 2001 From: StetterAme77 Date: Thu, 27 Mar 2025 11:40:19 +0100 Subject: [PATCH 1/5] First commit as test --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 75d528d..946c6b9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +# Test Push Info :) + # CO2 Ampel *CO2 Ampel* is an open-source project, written in C++ for [ESP8266](https://en.wikipedia.org/wiki/ESP8266) or [ESP32](https://en.wikipedia.org/wiki/ESP32). -- GitLab From 285206674d9e81dda9a491ce0c717f605635c6de Mon Sep 17 00:00:00 2001 From: 21meaa1bif <21meaa1bif@hft-stuttgart.de> Date: Thu, 27 Mar 2025 11:40:54 +0100 Subject: [PATCH 2/5] important rework of the readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 75d528d..7d7aeae 100644 --- a/README.md +++ b/README.md @@ -150,3 +150,6 @@ The commands can be sent via the Serial interface, from the webpage or via MQTT. Copyright © 2022, [HfT Stuttgart](https://www.hft-stuttgart.de/) [GPLv3](https://choosealicense.com/licenses/gpl-3.0/) + + +I was here -- GitLab From 771c266caf0a98e25bf684fc8fa746906307ca44 Mon Sep 17 00:00:00 2001 From: StetterAme77 Date: Thu, 27 Mar 2025 12:32:18 +0100 Subject: [PATCH 3/5] Info in README for Clockify and Overleaf Latex workspace --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 946c6b9..e174a29 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,13 @@ -# Test Push Info :) +# Additions during and by workgroup of pervasive computing + +## Time Tracking + +Using [Clockify](https://app.clockify.me/reports/team/assignments?start=2025-03-17T00:00:00.000Z&end=2025-03-23T23:59:59.999Z&filterValuesData=%7B%22users%22:%5B%5D,%22userGroups%22:%5B%5D,%22userAndGroup%22:%5B%5D%7D&exclude=userAndGroup&filterOptions=%7B%22userAndGroup%22:%7B%22status%22:%22ACTIVE_WITH_PENDING%22%7D%7D) + +## Documentation + +[Collaborative Overleaf Workspace](https://www.overleaf.com/9412988731xxctbwxqmmtk#af08f3) + # CO2 Ampel -- GitLab From 584be588be827b7556ce174da91e406679a4d75b Mon Sep 17 00:00:00 2001 From: StetterAme77 Date: Thu, 10 Apr 2025 09:43:46 +0200 Subject: [PATCH 4/5] Config.h testing and connection to MQTT Server --- README.md | 3 ++- ampel-firmware/mqtt.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e174a29..84165e4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -# Additions during and by workgroup of pervasive computing +# Additions by pervasive computing workgroup + ## Time Tracking diff --git a/ampel-firmware/mqtt.cpp b/ampel-firmware/mqtt.cpp index ddb1084..80a7f5b 100644 --- a/ampel-firmware/mqtt.cpp +++ b/ampel-firmware/mqtt.cpp @@ -39,7 +39,7 @@ namespace mqtt { void initialize(const char *sensorId) { json_sensor_format = PSTR("{\"time\":\"%s\", \"co2\":%d, \"temp\":%.1f, \"rh\":%.1f}"); - snprintf(publish_topic, sizeof(publish_topic), "%s%s", config::mqtt_topic_prefix, sensorId); + snprintf(publish_topic, sizeof(publish_topic), "%s%s", config::mqtt_topic_prefix, sensorId); //TODO if (config::mqtt_encryption) { // The sensor doesn't check the fingerprint of the MQTT broker, because otherwise this fingerprint should be updated -- GitLab From ed5249d5c030f8372c3bb3556d23145280f736cf Mon Sep 17 00:00:00 2001 From: Stetter <22stmo1bif@hft-stuttgart.de> Date: Fri, 27 Jun 2025 19:58:56 +0000 Subject: [PATCH 5/5] Update README.md --- README.md | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 65 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c5b76fc..599840d 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,75 @@ # Additions by pervasive computing workgroup -## Time Tracking -Using [Clockify](https://app.clockify.me/reports/team/assignments?start=2025-03-17T00:00:00.000Z&end=2025-03-23T23:59:59.999Z&filterValuesData=%7B%22users%22:%5B%5D,%22userGroups%22:%5B%5D,%22userAndGroup%22:%5B%5D%7D&exclude=userAndGroup&filterOptions=%7B%22userAndGroup%22:%7B%22status%22:%22ACTIVE_WITH_PENDING%22%7D%7D) +## Anleitung -## Documentation +- **Frontend + Backend:** + [co2ampel2 / Web · GitLab](https://transfer.hft-stuttgart.de/gitlab/co2ampel2/web) -[Collaborative Overleaf Workspace](https://www.overleaf.com/9412988731xxctbwxqmmtk#af08f3) +- **Firmware:** + [co2ampel2 / co2-ampel · GitLab](https://transfer.hft-stuttgart.de/gitlab/co2ampel2/co-2-ampel) +> **Hinweis:** In der `Config.h` Datei die WLAN-Zugangsdaten und die korrekte Adresse der Ampel anpassen. +Frontend und Backend laufen nun – allerdings ist **InfluxDB noch nicht korrekt mit dem Django-Ninja-Backend verbunden**, da API-Calls auf InfluxDB-Daten **nicht authentifiziert** sind. +Bei Problemen mit dem flashen erstmal schauen ob richtige CH340/CH341 Treiber installiert sind. !!! +## Projekt starten + +```bash +docker-compose up --build +``` +## InfluxDB einrichten + +1. Öffne InfluxDB im Browser: + [http://localhost:8086/signin](http://localhost:8086/signin) - oder Server URL und entsprechender Port + +2. Melde dich an mit: + + - **Username:** `admin` + + - **Password:** `password` + +3. Token generieren: + + - Klicke auf **Python**: + ![[Pasted image 20250627200456.png]] + + - Klicke dann auf **"Get Token"**: + ![[Pasted image 20250627200618.png]] + +4. Token kopieren und in der Datei `.env.docker` im Verzeichnis `backend` **ersetzen**. + +5. Container neu starten: + + +```bash +docker-compose down +docker-compose up --build +``` + +--- + +## Testdaten generieren (für Entwicklung) + +1. Ins Daten-Generator-Verzeichnis wechseln: +```bash +cd data_generation +``` + +2. Virtuelle Umgebung einrichten: +```bash +uv sync +``` + +3. Umgebung aktivieren: +```bash +source .venv/bin/activate +``` + +4. Skript starten: +```bash +python main.py +``` # CO2 Ampel -- GitLab