mtp_inspector
| Field |
Value |
| Name |
inspect mtp |
| Purpose |
Retrieve, inspect, and explain services, data assemblies, parameters, equipment, and OPC UA node mappings from MTP files. |
| Arguments |
An MTP file path and the information to retrieve, such as services, data assemblies, attributes, or node IDs. |
When to use
- When you need to retrieve information from an MTP file.
- When you need to understand the structure of an MTP file (services,
procedures, data assemblies, parameters, or equipment).
- When you need to verify which data assemblies or OPC UA nodes an MTP
defines before generating or modifying code.
Options
| Flag |
Description |
-f <file> |
Path to a .mtp file (must include the .mtp extension) |
-s / --service |
Print services |
-d / --dataassembly |
Print data assemblies |
-n / --nodeid |
Print OPC UA node IDs |
-k <regex> |
Filter by element name (regex, default .+) |
-a <regex> |
Filter by attribute name (regex, default .+); repeatable |
Examples
- Show names and classes of the elements of the services
rand_num_gen:
mtp_inspector -f data/pea/minimal/04_MTP/minimal.mtp -s -k rand_num_gen -a Name -a RefB
- Show the RefBaseSystemUnitPath of all data assemblies (derives the class):
mtp_inspector -f data/pea/minimal/04_MTP/minimal.mtp -d -a RefB
- Show the RefBaseSystemUnitPath of the "upper_bound" and "lower_bound":
mtp_inspector -f data/pea/minimal/04_MTP/minimal.mtp -d -k ".*bound.*" -a RefB
- Show all OPC UA node IDs exposed by the M15 example:
mtp_inspector -f src/examples/modbus/M15.mtp -n
Troubleshooting
| Error |
Cause |
Fix |
FileNotFoundError: File not found: <path> |
Path is a directory or missing .mtp extension |
Provide the full file path including .mtp (e.g., src/examples/modbus/M15.mtp) |
ModuleNotFoundError: No module named 'opcua' |
Running outside the project venv |
Use uv run python -m tools.mtp_inspector or .venv\Scripts\python.exe -m tools.mtp_inspector |
rmtp_pea
| Field |
Value |
| Name |
rmtp_pea |
| Purpose |
Start a PEA (Process Equipment Automation) daemon from an MTP package and an application-logic module. |
| Arguments |
The MTP basename, the application-logic module, and the OPC UA endpoint / cycle time / run mode. |
The PEA is what runs the MTP: it builds the services and data assemblies
defined by the MTP, loads the @register-decorated application logic, and
exposes them through an OPC UA server. The jumpstart PEA panel captures
this daemon's console output live.
When to use
- When you need to run the PEA described by an MTP so its services and
data-assembly nodes are exposed as an OPC UA server.
- As the target that
pea_inspector and a PeaSession POL connect to.
- In jumpstart, the Publish button restarts this daemon for a reloaded MTP.
Options
| Flag |
Description |
-r / --rmtp <base> |
Basename of the requirements MTP (without .mtp or .json) |
-u / --user-logic <mod> |
Python module containing the application logic |
-e / --endpoint <url> |
OPC UA endpoint (default opc.tcp://localhost:4840) |
-c / --cycle-time <s> |
Procedure cycle time in seconds (default 1.0) |
-d / --duration <s> |
Seconds to keep the PEA running when --daemon is not set (default 10.0) |
--daemon |
Keep the PEA running until interrupted |
-l / --log-level <lvl> |
Logging level (default MTP) |
Examples
- Run the PEA for an MTP with its generated logic, keeping it alive:
rmtp_pea --rmtp workdir/jumpstart/minimal --user-logic jumpstart_logic \
--cycle-time 1.0 --endpoint opc.tcp://localhost:4840 --daemon
- Run for a fixed 10 seconds (default) to smoke-test the MTP loads:
rmtp_pea --rmtp data/pea/minimal/04_MTP/minimal --user-logic minimal_logic
Troubleshooting
| Error |
Cause |
Fix |
| Endpoint already bound / OPC UA server start fails |
A previous PEA is still holding the port |
Stop it with .\src\tools\bg_kill.ps1 and retry |
ModuleNotFoundError: ... user-logic |
The application-logic module is not on the path |
Ensure the module is importable (e.g., in the sandbox / PYTHONPATH) |
pea_inspector
| Field |
Value |
| Name |
pea_inspector |
| Purpose |
Scan a running PEA and read every OPC UA node defined by an MTP file; optionally subscribe and print live updates. |
| Arguments |
The MTP file and the endpoint of the running PEA, plus a node filter and subscription settings. |
pea_inspector reads an MTP file, builds the same node-id map that
mtp_inspector -n prints (MtpReader.alias_opcua_map), connects to a running
OPC UA endpoint, and reads every node. In the jumpstart COM panel it runs
in subscribe mode (-s) as the live communication view, and its scan
function powers the in-process Scan button.
When to use
- When you want to read the current values of a running PEA's nodes.
- To subscribe and watch nodes update over time (the jumpstart COM panel).
- To confirm a PEA is actually serving the nodes your MTP declares.
Options
| Flag |
Description |
-f / --filename <f> |
Path to the MTP file to inspect for node ids |
-e / --endpoint <url> |
OPC UA endpoint of the running PEA (e.g., opc.tcp://localhost:4840) |
-k / --key <regex> |
Filter nodes by browse-name alias (regex, default .+) |
-s / --subscribe |
Subscribe to every node and print each update, once per cycle |
-i / --interval <ms> |
Subscription / print interval in milliseconds (default 500) |
-n / --count <n> |
Number of polling cycles to run; 0 = until interrupted (default 0) |
--utc |
Show raw server (UTC) timestamps instead of local time |
--show-nodeid |
Include the node id in each subscribe-mode line |
-l / --log-level <lvl> |
Logging level (default MTP) |
Examples
- Single scan: read every node of a running PEA once:
pea_inspector -f data/pea/minimal/04_MTP/minimal.mtp -e opc.tcp://localhost:4840
- Subscribe and print each update (the jumpstart COM view):
pea_inspector -f data/pea/minimal/04_MTP/minimal.mtp -e opc.tcp://localhost:4840 -s -i 500
- Subscribe to a subset of nodes by name:
pea_inspector -f minimal.mtp -e opc.tcp://localhost:4840 -s -k ".*bound.*"
Troubleshooting
| Observation |
Cause |
Fix |
| Connection refused |
No PEA is running at that endpoint |
Start it first with rmtp_pea |
Node value shows err |
The node could not be read (missing / type) |
Check the MTP / node id and that the PEA serves that node |
bg_kill
| Field |
Value |
| Name |
bg_kill |
| Purpose |
Stop a runaway jumpstart Streamlit app and the PEA / inspector daemons it spawns. |
| Arguments |
The Streamlit port and whether to also stop the spawned daemons. |
When to use
- When the jumpstart Streamlit app will not stop (e.g., a stuck run that
keeps holding its port and OPC UA endpoint).
- To reap the
rmtp_pea and pea_inspector daemons the app launched, which
outlive the app and keep the OPC UA endpoint occupied.
- As the counterpart to
bg_list, which shows the same set of processes
without killing them.
Options
| Flag |
Description |
-AppPort <n> |
The Streamlit port; processes listening on it are killed too (default 8599). |
-NoDaemons |
Stop only the app and its worker children, leaving the daemons running. |
-List |
Dry run: list the matching processes instead of killing them. |
Examples
- Stop the app and its PEA / inspector daemons:
- Preview what would be killed, without killing anything:
.\src\tools\bg_kill.ps1 -List
- Stop only the app on a custom port, leaving the daemons running:
.\src\tools\bg_kill.ps1 -AppPort 8501 -NoDaemons
Troubleshooting
| Observation |
Cause |
Fix |
No jumpstart processes found -- nothing to do. |
No matching processes are running |
Expected when nothing is running; the app is already down. |
Access is denied while stopping a process |
The process is owned by another user or is elevated |
Re-run the terminal as Administrator, or taskkill it manually. |