Introduction
The Signal Router is a hopit Edge service designed to connect Targets and manage all read and write operations. It reads signals from one or more Sources and writes them to one or more Destinations, allowing flexible and rule-based data routing for multiple Signal Routes simultaneously.
The following graph shows the signal flow of an exemplary signal route with all modules enabled in the pipeline. The route reads from two source targets and ingests the data into the Python Compute Module. Next, the signals can be mapped (e.g. from an OPC UA node id to a human readable name). The Condition allows to only continue in the data pipeline if a specific condition is fulfilled (e.g. greater than a constant). Next, the Trigger module only triggers the send Operation either periodically or on change.
Router and the Processing Pipeline​
Each Signal Route defines a pipeline from one or more sources to one or more destinations. The flow can include the following stages:
| Stage | Description |
|---|---|
| Compute (optional) | Executes user-defined computations on incoming signals using embedded Python scripts. These scripts can be dynamically edited and applied per route. |
| Map (optional) | Maps incoming signal identifiers (e.g., OPC UA node IDs, ADS names) to logical names (e.g. signal harmonization, human readable names). |
| Condition (optional) | Evaluates logical expressions against the latest signal values or constants (e.g., greater than, less than, equal, greater than or equal, less than or equal ). Signals are only further proceed if the condition is satisfied. |
| Trigger | Determines when signals should be processed. You can configure it to trigger: • Periodic – based on a user-defined scape interval • On Change – the changed signal is further processed • On Change Full – all signals are processed if one signal changes |
| Operation (optional) | Defines the send operation, including how the processed signal should be formatted using an AsyncAPI schema |
The read time is synchronized between all routes. Therefore, all routes with the same scrape interval, defined in the trigger, are always read at the same time. On connection losses, the Router buffers the signals. The amount of saved signals can be controlled with the BufferSize parameter for each Target.
Routes can be added by clicking the "Add Route" button.
The following screenshot shows the user interface of hopit for a single route. Each route must have a unique name and can be enabled or disabled. Each of its sources and destinations can also be enabled or disabled on its own, with the switch on its card, see Disabling Sources and Destinations. The source targets are shown on the left whereas destination targets are shown on the right side. Additional Targets can be added by clicking the respective button. Each route can be duplicated or deleted. The "Compute" button opens the Python code editor for this route.

Sources​
Source Targets define data sources for each route. The configurator allows for configuring the source signals for each target (e.g. node id for a OPC UA target). Further, a Condition consists of a Signal name and a Value. The Router will forward the Signals of this Source only, if the Signal equals this Value. A source that is disabled is not read, see Disabling Sources and Destinations.
Destinations​
Each destination primarily contains the destination target with the respective scrape trigger and the scrape interval. The scrape interval defines the cyclic polling interval. Further, the scrape trigger allows to configure if the data is either sent periodic with the cyclic polling interval to the destination target or only on change. If the the trigger is set to publish the data on change, the scrape interval for polling the source target still applies but the data is only published if a signal changes. It can be configured to either send all signals if at least one signal changed ("On Change Full") or only the respective changed signal ("On Change").
Destinations have the parameters:
- Enabled: Whether the destination gets signals, see Disabling Sources and Destinations.
- Target Name: The name of the Target to write the signals.
- Scrape Interval: The interval to trigger the Sources to read the Signals.
- Scrape Trigger:
- Periodic: Signals are sent periodically.
- On Change: Only the Signals, which changed while the previous cycle are sent.
- On Change Full: All Signals are sent, if at least one Signal changes.
- Constants: Name/Value pairs to add to each sent message.
- Persistent Buffer: Stores the buffered messages not in the RAM, but on the hard disk in order to restore them after a power outage.
- Conditions: Conditions that must all be met for the read values to be sent, see Destination Conditions. The following relational operators are available:
- Less
- Greater
- LessOrEqual
- GreaterOrEqual
- Equal
- NotEqual
- Properties:
- For Azure Targets: Name/Value pairs added as Properties in the Azure message.
- For MQTT, Magenta and ThingsBoard Targets: A
topicproperty defines the MQTT topic to publish the Signals. Default topic is/telemetry.
- Signal Map: Name/Value pairs to replace signal names before sending it to the destination Target. A signal whose value is
[[SKIP_WRITE]]or empty is not sent, see Skipping Signals. - Operation: Defines the send operation according to the AsyncAPI standard.
Destination Conditions​
A destination only sends the values of a read when all of its conditions are met. The conditions are checked after the Signal Map, so they use the mapped signal names; a signal that the Signal Map skips keeps the name it was read with. A condition whose signal was not read is not met.
A condition compares a signal with a fixed value or with one of these placeholders:
| Comparison value | Compares with | First reading |
|---|---|---|
[[LAST_VALUE_READ]] | The value of the signal that this destination read before, also when a condition rejected that reading. | Compared with no value (null). |
[[LAST_VALUE_WRITTEN]] | The last value of the signal that this destination queued for sending. It does not tell whether the Target has delivered it yet. | The condition is met. |
Missing values (null). Equal and NotEqual also compare null: null equals null and differs from every other value. Less, Greater, LessOrEqual and GreaterOrEqual are not met if one of the two values is null. With [[LAST_VALUE_READ]], these comparisons therefore reject the first reading. Less, Greater, LessOrEqual and GreaterOrEqual compare numbers and times; values that cannot be compared, such as a text with a number, are reported as an error in the log.
The value read before. For [[LAST_VALUE_READ]], every reading of the signal becomes the value of the next comparison, also when another condition rejects it or the Scrape Trigger sends nothing. A read without that signal keeps the value read before. For example, Greater [[LAST_VALUE_READ]] with the readings 10, 5, 6 and 6 rejects 10 (nothing to compare with) and 5, sends 6, and rejects the second 6. This applies to all Scrape Triggers.
The value read before is kept when the route is saved, as long as the destination keeps its Target and the route its name. It is reset when the route or the destination is disabled and enabled again and when hopit Edge restarts. Restored buffered signals are sent without rechecking conditions. They do not initialize [[LAST_VALUE_READ]]; its baseline starts with the first new reading after restart.
Skipping Signals​
A destination sends every signal that its route reads, unless its Signal Map skips the signal. Each destination has a Signal Map of its own, so one destination can leave out signals that another destination of the route sends. The Signal Map skips a signal when
- the entry with the signal's name has the value
[[SKIP_WRITE]]or an empty value, - a regular expression entry, written as
/.../, with the value[[SKIP_WRITE]]matches the signal's name, or - the Signal Map leaves the name empty, for example a regular expression with an empty value that matches the whole name.
These are the names the signals are read with: a [[SKIP_WRITE]] entry also skips a signal that another entry renames. A regular expression with an empty value only removes what it matches, and the signal is still sent: /^Line1\./ with an empty value sends Line1.Speed as Speed. Add from Source in the menu of the Signal Map adds the signals of a source with empty values, so they are not sent until you give them a name. The Routes page marks the entries that skip their signal as not sent.
A skipped signal is not sent, and a change of it alone does not trigger On Change or On Change Full. The conditions of the destination still see it, under the name it was read with. This destination sends the speed of line 1 only while the line runs, without the running flag and without the debug signals:
"SignalMap": {
"GVL.Line1.Speed": "Speed",
"GVL.Line1.Running": "[[SKIP_WRITE]]",
"/^GVL\\.Debug\\./": "[[SKIP_WRITE]]"
},
"Conditions": [
{ "Signal": "GVL.Line1.Running", "Operator": "Equal", "Value": true }
]
To send when a skipped signal changes, compare it with [[LAST_VALUE_READ]]. A condition that compares a skipped signal with [[LAST_VALUE_WRITTEN]] or [[LAST_VALUE]] is never met, because no value of the signal is written, and the destination sends nothing. The Routes page does not save such a condition, and hopit Edge logs a warning when a Device Twin update sets one.
What the destination had buffered of a signal before its Signal Map skipped it is still sent.

