6.3 KiB
0005-DenryokuBancho / 電力番長 (Denryoku Banchō)
電力番長 (Denryoku Banchō) is a Linux-native CLI fork of the MightyWatt electronic load project by Jakub Polonský (kaktus85). It is focused on headless operation, automation pipelines, CSV logging, and JSON-driven test sequences, built to run lean on SBC hardware.
This repository is intentionally backend-first. The goal is to provide a practical Linux control and automation path for MightyWatt hardware before building a GTK frontend on top of it.
Attribution and upstream
This project builds on the original MightyWatt work by Jakub Polonský (kaktus85) back in 2014 to 2017. I own on MightyWatt since 2016.
Jakub designed the MightyWatt hardware and created the original Arduino firmware and Windows control program. Many thanks to him for publishing such a useful open hardware / software project.
Original upstream project:
Please also see:
NOTICE.mdLICENSE
Current release status
Beta 0.1 - Scope:
This beta provides a usable Linux-native backend and CLI for real MightyWatt hardware, with emphasis on:
- serial communication from Linux
- headless bench operation
- watchdog-safe sustained load control
- CSV logging
- raw CSV export for spreadsheet workflows
- JSON-driven automated test sequences
- loop-based sequence execution for repeated test patterns
Already validated on real my real hardware
- device identification and capability query
- measurement readout
- manual CLI control
- watchdog-safe
holdoperation - CSV logging
- sequence execution on real hardware
- raw CSV export mode
Implemented but still beta-level
repeatrepeat_untilrepeat_while- inherited
break_if - mandatory
abort_sequence - nested sequence blocks
- controller/backend layering for later GUI reuse
The backend is useful now, but the sequence engine should still be treated as bench-validated step by step, not as a finished production automation framework.
Deliberately not the focus of this release
- GTK4 frontend
- persistent settings store
- profile editor GUI
- plotting GUI
Repository layout
include/
mightywatt.h
mightywatt_app.h
mightywatt_controller.h
mightywatt_log.h
mightywatt_sequence.h
src/
mightywatt.c low-level protocol + serial transport
mightywatt_app.c synchronous backend layer
mightywatt_controller.c long-running controller/polling layer
mightywatt_log.c CSV logger
mightywatt_sequence.c JSON sequence engine
mwcli.c CLI frontend
examples/
*.json sequence examples
mw_controller_example.c controller example
Layering
mightywatt.c= raw device communicationmightywatt_app.c= safe synchronous operationsmightywatt_controller.c= GUI-ready async/controller layermightywatt_sequence.c= reusable sequence engine on top of the backendmwcli.c= thin user-facing CLI
This keeps a future GTK frontend from reimplementing protocol or automation logic.
Build
Requirements:
- Linux
- GCC or Clang
- POSIX serial/thread support
- no external runtime dependencies for the current CLI/backend build
Build:
make
This builds:
mwclimw_controller_example
Typical CLI usage
Read capabilities:
./mwcli -d /dev/ttyACM0 caps
Read one measurement:
./mwcli -d /dev/ttyACM0 report
Hold a constant current safely against the watchdog:
./mwcli -d /dev/ttyACM0 hold current 0.250 --interval-ms 500
Run a sequence and log CSV:
./mwcli -d /dev/ttyACM0 --csv run.csv run-sequence examples/quick_cc_test.json
Run a sequence with raw CSV output for spreadsheet import:
./mwcli -d /dev/ttyACM0 --csv run_raw.csv --csv-raw run-sequence examples/repeat_until_cutoff.json
Sequence engine overview
Current sequence engine features:
- linear step execution
holdhold_until- ramps
repeatrepeat_untilrepeat_while- per-step and per-block
break_if - mandatory
abort_sequence - CSV logging during polling/report events
The format is JSON only in the current implementation.
See:
HELP.mdsequence_examples.mdexamples/*.json
Safety model
There are three layers of protection:
-
Sequence safety limits
- max voltage
- max current
- max power
-
break_ifconditions- especially useful for thermal guard behaviour
- also usable for voltage/current/power-based aborts
-
Mandatory
abort_sequence- runs at the normal end of a sequence
- also runs after runtime abort paths whenever possible
- should usually contain at least:
"abort_sequence": [
{ "action": "safe" }
]
Practical note:
- if the serial/device link is already gone, the backend will still attempt the abort sequence, but that can of course fail physically
Documentation files
HELP.md— CLI help and full JSON format referencesequence_examples.md— practical example overviewexamples/*.json— ready-to-edit starting profilesNOTICE.md— attribution and upstream note
Known limitations
- no YAML parser yet
- no
validate-sequenceor dry-run command yet - no explicit boolean condition combiner (
AND/OR) yet - no profile include/import system
- no persistence layer for CLI settings
- no active GUI in this beta release
- loop timing is not hard real-time; it depends on polling interval and serial turnaround
Also important:
sample_period_msis the visible/logging interval, not the low-level keepalive interval- loop-heavy profiles should still be validated carefully on the bench before trusting them unattended
License
This repository is released under the GNU GPL v3.
The original upstream MightyWatt repository contains its own license files for its original contents. Review the upstream repository for the exact license structure of the original project components.