From c6e9258351c267b93a0282b78c7defec79d7aaed Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Sun, 28 Jun 2026 20:23:29 +0200 Subject: [PATCH] =?UTF-8?q?Rename=20config=20templates:=20.templ=20?= =?UTF-8?q?=E2=86=92=20-sim.json.tpl,=20config=5Freal.json=20=E2=86=92=20-?= =?UTF-8?q?real.json.tpl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Consistent naming: config-sim.json.tpl and config-real.json.tpl. Update README and TODO references accordingly. Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_01SH2D4LRuCnhLSzoYerAfJX --- README.md | 23 ++++++------- components/pid/TODO.md | 2 +- components/plant/TODO.md | 2 +- config-real.json.tpl | 44 ++++++++++++++++++++++++ config.json.templ => config-sim.json.tpl | 0 5 files changed, 57 insertions(+), 14 deletions(-) create mode 100644 config-real.json.tpl rename config.json.templ => config-sim.json.tpl (100%) diff --git a/README.md b/README.md index 66606e6..d271958 100644 --- a/README.md +++ b/README.md @@ -101,11 +101,12 @@ sude/ Mash schedules ("Sud" = brew/wort), each a per-step stirrer timing, and optional pause for user confirmation. -config.json.templ Configuration template - the "sim" component - names (stirrer/plant) already default to - simulation; point Stirrer/Heater at real - serial ports and plant_name at a real - backend to switch to hardware. +config-sim.json.tpl Configuration template for simulation - all + component names default to "sim"; no hardware + needed. +config-real.json.tpl Configuration template for real hardware - + real plant/heater/stirrer backends with the + correct serial ports pre-filled. web/ Browser client - static HTML/CSS/JS (no build step, no dependencies), speaking the exact @@ -217,13 +218,11 @@ pip install -r client/requirements.txt ## Running -1. Copy `config.json.templ` to `config.json` next to `brewpi.py` - it - already runs entirely in simulation (no hardware needed) as-is; switch - `stirrer_name`/`plant_name`'s `"sim"` value(s) to a real backend, and - set the corresponding serial port, to use real hardware. `plant_name` - alone picks the heater/pot/sensor trio together (see `PlantFactory`) - - `"sim"` gets `HeaterSim`/`Pot`/`TempSensorSim`, anything else gets - `HeaterHendi`/`PotReal`/`TempSensor_max31865`. +1. Copy `config-sim.json.tpl` (simulation, no hardware needed) or + `config-real.json.tpl` (real hardware) to `config.json` next to + `brewpi.py`. `plant_name` picks the heater/pot/sensor trio together + (see `PlantFactory`) - `"sim"` gets `HeaterSim`/`Pot`/`TempSensorSim`, + anything else gets `HeaterHendi`/`PotReal`/`TempSensor_max31865`. 2. Start the server: ```bash diff --git a/components/pid/TODO.md b/components/pid/TODO.md index bc62804..37d4e0c 100644 --- a/components/pid/TODO.md +++ b/components/pid/TODO.md @@ -58,7 +58,7 @@ git history for `temp_controller.py`/`temp_controller_smith.py`). schema/dataclass validation layer at config-load would surface errors immediately instead of mid-`__init__` — and would have caught the dead `TempCtrl.Kalman` / `Model.kn` / `Plant.kn` keys that used - to sit unused in `config.json.templ`/`.sim` (since deleted), and the + to sit unused in `config-sim.json.tpl`/`.sim` (since deleted), and the `Model.gain`/`Plant.gain` keys that did the same in `config.json.sim` before that file was removed entirely — `Pot` dropped `gain` entirely, see `components/plant/TODO.md`. diff --git a/components/plant/TODO.md b/components/plant/TODO.md index a4b8075..01dc6ef 100644 --- a/components/plant/TODO.md +++ b/components/plant/TODO.md @@ -24,7 +24,7 @@ the current `delay`-line rewrite of `Pot`. wired from `brewpi.py`'s `TempSensorFactory.create(..., temp_offset= -0.15, variance=0.01)`), not in the plant model. The stale `Model.kn`/`Plant.kn` keys this item flagged have since been deleted - from `config.json.templ`/`config.json.sim` too. + from `config-sim.json.tpl`/`config.json.sim` too. - [x] **`theta_amb` is hardcoded, not configured.** Fixed: added a top-level `ambient_temperature` key to `config.json`(`.templ`/`.sim`); diff --git a/config-real.json.tpl b/config-real.json.tpl new file mode 100644 index 0000000..e5f1395 --- /dev/null +++ b/config-real.json.tpl @@ -0,0 +1,44 @@ +{ + "ambient_temperature": 20, + "Controller" : { + "stirrer_name": "pololu1376", + "plant_name": "real", + "pid_type": "Smith" + }, + "TempCtrl": { + "Hold": { + "kp": 0.4, + "ki": 0.0, + "kd": 0.0, + "kt": 0.0 + }, + "Heat": { + "kp": 0.08, + "ki": 0.02, + "kd": 0.0, + "kt": 1.5 + }, + "Cool": { + "kp": 0.08, + "ki": 0.02, + "kd": 0.0, + "kt": 1.5 + }, + "Thresholds": { + "HoldHeat": 1.0, + "HoldCool": 1.0, + "HeatHold": 1.0, + "HeatCool": 1.0, + "CoolHold": 1.0, + "CoolHeat": 1.0 + } + }, + "Heater": { + "port": "/dev/ttyUSB0", + "speed": "115200" + }, + "Stirrer": { + "port": "/dev/ttyACM0", + "speed": "115200" + } +} diff --git a/config.json.templ b/config-sim.json.tpl similarity index 100% rename from config.json.templ rename to config-sim.json.tpl