Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

## [Unreleased]

### victron_mqtt 1.2.1

The manifest declares `R/+/keepalive` in `mqtt_read_request_topics`, so the
keep-alive 1.2.0 sends can reach a GX from the signed channel. Before, the
channel's guard and FTW refused every publish from this read-only driver,
and the GX went quiet 60 s after the last keep-alive from anyone.

The channel's guard now lets the driver publish to that topic alone, with at
most 1 KiB of payload, and an FTW Core with srcfl/ftw#2071 allows six such
requests a minute. Every other publish is still refused. A read request is
not a write, so the driver still holds only `mqtt.subscribe`. The Lua source
is unchanged.

A Core without srcfl/ftw#2071 runs this version as it runs 1.2.0: it refuses
the keep-alive, the driver logs one warning and keeps reading, and the GX
publishes only while another client keeps it awake. Not yet checked on a
real GX.

### alphaess 1.3.0, kstar 1.3.0

Both drivers read the registers their vendor's own Modbus map gives
Expand Down
4 changes: 2 additions & 2 deletions SUPPORT_STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ Catalog source is not proof that a target can install or run a driver.
| varta | 1.1.2 | blixt-l1 | not_assessed | — | not_recorded | not_assessed |
| victron | 2.2.1 | ftw-core | not_assessed | — | not_recorded | not_assessed |
| victron | 2.2.1 | blixt-l1 | not_assessed | — | not_recorded | not_assessed |
| victron_mqtt | 1.2.0 | ftw-core | not_assessed | — | not_recorded | not_assessed |
| victron_mqtt | 1.2.0 | blixt-l1 | not_assessed | — | not_recorded | not_assessed |
| victron_mqtt | 1.2.1 | ftw-core | not_assessed | — | not_recorded | not_assessed |
| victron_mqtt | 1.2.1 | blixt-l1 | not_assessed | — | not_recorded | not_assessed |
| wallbox | 1.1.0 | ftw-core | not_assessed | — | not_recorded | not_assessed |
| wallbox | 1.1.0 | blixt-l1 | not_assessed | — | not_recorded | not_assessed |
| zap | 3.2.0 | ftw-core | not_assessed | — | not_recorded | not_assessed |
Expand Down
10 changes: 5 additions & 5 deletions devices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2011,7 +2011,7 @@ manufacturers:
control: false
- protocol: mqtt
driver: "victron_mqtt"
version: "1.2.0"
version: "1.2.1"
ders: [pv, battery, meter]
control: false
firmware_versions: ""
Expand All @@ -2027,7 +2027,7 @@ manufacturers:
control: false
- protocol: mqtt
driver: "victron_mqtt"
version: "1.2.0"
version: "1.2.1"
ders: [pv, battery, meter]
control: false
firmware_versions: ""
Expand All @@ -2043,7 +2043,7 @@ manufacturers:
control: false
- protocol: mqtt
driver: "victron_mqtt"
version: "1.2.0"
version: "1.2.1"
ders: [pv, battery, meter]
control: false
firmware_versions: ""
Expand All @@ -2059,7 +2059,7 @@ manufacturers:
control: false
- protocol: mqtt
driver: "victron_mqtt"
version: "1.2.0"
version: "1.2.1"
ders: [pv, battery, meter]
control: false
firmware_versions: ""
Expand All @@ -2075,7 +2075,7 @@ manufacturers:
control: false
- protocol: mqtt
driver: "victron_mqtt"
version: "1.2.0"
version: "1.2.1"
ders: [pv, battery, meter]
control: false
firmware_versions: ""
Expand Down
28 changes: 28 additions & 0 deletions docs/WRITING-A-DRIVER.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,34 @@ make refused-write-report ID=example
`refused-write-baseline.json` recording what already shipped. `sungrow` is the
worked example, and the only one clean when this was first measured.

## A read-only driver that has to ask

A read-only driver from the signed channel cannot write, in any phase. Two
kinds of request only ask to read, and a driver may declare them:

- A cloud driver that has to sign in before it can read names its sign-in
paths in its `DRIVER` table: `auth_post_path`, and `auth_post_paths` for a
login that posts more than one form. It may POST to those paths and no
others.
- An MQTT driver whose device reports only while a client asks names its
read-request topics in its catalog manifest. Venus OS on a Victron GX
publishes only while it receives `R/<portal ID>/keepalive`:

```yaml
mqtt_read_request_topics: ["R/+/keepalive"]
```

A topic must start with `R/`, Venus's read-request namespace; `+` stands
for one whole level and `#` is refused. The driver may publish only to a
matching topic, with at most 1 KiB of payload, and FTW Core allows six such
requests a minute. Setup measurement mode and fingerprint probes hold them
as they hold writes. A read request
needs no write permission, so the signed channel grants none: an FTW Core
that does not know the field runs the driver read-only and refuses it. The generated
guard raises an error for any other publish; Core returns its refusal as a
string, so log it and try again later. Declare only a topic that asks the
device to report, never one that changes a setting.

