Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c28f2db
fea: Support firmware commands via mqtt
sidey79 Dec 21, 2025
0e180da
fix: add jsonschema to requirements-dev.txt
Dec 28, 2025
d3758f2
docs: update AGENTS.md with missing dependency resolution process
Dec 28, 2025
0729506
intermediate commit
sidey79 Dec 28, 2025
cd6a62c
fix: syntax errors
Dec 29, 2025
d579f61
Merge branch 'feat/mqttBaseline' into feat/mqttCommands
Dec 29, 2025
536565e
fix: test_connection_drop.py
Dec 29, 2025
b0d90df
fix: Correct test cleanup in test_controller.py
Dec 29, 2025
8cc5295
fix: Update controller and test files for MQTT commands integration
Dec 30, 2025
2e639f1
fix(controller): Bypass STX messages during command response
Dec 30, 2025
c638eff
fix: global pytest timeout added via pytest-timeout dep
Jan 1, 2026
ff01967
feat: add node to devcontainer for mcp servers
Jan 1, 2026
1c71f06
test: fix controller tests and prevent busy loops in mock transport
Jan 1, 2026
3d7559f
feat: add uv to devcontainer for mcp servers
Jan 1, 2026
a95f795
feat: mcp server config for devcontainer
Jan 1, 2026
efd9d80
fix: limit container 4 gb ram
Jan 1, 2026
d8d8df3
feat: Add MQTT command support and CC1101 commands
Jan 1, 2026
b500c3b
fix: Ensure asyncio event loop yields in _reader_task to prevent 100%…
Jan 2, 2026
f208352
feat: Implementiere MQTT Command-Handling und Architektur-Refactoring
Jan 3, 2026
a137359
feat: ignore files from git
Jan 3, 2026
db9f6ef
docs: add references to original Perl and hardware repos
Jan 3, 2026
2ed9ad2
remove files not needed anymore
Jan 3, 2026
36708f2
feat: implement mqtt get/set frequency commands
Jan 4, 2026
c3c36c4
feat: implement mqtt commands for factory reset and settings retrieval
Jan 4, 2026
9098fb9
feat(mqtt): make req_id optional for all MQTT command payloads
Jan 4, 2026
313814e
fix: logging: suppress debug output when log-level is INFO
Jan 4, 2026
fbcf77c
feat(mqtt): add MQTT API reference to user guide
Jan 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,34 @@
{
"name": "Python 3",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:2-3-bookworm",
"dockerComposeFile": "docker-compose.yml",
"workspaceFolder": "/workspaces/PySignalduino",
"service": "devcontainer",
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
"features": {
"ghcr.io/devcontainers/features/node:1": {
"nodeGypDependencies": true,
"installYarnUsingApt": true,
"version": "lts",
"pnpmVersion": "latest",
"nvmVersion": "latest"
},
"ghcr.io/devcontainer-community/devcontainer-features/astral.sh-uv:1": {
"shellautocompletion": true,
"version": "latest"
}
//"ghcr.io/hspaans/devcontainer-features/pytest:2": {}
},

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "pip3 install --user -r requirements-dev.txt -r requirements.txt || exit 0",
"customizations": {
"vscode": {
"extensions": [
"RooVeterinaryInc.roo-cline"
]
}
},
"runArgs": ["--env-file", ".devcontainer/devcontainer.env"]

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "pip3 install --user -r requirements-dev.txt -r requirements.txt || exit 0"
}
31 changes: 31 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
services:
devcontainer:
# Build the image from the existing devcontainer setup
image: mcr.microsoft.com/devcontainers/python:3
# The current working directory is mounted automatically
volumes:
- ..:/workspaces/PySignalduino

# Use the existing settings from devcontainer.json
# Overriding the entrypoint is necessary when using a non-Compose devcontainer base image
command: /bin/bash -c "sleep infinity"

# Environment variables from .devcontainer/devcontainer.env
env_file:
- ./devcontainer.env

# This ensures services in the compose file can be reached by their service name
# The default bridge network is sufficient for this purpose

