Skip to content
This repository was archived by the owner on Nov 15, 2026. It is now read-only.
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
4 changes: 2 additions & 2 deletions .github/workflows/acceptance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ jobs:
cp examples/model-source.yaml "$RUNNER_TEMP/catalog-acceptance/examples/"
cd "$RUNNER_TEMP/catalog-acceptance"
"$RUNNER_TEMP/modsim/bin/python" tools/fetch-models.py --output "$RUNNER_TEMP/catalog-acceptance/inputs"
"$RUNNER_TEMP/modsim/bin/python" tools/catalog-interop.py --vectors "$RUNNER_TEMP/catalog-acceptance/inputs/devices/advantech/adam-5017uh/models/adam-5017uh.vectors.json" --modpoll-python "$RUNNER_TEMP/modpoll/bin/python" --node-reader "$GITHUB_WORKSPACE/.interop/modpoll/tools/wot-interop/read-write.cjs" --output "$RUNNER_TEMP/catalog-interop.json"
"$RUNNER_TEMP/modsim/bin/python" tools/catalog-interop.py --vectors "$RUNNER_TEMP/catalog-acceptance/inputs/products/advantech/adam-5017uh/models/adam-5017uh.vectors.json" --modpoll-python "$RUNNER_TEMP/modpoll/bin/python" --node-reader "$GITHUB_WORKSPACE/.interop/modpoll/tools/wot-interop/read-write.cjs" --output "$RUNNER_TEMP/catalog-interop.json"
- name: Verify the released runtime against the catalog model
run: |
uv venv "$RUNNER_TEMP/released-modsim"
uv pip install --python "$RUNNER_TEMP/released-modsim/bin/python" 'modsim==2.0.0a2'
cd "$RUNNER_TEMP/catalog-acceptance"
"$RUNNER_TEMP/released-modsim/bin/python" tools/catalog-interop.py --vectors "$RUNNER_TEMP/catalog-acceptance/inputs/devices/advantech/adam-5017uh/models/adam-5017uh.vectors.json" --modpoll-python "$RUNNER_TEMP/modpoll/bin/python" --node-reader "$GITHUB_WORKSPACE/.interop/modpoll/tools/wot-interop/read-write.cjs" --output "$RUNNER_TEMP/catalog-interop-released.json"
"$RUNNER_TEMP/released-modsim/bin/python" tools/catalog-interop.py --vectors "$RUNNER_TEMP/catalog-acceptance/inputs/products/advantech/adam-5017uh/models/adam-5017uh.vectors.json" --modpoll-python "$RUNNER_TEMP/modpoll/bin/python" --node-reader "$GITHUB_WORKSPACE/.interop/modpoll/tools/wot-interop/read-write.cjs" --output "$RUNNER_TEMP/catalog-interop-released.json"
- uses: actions/upload-artifact@v4
with:
name: catalog-interop
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,17 @@ Compose deployment with `docker compose down`.
A deployment has a stable ID per device, a TM path, instance parameters and an
optional scenario. TD IDs and Modbus Unit IDs must be unique. Scenarios define
initial values, seeded generators and bindings; local Python behavior requires
`--allow-scripts`. They do not duplicate the model's register mapping. See
`--allow-scripts`. They do not duplicate the Thing Model's point mappings. See
[model configuration](docs/site/model-validation.md) for the supported profile,
codecs, constraints and behavior hooks.

For a single device without a managed deployment:

```bash
uv run python tools/fetch-models.py
uv run modsim --config examples/models/devices/advantech/adam-5017uh/models/adam-5017uh.tm.json \
uv run modsim --config examples/models/products/advantech/adam-5017uh/models/adam-5017uh.tm.json \
--unit-id 1 --port 5020 \
--scenario examples/models/devices/advantech/adam-5017uh/simulation/adam-5017uh.sim.json
--scenario examples/models/products/advantech/adam-5017uh/simulation/adam-5017uh.sim.json
```