## Sign convention

**Positive watts flow into the site.** Every driver, every device, no
Expand Down
2 changes: 1 addition & 1 deletion index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ drivers:
size_bytes: 9392
sha256: "246369f9a66d9b667ea423cdc6c972d6a93e57828b1e8518e1a118ecb4b7c10a"
- name: "victron_mqtt"
version: "1.2.0"
version: "1.2.1"
tier: community
protocol: mqtt
connectivity: local
Expand Down
5 changes: 3 additions & 2 deletions manifests/victron_mqtt.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: "victron_mqtt"
version: "1.2.0"
version: "1.2.1"
tier: community
author: "Sourceful Labs AB"
protocol: mqtt
connectivity: local
ders: [pv, battery, meter]
control: false
mqtt_read_request_topics: ["R/+/keepalive"]
tested_devices:
- manufacturer: "Victron Energy"
model_family: "GX Devices"
Expand Down Expand Up @@ -51,7 +52,7 @@ signature: ""
bytecode_sha256: ""
bytecode_signature: ""
bytecode_size: 0
changelog: "Send the Venus keep-alive every 30 s and ask for a full republish every 120 s; drop a system battery value a full republish leaves out."
changelog: "Declare the Venus keep-alive topic R/+/keepalive as a read request, so FTW lets the driver send it from the signed channel."

upstream_docs:
- url: "https://raw.githubusercontent.com/victronenergy/dbus-flashmq/master/README.md"
Expand Down
3 changes: 3 additions & 0 deletions spec/host-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ Drain all buffered messages since last call. Returns a table of `{topic=string,
### `host.mqtt_publish(topic, payload)`
Publish a message. Returns `true`/`false`.

A read-only driver from the signed channel may publish only to the
`mqtt_read_request_topics` its manifest declares (`docs/WRITING-A-DRIVER.md`).

## HTTP

Available when `PROTOCOL = "http"`.
Expand Down
4 changes: 4 additions & 0 deletions spec/manifest-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Each driver has a YAML manifest in `manifests/` that describes its metadata, cap
| `control` | bool | Yes | Whether FTW can command the device through this driver: `driver_command` writes to it and the `DRIVER` table does not declare `read_only = true`. A stub that only refuses is `false` and declares `read_only` |
| `tested_devices` | list | No | Devices tested against (see below) |
| `upstream_docs` | list | No | Vendor reference documents to watch for register/protocol changes (see below) |
| `mqtt_read_request_topics` | list | No | For a read-only MQTT driver: the topics it may publish read requests to, such as `R/+/keepalive`. FTW lets the driver publish to these topics only; they grant no write permission (see `docs/WRITING-A-DRIVER.md`) |
| `min_host_version` | string | No | Minimum gateway firmware version required |
| `size_bytes` | int | Yes | Size of the `.lua` file in bytes |
| `dkb_id` | string | No | Corresponding Hugin DKB device profile ID |
Expand Down Expand Up @@ -208,6 +209,7 @@ Version changes must be accompanied by a `CHANGELOG.md` entry under `[Unreleased
10. Every manifest must have a corresponding `.lua` file in `drivers/`
11. `tested_devices` entries must have `manufacturer` and `model_family`
12. `upstream_docs` entries must have an `http(s)` `url`; `kind` and `url_stability`, when present, must be known values
13. `mqtt_read_request_topics`, when present, must be a non-empty list on an `mqtt` driver with `control: false`. Each topic starts with `R/`, Venus's read-request namespace, and is at most 256 bytes of printable ASCII without spaces; `+` is a whole level; `#` is refused

## Migration from V1

Expand All @@ -221,6 +223,8 @@ V2.2 adds bytecode fields: `bytecode_sha256`, `bytecode_signature`, `bytecode_si

V2.3 adds `upstream_docs`: an optional list of vendor reference documents (`url`, `title`, `kind`, `url_stability`) to watch for register/protocol changes.

V2.5 adds the optional `mqtt_read_request_topics`: the read requests a read-only MQTT driver may publish.

V2.4 adds `connectivity` (`local`/`cloud`) and the optional `setup` list: where a driver talks while it is running, and what a human must obtain once before it can connect at all. `connectivity` is required, so every manifest carries it.

Use `tools/migrate_manifests.py` to convert V1 JSON → V2 YAML.
2 changes: 1 addition & 1 deletion support-status.json
Original file line number Diff line number Diff line change
Expand Up @@ -1808,7 +1808,7 @@
},
{
"catalog_source": true,
"catalog_version": "1.2.0",
"catalog_version": "1.2.1",
"driver_id": "victron_mqtt",
"targets": {
"blixt-l1": {
Expand Down
Loading