mqtt:
image: eclipse-mosquitto:latest
container_name: mosquitto-dev-broker
#ports:
# Expose port 1883 on the host, so other local clients can also connect if needed
#- "1883:1883"
volumes:
- ./mosquitto/config:/mosquitto/config
- ./mosquitto/data:/mosquitto/data
- ./mosquitto/log:/mosquitto/log
command: mosquitto -c /mosquitto/config/mosquitto.conf
restart: unless-stopped
7 changes: 7 additions & 0 deletions .devcontainer/mosquitto/config/mosquitto.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
listener 1883 0.0.0.0
allow_anonymous true

# Mosquitto Standard-Pfade
persistence true
persistence_location /mosquitto/data/
log_dest file /mosquitto/log/mosquitto.log
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ temp_repo/
SIGNALDuino-Firmware/
.devcontainer/devcontainer.env
.devcontainer/.devcontainer.env
.devcontainer/mosquitto/data/
.devcontainer/mosquitto/log/
.roo/mcp.json
1 change: 1 addition & 0 deletions .roo/mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"mcpServers":{"filesystem":{"command":"npx","args":["-y","@modelcontextprotocol/server-filesystem","/workspaces/PySignalduino"],"alwaysAllow":["edit_file","read_text_file","search_files","read_multiple_files"]},"git":{"command":"uvx","args":["mcp-server-git","--repository","/workspaces/PySignalduino"],"alwaysAllow":["git_diff_unstaged","git_checkout"]}}}
20 changes: 20 additions & 0 deletions .roomodes
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
customModes:
- slug: perlmigrator
name: PerlMigrator
roleDefinition: |-
You are a Software Architect. Your a specalized on Perl and Python.
First you plan your work and then you create the code.
The main goal is to transform the functionality from the perl project into the python project.
customInstructions: |
We have a perl project which is working as expected. Every time, when migrating code to python, the perl code and also the test results act as a master.

If converting tests you will convert the testcases on an 1:1 basis in respect to the testdata and results.
After creating a pythontest you will run it to be sure, that it passes.
groups:
- read
- edit
- browser
- command
- mcp
source: project
description: perl-2-python-architect
11 changes: 10 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,14 @@
"tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
"python.testing.pytestEnabled": true,
"vsmqtt.brokerProfiles": [
{
"name": "devmqtt",
"host": "mqtt",
"port": 1883,
"clientId": "vsmqtt_client_db93",
"savedSubscriptions": ['signalduino/v1/responses','signalduino/v1/messages','signalduino/v1/errors']
}
]
}
53 changes: 51 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ This file provides guidance to agents when working with code in this repository.
oder um eine längere Laufzeit zu analysieren:
`python3 main.py --timeout 30`

## Test Timeout Configuration
- Für pytest wurde ein globaler Timeout von 30 Sekunden in der `pyproject.toml` konfiguriert:
```toml
[tool.pytest.ini_options]
timeout = 30
```
- Die erforderliche Abhängigkeit `pytest-timeout` wurde zur `requirements-dev.txt` hinzugefügt.

## Mandatory Documentation and Test Maintenance

Diese Richtlinie gilt für alle AI-Agenten, die Code oder Systemkonfigurationen in diesem Repository ändern. Jede Änderung **muss** eine vollständige Analyse der Auswirkungen auf die zugehörige Dokumentation und die Testsuite umfassen.
Expand Down Expand Up @@ -83,7 +91,7 @@ Dieser Abschnitt definiert den verbindlichen Arbeitsablauf für die Entwicklung
- Aufteilung in konkrete Arbeitspakete (Tasks)
- Definition von Akzeptanzkriterien für jede Komponente
- Planung von Teststrategien (Unit, Integration, System)
- Ressourcen- und Zeitplanung
- Ressourcen- und Zeitplaning
- Erstellung von Mockups/Prototypen für kritische Pfade
- **Deliverables:**
- Implementierungsplan mit Task-Breakdown
Expand Down Expand Up @@ -243,4 +251,45 @@ flowchart TD