The single-device model runtime currently supports TCP. The unconfigured demo
Expand Down
4 changes: 2 additions & 2 deletions examples/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ server:
port: 5020
devices:
- id: adam-5017uh
model: examples/models/devices/advantech/adam-5017uh/models/adam-5017uh.tm.json
model: examples/models/products/advantech/adam-5017uh/models/adam-5017uh.tm.json
parameters:
THING_ID: urn:modsim:device:advantech:adam-5017uh
UNIT_ID: 1
HOST: 127.0.0.1
scenario: examples/models/devices/advantech/adam-5017uh/simulation/adam-5017uh.sim.json
scenario: examples/models/products/advantech/adam-5017uh/simulation/adam-5017uh.sim.json
- id: adam-6024
model: tests/fixtures/io-module/adam-6024.tm.json
parameters:
Expand Down
8 changes: 4 additions & 4 deletions examples/model-source.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repository: top-maker/open-modbus-catalog
revision: f4e1f9cdb39d886e11e1f9aa5345828128b3aaca
revision: 3359d13e008cebfbb1c79646a4083cf5e39e0609
files:
devices/advantech/adam-5017uh/models/adam-5017uh.tm.json: 9e1d6e38dbb4e2db2f30f8dfd3d9df90a349b2e9aeb60a168ae4d60ee709ead7
devices/advantech/adam-5017uh/models/adam-5017uh.vectors.json: a76f365ae333b78e8113227940e15cc52e527962d676d62754d6211b184e22eb
devices/advantech/adam-5017uh/simulation/adam-5017uh.sim.json: 246e0eaf9234aaec6c85c63497a27bbd89c132e436345636c9cdba8969fd3c9f
products/advantech/adam-5017uh/models/adam-5017uh.tm.json: 9e1d6e38dbb4e2db2f30f8dfd3d9df90a349b2e9aeb60a168ae4d60ee709ead7
products/advantech/adam-5017uh/models/adam-5017uh.vectors.json: a76f365ae333b78e8113227940e15cc52e527962d676d62754d6211b184e22eb
products/advantech/adam-5017uh/simulation/adam-5017uh.sim.json: 246e0eaf9234aaec6c85c63497a27bbd89c132e436345636c9cdba8969fd3c9f
2 changes: 1 addition & 1 deletion tests/test_catalog_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_remote_model_single_device_read_and_stop(tmp_path):
lock = yaml.safe_load(
(Path(__file__).resolve().parents[1] / "examples/model-source.yaml").read_text()
)
url = f"https://raw.githubusercontent.com/{lock['repository']}/{lock['revision']}/devices/advantech/adam-5017uh/models/adam-5017uh.tm.json"
url = f"https://raw.githubusercontent.com/{lock['repository']}/{lock['revision']}/products/advantech/adam-5017uh/models/adam-5017uh.tm.json"
scenario = tmp_path / "initial.sim.json"
values = [0x1234, 0x8001, 0xABCD, 0, 65535, 42, 0x0102, 0xFE01]
scenario.write_text(
Expand Down
6 changes: 3 additions & 3 deletions tools/catalog-interop.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import yaml

ROOT = Path(__file__).resolve().parents[1]
MODEL = "devices/advantech/adam-5017uh/models/adam-5017uh.tm.json"
TM_PATH = "products/advantech/adam-5017uh/models/adam-5017uh.tm.json"
VALUES = [0x1234, 0x8001, 0xABCD, 0, 65535, 42, 0x0102, 0xFE01]
EXPECTED = {f"AI{i}_RAW": value for i, value in enumerate(VALUES)}

Expand Down Expand Up @@ -54,11 +54,11 @@ def run(args):
revision = lock["revision"]
if len(revision) != 40 or any(c not in "0123456789abcdef" for c in revision):
raise ValueError("Full immutable data commit required")
url = f"https://raw.githubusercontent.com/{lock['repository']}/{revision}/{MODEL}"
url = f"https://raw.githubusercontent.com/{lock['repository']}/{revision}/{TM_PATH}"
with urlopen(url, timeout=20) as response:
payload = response.read(2 * 1024 * 1024 + 1)
digest = hashlib.sha256(payload).hexdigest()
if digest != lock["files"][MODEL]:
if digest != lock["files"][TM_PATH]:
raise ValueError("Catalog TM hash mismatch")
reader = args.node_reader.resolve()
node_versions = {
Expand Down
Loading