This page helps you find why a route does not write, writes too often, or writes the wrong value. It is organised by symptom. Each symptom gives the checks to make in the routing table and in the Listen window, and points to the section of the Routes page that explains the parameter involved.
Start with the two tools of section 1: the indicators of the routing table tell you whether the route is in error or matches nothing, and the Listen window shows, step by step, what happens to each value.
| Indicator | Meaning |
|---|---|
| Red dot before the route name | The route is in error. Hover the dot to read the message (section 2.2). |
| Orange dot before the route name | No match found: the route matches no address (section 3). |
| Count column | Number of addresses linked by the route, sources and destinations together. 0 means that the route does nothing. |
| Status column (hidden by default) | active, inactive, or the error message starting with !. Display it with Live table > Columns. |
| Show links (right click on a route, or on a selection) | The list of the source → destination pairs actually built by the route, with their gateways. A source without the destination you expect is visible here. |
See also Reading the table, section 1.3 of Routes.
| Message | Cause |
|---|---|
!source.value: <message> |
The Source value function threw an error at its last execution, for example x is not defined. The dot disappears at the next successful execution. |
!source.address: <message>, !destination.address: <message>, !destination.gateway: <message> |
A function used as address or gateway threw an error while the route was computing its addresses. The pairs concerned get no destination. |
!source.value: invalid function (parse failed) (or another field) |
The text looks like a function but does not compile. Fix the syntax: until then the field is taken as a plain name. |
!retry: invalid function (parse failed) |
The Retry function does not compile; the default retry policy applies. |
Right click on a route and choose Listen (or Selection (n) > Listen routes for several routes). From an address in a gateway tab, right click and choose Trace routes (n) to follow every route that uses this address. Each line is one step of an execution: the Event column tells what happened, the Detail column why.
The list of events and their meaning is in section 1.4 of Routes. The window only records while it is open: open it first, then make the source change (or wait for the next value).
| Check | Explanation |
|---|---|
A regular expression typed without its / … / delimiters |
A text without slashes is always a plain address name: ^%M30\d\d$ looks for an address with that exact name. Type /^%M30\d\d$/. The cell then shows [ regex ]. See section 2.5 of Routes. |
| The address name has a typo, or belongs to another gateway | Compare with the address table of the gateway. A Source gateway (or Dest. Gateway) that does not hold the address gives no match. |
| The source gateway is renamed or deleted | The route keeps the old name. Select the gateway again. |
| The destination address does not exist | A destination that does not exist is created at the first write only when the destination driver recognises its name (see the address syntax on the driver page). Otherwise Listen shows no-write with the detail invalid destination name. |
| A function used as address returns nothing | Test it with Show links: the function must return true for the addresses to accept. |
Open Listen, change the source value, and look at the last event of the line:
| Event in Listen | Cause and fix |
|---|---|
| No line at all | The routing function returned nothing (null, undefined): the routing is cancelled on purpose, check the conditions of the function (see What a function may return). Otherwise the source does not emit (gateway stopped, address not polled), the route is inactive (Active unticked), the routing engine is stopped (section 8), or the route matches nothing (section 2). |
trigger-skip |
The event that started the execution is not ticked in Trigger. A route whose trigger is only refresh or gateway does not react to value changes. See Trigger. |
exception |
The routing function threw an error; Detail gives the message, also shown on the red dot. |
not-routable |
The value is null, undefined, NaN or infinite, for example a division by zero or parseFloat of a text. |
disabled |
The value is held by the Disable delay window. Depending on Disable delay mode, it is written at the end of the window or dropped. See Disable Delay. |
min-diff |
The variation is smaller than MinimumDiff, or the value is identical to the last written value. See Minimum Difference. |
gateway-disconnected |
The destination gateway is not connected and the route has no Buffer. The value is lost; the destination is synchronised when the gateway reconnects. |
no-write |
Nothing is written: the destination address is empty, the destination name is not valid for its driver (Detail: invalid destination name), or the function asked to skip the write. |
write but no written |
The driver has not answered yet, or answers with an error (section 6). |
Two frequent configuration mistakes:
get or to_number, or a function, to convert it.| Symptom | Check |
|---|---|
| The source and the destination keep changing (ping-pong) | The route is bidirectional and one side changes the value (scaling, rounding, a device that echoes with a slightly different value). Use a single direction when possible, or set Disable delay and MinimumDiff. See Direction. |
| Every small variation is written | Set MinimumDiff (for example 0.5 for a temperature), or Disable delay to limit the write rate. |
| Bursts of writes to a slow bus | Set Disable delay (for example 1000 ms) with the mode that keeps the last value, so that only the last value of each window is written. See Disable Delay Mode. |
| The route writes the same value periodically | Repeat is set. See Repeat. |
| Values arrive from addresses you did not expect | Source address is empty: every address of the source gateway (or of the device, if the gateway is empty too) triggers the route. |
| Several destinations are written instead of one | The address name exists on several gateways and Dest. Gateway is empty: the route writes to all of them. Set the gateway, or use gatewayName¬address. Show links lists the pairs. |
This is the normal behaviour of the refresh and gateway triggers: when a route starts (save, reboot, Refresh route) the current source values are sent once, and when a gateway reconnects the destination is synchronised again.
If the destination starts an action (an e-mail, a command, a pulse), untick refresh and gateway in Trigger: the route then reacts only to real changes. See Trigger.
| Event in Listen | Meaning and fix |
|---|---|
write-error |
The destination driver refused the write. Detail gives its error: unknown or read-only address, value out of range, device offline, timeout. Check the address on the driver page and the state of the device. |
retry |
A new attempt is scheduled (Detail: attempt number and delay). |
retry-giveup |
The route stopped retrying. Check Retry (section 2.15 of Routes) and the cause of the error. |
buffered, buffer-full |
The value waits in the route buffer until the destination gateway reconnects; when the buffer is full the most recent waiting value is replaced. See Buffer. |
All the routes share a limit of writes that can be pending at the same time (Maximum concurrent writes, 40 by default, in the settings of the [Routes] entry of the gateways list). Above it, writes wait in a queue: event congestion in Listen.
Look at the [Routes] entry of the gateways list. If its label shows disable, the whole routing engine is stopped: click START. This state is kept across reboots. While the engine is stopped, no route writes, whatever its Active box.
Inside a routing function, options.log(...) and options.error(...) write a message prefixed with [route <route name>], also from asynchronous callbacks. These messages, like the errors of the routing engine, go to the logs of the device: see Diagnostics. Give your routes a Name: it makes these messages easy to find.
function debugScale(v, src, dst, options){
options.log("received", v, "from", src.name, "trigger", options.trigger)
return v * 0.1
}