Dieser Architecture-First Development Process ist für **alle** neuen Funktionen und wesentlichen Änderungen verbindlich. Ausnahmen sind nur bei kritischen Bugfixes erlaubt und müssen durch einen Emergency-ADR dokumentiert werden. Jede Abweichung vom Prozess muss vom Architecture Owner genehmigt werden.

Die Einhaltung dieses Prozesses gewährleistet, dass Design-Entscheidungen bewusst getroffen, dokumentiert und nachvollziehbar sind, was die langfristige Wartbarkeit, Skalierbarkeit und Qualität des PySignalduino-Projekts sicherstellt.
Die Einhaltung dieses Prozesses gewährleistet, dass Design-Entscheidungen bewusst getroffen, dokumentiert und nachvollziehbar sind, was die langfristige Wartbarkeit, Skalierbarkeit und Qualität des PySignalduino-Projekts sicherstellt.

## Fehlerbehebungsprozess
### Problemidentifikation
1. **Symptom:** ImportError oder ModuleNotFoundError während der Testausführung
2. **Ursachenanalyse:**
- Überprüfen der Traceback-Meldung auf fehlende Module
- Vergleich mit requirements.txt und requirements-dev.txt
- Prüfen der Dokumentation auf Installationsanweisungen

### Lösungsimplementierung (Abhängigkeiten)
1. **requirements-dev.txt aktualisieren:**
- Modulname zur Datei hinzufügen
- Commit mit Conventional Commits Syntax erstellen (z.B. "fix: add <module> to requirements-dev.txt")
2. **Dokumentation prüfen:**
- Sicherstellen, dass Installationsanweisungen in README.md und docs/ aktuell sind

### Problemidentifikation (Hohe CPU-Last im Parser)
1. **Symptom:** Anhaltende 100% CPU-Auslastung auf einem oder mehreren Kernen während des Parsens von MU/MC-Nachrichten.
2. **Ursachenanalyse:**
- **Parser-Architektur prüfen:** Der gesamte Parservorgang sollte in [`signalduino/controller.py`](signalduino/controller.py) über `asyncio.to_thread` abgewickelt werden.
- **Protokoll-Ineffizienz:** Die synchrone Demodulationsschleife in [`sd_protocols/message_unsynced.py`](sd_protocols/message_unsynced.py) oder [`sd_protocols/manchester.py`](sd_protocols/manchester.py) blockiert den Worker-Thread zu lange.
3. **Validierung:** Temporäres Hinzufügen von Zeit-Logging (z.B. mit `time.perf_counter()`) in der Protokollschleife in `demodulate_mu` zur Identifizierung des blockierenden Protokolls.

### Lösungsimplementierung (Parser-Performance)
1. **Backtracking-Hölle vermeiden:** Wenn ein Protokoll eine sehr lange Demodulationszeit (z.B. > 10ms) aufweist, liegt wahrscheinlich ein Catastrophic Backtracking in einem regulären Ausdruck vor.
2 **Deaktivierung inaktiver Protokolle:** Die `active`-Prüfung in `demodulate_mu` sollte verwendet werden, um inaktive Protokolle auszuschließen.

### Verifikation
1. **Installation testen:**
```bash
pip install -r requirements-dev.txt
pytest
```
2. **Tests erneut ausführen:**
```bash
timeout 60 pytest ./tests/
```

### Dokumentation
- **AGENTS.md aktualisieren:** Diese Prozessbeschreibung hinzufügen
- **Commit erstellen:** Änderungen mit aussagekräftiger Nachricht committen
3 changes: 2 additions & 1 deletion docs/01_user_guide/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,5 @@ Für einen schnellen Einstieg folgen Sie diesen Schritten:
Ausführliche Anleitungen finden Sie in den folgenden Kapiteln.

include::installation.adoc[]
include::usage.adoc[]
include::usage.adoc[]
include::mqtt_api.adoc[]
Loading
Loading