Disabling Sources and Destinations​
A source or destination of a route can be disabled with the switch on its card, without removing it from the route. It keeps its settings and can still be edited. In the Device Twin it is "Enabled": false on the source or destination; a new source or destination is enabled.
A disabled source is not read. The route reads its other sources, and a compute script gets only the signals of the sources that are enabled. A route whose sources are all disabled, or whose source Targets are all disabled or missing, does not run at all. A route without any source is different: it sends the constants of its destinations, for example to write fixed values to a Target.
A disabled destination gets no signals, and the route goes on with its other destinations. A route whose destinations are all disabled does not read its sources. What the destination still had buffered is discarded, including its Persistent Buffer on disk, as for a disabled route: it is not sent, also not after a restart, and the destination starts with an empty buffer once it is enabled again. To pause the delivery instead and keep the buffered signals, disable the destination's Target: they are sent once the Target is enabled again.
Buffering and restarts​
A destination buffers signals while its Target cannot deliver them. Enable Persistent Buffer on the destination to store buffered signals on disk and restore them after a restart. The Target's BufferSize still limits how many values are kept per signal.
| Saved change | What happens to buffered signals |
|---|---|
| Disable the destination's Target | Signals are kept and sent when the Target is enabled again, within the configured buffer limit. |
| Disable a route or destination | Its buffered signals are discarded, including the Persistent Buffer. Enabling it again starts with an empty buffer. |
| Remove a route or destination | Its buffered signals are discarded. |
| Change a destination's Target | Its previous buffer is discarded. |
| Rename a route | The old route's buffer is discarded. |
| Skip a signal in the Signal Map | Values already buffered for that signal are still sent. |
These rules also apply to Device Twin updates. Disabling a source stops new reads from that source; it does not discard values already buffered by the destinations. Disabling a Target does not discard its buffers.
At startup, buffers for disabled or removed routes are deleted. Old SignalBufferArchive folders and destination folders ending in .backup are left in place and are not restored automatically.
Recovery and storage errors​
If a persistent buffer file is unreadable at startup, hopit Edge sets it aside as <file>.<time>.backup, logs an error and restores other readable files. The signals in that file are not sent. The backup is kept for 30 days, with a warning at each start; the first start after that period deletes it. If the file cannot be set aside, startup stops to protect the remaining data.
To attempt recovery, stop hopit Edge and keep a copy of the affected folder. Repair the file, then rename it to <signal>_<number>.json using a number not already used by that signal in the folder. Restart and inspect the log. Contact support if you cannot establish which values the file contains.
If startup reports an unfinished buffer migration, preserve the complete route folder and its settings for investigation. Do not delete .buffer-migration.json alone to force startup: it records which destination owns the buffered values.
Need more help configuring routes or scripting your compute logic? Check out: