diff --git a/docs/releases/stage-itscreen-1.0.13.md b/docs/releases/stage-itscreen-1.0.13.md new file mode 100644 index 0000000..3a74a8e --- /dev/null +++ b/docs/releases/stage-itscreen-1.0.13.md @@ -0,0 +1,11 @@ +# stage_itscreen 1.0.13 — client 4.410.142 + +Release date: 2026-10-05. + +- Publish the Modbus polling scheduler fix that keeps RS485 output commands responsive when configured slaves are offline. +- Limit each serial bus to one in-flight polling request while preserving per-range intervals, error backoff, telemetry and register statistics. +- Deliver client 4.410.142 through the existing Console updater without changing the stage installation contract. + +Validation: native ARM64 Qt 5.15.2 compilation and two live MQTT-to-Modbus cycles on `g-box-c453df5f`. Register 1497 completed `0 → 1 → 0`; `itscreen-x11` remained active with zero restarts. + +Binary SHA256: b996013b6b0182deb4b634acd69aadb1e69daaafe4a4a3f021da658cf8d4ff8f. diff --git a/docs/releases/stage-mqtt-1.0.1.md b/docs/releases/stage-mqtt-1.0.1.md new file mode 100644 index 0000000..ea84faa --- /dev/null +++ b/docs/releases/stage-mqtt-1.0.1.md @@ -0,0 +1,6 @@ +# stage_mqtt 1.0.1 + +- Replaces global bidirectional MQTT topic trees with a device-scoped allow-list. +- Separates outbound edge telemetry from inbound device commands. +- Preserves explicitly supported broadcast playback and event commands without reflecting them upstream. +- Prevents one edge from receiving and retransmitting telemetry belonging to other devices. diff --git a/stage-releases.json b/stage-releases.json index ca48c04..8fdb4f3 100644 --- a/stage-releases.json +++ b/stage-releases.json @@ -8,7 +8,7 @@ "version": "1.0.0" }, "stage_mqtt": { - "version": "1.0.0" + "version": "1.0.1" }, "stage_z2m": { "version": "1.0.0" @@ -23,7 +23,7 @@ "version": "1.0.0" }, "stage_itscreen": { - "version": "1.0.12" + "version": "1.0.13" }, "stage_reverse_tunnels": { "version": "1.0.1" diff --git a/stage_itscreen/itscreen b/stage_itscreen/itscreen index f7a2645..3ca7aa9 100755 Binary files a/stage_itscreen/itscreen and b/stage_itscreen/itscreen differ diff --git a/stage_itscreen/itscreen.sha256 b/stage_itscreen/itscreen.sha256 index bc36a0c..dd017f3 100644 --- a/stage_itscreen/itscreen.sha256 +++ b/stage_itscreen/itscreen.sha256 @@ -1 +1 @@ -0613b944acda44b6e5b21bce68fbabe0fe7853ef486c73beb1801b9c1ab7fc98 itscreen +b996013b6b0182deb4b634acd69aadb1e69daaafe4a4a3f021da658cf8d4ff8f itscreen diff --git a/stage_itscreen/itscreen.version b/stage_itscreen/itscreen.version index 290584d..255ebab 100644 --- a/stage_itscreen/itscreen.version +++ b/stage_itscreen/itscreen.version @@ -1 +1 @@ -4.410.141 +4.410.142 diff --git a/stage_itscreen/version.json b/stage_itscreen/version.json index fde5b78..020bed9 100644 --- a/stage_itscreen/version.json +++ b/stage_itscreen/version.json @@ -1,3 +1,3 @@ { - "version": "1.0.12" + "version": "1.0.13" } diff --git a/stage_mqtt/stage_mqtt_install.sh b/stage_mqtt/stage_mqtt_install.sh index 60c3d6b..603ec51 100755 --- a/stage_mqtt/stage_mqtt_install.sh +++ b/stage_mqtt/stage_mqtt_install.sh @@ -411,7 +411,7 @@ address ${REMOTE_HOST}:${REMOTE_PORT} bridge_protocol_version mqttv311 cleansession true -# Use normal MQTT client bridge mode; private bridge mode can suppress OUT forwarding with bidirectional same-prefix mappings. +# The allow-list below keeps inbound commands and outbound telemetry disjoint. try_private false notifications false @@ -428,29 +428,104 @@ bridge_tls_version tlsv1.2 __TLS__ fi - cat >>"$BRIDGE_CONF" <<'__MAP__' + cat >>"$BRIDGE_CONF" <<__MAP__ -# Topic mapping (IOMATEX v1 edge contract) -topic v1/edge/# out 0 "" "" -topic v1/edge/# in 0 "" "" +# IOMATEX v1 edge contract: this edge publishes only its health and receives only its commands. +topic ${BRIDGE_BASE_TOPIC}/health/${DEVICE_ID} out 0 "" "" +topic ${BRIDGE_BASE_TOPIC}/command/${DEVICE_ID}/# in 0 "" "" + +# Legacy iomatex contract: device telemetry OUT. +topic iomatex/+/client/pub/${DEVICE_ID} out 0 "" "" +topic iomatex/+/client/pub/action/${DEVICE_ID} out 0 "" "" +topic iomatex/+/client/pub/module/${DEVICE_ID}/scanning out 0 "" "" +topic iomatex/+/client/pub/camera/${DEVICE_ID}/scanning out 0 "" "" +topic iomatex/+/client/pub/response/event/push out 0 "" "" +topic iomatex/+/client/pub/interface/${DEVICE_ID}/# out 0 "" "" +topic iomatex/+/client/pub/interface/meta/${DEVICE_ID} out 0 "" "" +topic iomatex/+/client/pub/interface/values/${DEVICE_ID} out 0 "" "" +topic iomatex/+/client/pub/interface/calibration/${DEVICE_ID} out 0 "" "" +topic iomatex/+/client/pub/component/plays/${DEVICE_ID} out 0 "" "" +topic iomatex/+/client/pub/component/meta/${DEVICE_ID} out 0 "" "" +topic iomatex/+/client/pub/component/notify/${DEVICE_ID}/# out 0 "" "" +topic iomatex/+/\$devices/settings/${DEVICE_ID}/pub out 0 "" "" +topic iomatex/+/\$devices/alive/${DEVICE_ID} out 0 "" "" +topic iomatex/+/\$devices/error/${DEVICE_ID} out 0 "" "" +topic iomatex/+/\$devices/status/${DEVICE_ID} out 0 "" "" +topic iomatex/+/\$devices/properties/${DEVICE_ID}/pub out 0 "" "" +topic iomatex/\$devices/settings/${DEVICE_ID}/pub out 0 "" "" +topic iomatex/\$devices/alive/${DEVICE_ID} out 0 "" "" +topic iomatex/\$devices/error/${DEVICE_ID} out 0 "" "" +topic iomatex/\$devices/status/${DEVICE_ID} out 0 "" "" +topic iomatex/\$devices/properties/${DEVICE_ID}/pub out 0 "" "" + +# Legacy iomatex contract: device commands IN. +topic iomatex/+/client/sub/config/${DEVICE_ID} in 0 "" "" +topic iomatex/+/client/sub/action/${DEVICE_ID} in 0 "" "" +topic iomatex/+/client/sub/module/${DEVICE_ID}/scanning in 0 "" "" +topic iomatex/+/client/sub/camera/${DEVICE_ID}/scanning in 0 "" "" +topic iomatex/+/client/sub/event/speech/widget/${DEVICE_ID} in 0 "" "" +topic iomatex/+/client/sub/interface/${DEVICE_ID} in 0 "" "" +topic iomatex/+/client/sub/interface/action/${DEVICE_ID} in 0 "" "" +topic iomatex/+/\$devices/settings/${DEVICE_ID}/sub in 0 "" "" +topic iomatex/+/\$devices/properties/${DEVICE_ID}/sub in 0 "" "" +topic iomatex/\$devices/settings/${DEVICE_ID}/sub in 0 "" "" +topic iomatex/\$devices/properties/${DEVICE_ID}/sub in 0 "" "" + +# Intentional broadcast commands IN. No matching OUT wildcard is allowed. +topic iomatex/+/element/play in 0 "" "" +topic iomatex/+/client/sub/event/push/# in 0 "" "" +topic iomatex/+/client/sub/action/frames/# in 0 "" "" +topic iomatex/+/client/sub/action/playlist/# in 0 "" "" __MAP__ if [[ "${LEGACY_ITSCREEN_TREE}" == "1" ]]; then - cat >>"$BRIDGE_CONF" <<'__LEGACY_ITSCREEN__' + cat >>"$BRIDGE_CONF" <<__LEGACY_ITSCREEN__ -# Legacy contract: full it-screen tree (bi-directional) -topic it-screen/# out 0 "" "" -topic it-screen/# in 0 "" "" +# Legacy it-screen contract: device telemetry OUT. +topic it-screen/+/client/pub/${DEVICE_ID} out 0 "" "" +topic it-screen/+/client/pub/action/${DEVICE_ID} out 0 "" "" +topic it-screen/+/client/pub/module/${DEVICE_ID}/scanning out 0 "" "" +topic it-screen/+/client/pub/camera/${DEVICE_ID}/scanning out 0 "" "" +topic it-screen/+/client/pub/response/event/push out 0 "" "" +topic it-screen/+/client/pub/interface/${DEVICE_ID}/# out 0 "" "" +topic it-screen/+/client/pub/interface/meta/${DEVICE_ID} out 0 "" "" +topic it-screen/+/client/pub/interface/values/${DEVICE_ID} out 0 "" "" +topic it-screen/+/client/pub/interface/calibration/${DEVICE_ID} out 0 "" "" +topic it-screen/+/client/pub/component/plays/${DEVICE_ID} out 0 "" "" +topic it-screen/+/client/pub/component/meta/${DEVICE_ID} out 0 "" "" +topic it-screen/+/client/pub/component/notify/${DEVICE_ID}/# out 0 "" "" +topic it-screen/+/\$devices/settings/${DEVICE_ID}/pub out 0 "" "" +topic it-screen/+/\$devices/alive/${DEVICE_ID} out 0 "" "" +topic it-screen/+/\$devices/error/${DEVICE_ID} out 0 "" "" +topic it-screen/+/\$devices/status/${DEVICE_ID} out 0 "" "" +topic it-screen/+/\$devices/properties/${DEVICE_ID}/pub out 0 "" "" +topic it-screen/\$devices/settings/${DEVICE_ID}/pub out 0 "" "" +topic it-screen/\$devices/alive/${DEVICE_ID} out 0 "" "" +topic it-screen/\$devices/error/${DEVICE_ID} out 0 "" "" +topic it-screen/\$devices/status/${DEVICE_ID} out 0 "" "" +topic it-screen/\$devices/properties/${DEVICE_ID}/pub out 0 "" "" + +# Legacy it-screen contract: device commands IN. +topic it-screen/+/client/sub/config/${DEVICE_ID} in 0 "" "" +topic it-screen/+/client/sub/action/${DEVICE_ID} in 0 "" "" +topic it-screen/+/client/sub/module/${DEVICE_ID}/scanning in 0 "" "" +topic it-screen/+/client/sub/camera/${DEVICE_ID}/scanning in 0 "" "" +topic it-screen/+/client/sub/event/speech/widget/${DEVICE_ID} in 0 "" "" +topic it-screen/+/client/sub/interface/${DEVICE_ID} in 0 "" "" +topic it-screen/+/client/sub/interface/action/${DEVICE_ID} in 0 "" "" +topic it-screen/+/\$devices/settings/${DEVICE_ID}/sub in 0 "" "" +topic it-screen/+/\$devices/properties/${DEVICE_ID}/sub in 0 "" "" +topic it-screen/\$devices/settings/${DEVICE_ID}/sub in 0 "" "" +topic it-screen/\$devices/properties/${DEVICE_ID}/sub in 0 "" "" + +# Intentional broadcast commands IN. No matching OUT wildcard is allowed. +topic it-screen/+/element/play in 0 "" "" +topic it-screen/+/client/sub/event/push/# in 0 "" "" +topic it-screen/+/client/sub/action/frames/# in 0 "" "" +topic it-screen/+/client/sub/action/playlist/# in 0 "" "" __LEGACY_ITSCREEN__ fi - cat >>"$BRIDGE_CONF" <<'__LEGACY_IOMATEX__' - -# Legacy contract: full iomatex tree (bi-directional) -topic iomatex/# out 0 "" "" -topic iomatex/# in 0 "" "" -__LEGACY_IOMATEX__ - chown root:mosquitto "$BRIDGE_CONF" || true chmod 640 "$BRIDGE_CONF" || true } @@ -493,14 +568,14 @@ report(){ echo "Base topic : ${BRIDGE_BASE_TOPIC:-v1/edge}" echo echo "Bridge policy:" - echo " OUT: v1/edge/#" - echo " IN : v1/edge/#" + echo " OUT: ${BRIDGE_BASE_TOPIC}/health/${DEVICE_ID}" + echo " IN : ${BRIDGE_BASE_TOPIC}/command/${DEVICE_ID}/#" if [[ "${LEGACY_ITSCREEN_TREE:-0}" == "1" ]]; then - echo " OUT: it-screen/#" - echo " IN : it-screen/#" + echo " OUT: it-screen//client/pub/.../${DEVICE_ID}" + echo " IN : it-screen//client/sub/.../${DEVICE_ID}" fi - echo " OUT: iomatex/#" - echo " IN : iomatex/#" + echo " OUT: iomatex//client/pub/.../${DEVICE_ID}" + echo " IN : iomatex//client/sub/.../${DEVICE_ID}" echo } diff --git a/stage_mqtt/test_mqtt_bridge_contract.py b/stage_mqtt/test_mqtt_bridge_contract.py new file mode 100644 index 0000000..3ffe6bf --- /dev/null +++ b/stage_mqtt/test_mqtt_bridge_contract.py @@ -0,0 +1,56 @@ +import pathlib +import unittest + + +INSTALLER = pathlib.Path(__file__).with_name("stage_mqtt_install.sh") + + +class MqttBridgeContractTest(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.source = INSTALLER.read_text(encoding="utf-8") + + def test_global_bidirectional_trees_are_forbidden(self): + for topic in ("v1/edge/#", "iomatex/#", "it-screen/#"): + self.assertNotIn(f'topic {topic} out', self.source) + self.assertNotIn(f'topic {topic} in', self.source) + + def test_health_and_commands_are_device_scoped(self): + self.assertIn( + "topic ${BRIDGE_BASE_TOPIC}/health/${DEVICE_ID} out", + self.source, + ) + self.assertIn( + "topic ${BRIDGE_BASE_TOPIC}/command/${DEVICE_ID}/# in", + self.source, + ) + + def test_legacy_telemetry_and_commands_are_directional(self): + for prefix in ("iomatex", "it-screen"): + self.assertIn( + f"topic {prefix}/+/client/pub/interface/values/${{DEVICE_ID}} out", + self.source, + ) + self.assertIn( + f"topic {prefix}/+/client/sub/interface/${{DEVICE_ID}} in", + self.source, + ) + self.assertNotIn( + f"topic {prefix}/+/client/pub/# in", + self.source, + ) + + def test_broadcast_commands_never_have_outbound_wildcard(self): + for prefix in ("iomatex", "it-screen"): + self.assertIn( + f"topic {prefix}/+/client/sub/action/playlist/# in", + self.source, + ) + self.assertNotIn( + f"topic {prefix}/+/client/sub/# out", + self.source, + ) + + +if __name__ == "__main__": + unittest.main() diff --git a/stage_mqtt/version.json b/stage_mqtt/version.json index 1587a66..ca84e70 100644 --- a/stage_mqtt/version.json +++ b/stage_mqtt/version.json @@ -1,3 +1,3 @@ { - "version": "1.0.0" + "version": "1.0.1" } diff --git a/stage_ui/console_core/providers/00_core_services.py b/stage_ui/console_core/providers/00_core_services.py index 503f836..43d2f08 100644 --- a/stage_ui/console_core/providers/00_core_services.py +++ b/stage_ui/console_core/providers/00_core_services.py @@ -489,7 +489,7 @@ def mosquitto_card(ctx): warnings, details=[ {"label": "Local broker address", "value": "127.0.0.1:1883"}, - {"label": "Bridged topic trees", "value": "v1/edge/# · it-screen/# · iomatex/#"}, + {"label": "Bridge policy", "value": "Device-scoped telemetry OUT · commands IN"}, ], )