Skip to content

ebus-trigger ​

Sends a software trigger to each selected camera when a message arrives.

The node has one input and no output. The frames that the cameras produce come out of the ebus-collector nodes that have those cameras selected.

The trigger itself has not been tested on a camera yet: the only real device the package has been validated with, the iPORT NTx of the Omron V275, has no software trigger. Its lines are triggered by the V275's own hardware.

Properties ​

PropertyDescription
NameLabel of the node in the flow. ebus-trigger when empty
eBUS ServicesState of the services on the host, with the Start eBUS and Stop eBUS buttons
Available CamerasThe devices that the discovery service finds. The Select checkbox marks the cameras that this node triggers

The two panels are the ones of ebus-collector, with the same buttons, and act on the same services and containers: see its Properties. A camera can be selected once its publisher container is running.

Input ​

Any message triggers the selected cameras.

PropertyTypeDescription
msg.camerasarrayOptional. MAC addresses of the cameras to trigger for this message, in place of the selection of the dialog. Any notation is accepted (aa:bb:cc:dd:ee:ff, AA-BB-CC-DD-EE-FF, aabbccddeeff), and so are objects with a mac property; entries that are not MAC addresses are left out. An empty array means the selection of the dialog

The rest of the message is not read.

For each camera the node publishes an empty request, {}, on the NATS subject ebus/<MAC>/trigger. The publisher of the camera notes the request and handles it between two waits for a frame, and each wait lasts up to 1 second: requests that reach it during the same wait are handled as one.

The publisher executes the TriggerSoftware command of the camera only when the camera already has TriggerMode set to On and TriggerSource set to Software. It never changes those settings: set them first with ebus-config, parameter Custom…, for example with this message:

javascript
msg.parameters = {
    "TriggerMode": "On",
    "TriggerSource": "Software"
}

When the camera is not in that mode, or the command fails, the publisher does not trigger and replies with the reason, for example trigger: TriggerMode/TriggerSource are Off/Line1; set On/Software with ebus-config. On a device that has neither feature, such as the iPORT NTx, both values come out empty: are /. The reply goes to the status subject of the camera, ebus/<MAC>/status, with the status connected, and to the log of the publisher container (docker logs ebus-<MAC>, with the MAC address in upper case and hyphens). ebus-collector does not show it, because it shows no detail for a connected camera.

The node does not know whether the camera took an image. A request for a camera whose publisher container is not running is lost. A request that reaches a publisher while it is opening its camera again is executed once the camera acquires.

Status ​

StatusMeaning
Blue dot, selected NN cameras are selected in the dialog
Grey dot, no camerasNo camera is selected in the dialog
Green dot, triggered NThe requests of the last message went to N cameras. The status goes back to selected N or no cameras after 1 second
Red ring, trigger errorThe requests of the last message could not be sent

Errors ​

MessageLevelCause
No cameras selected for triggerWarningA message arrived and there is no camera to trigger: no camera is selected and msg.cameras is absent or empty, or msg.cameras holds no valid MAC address
Failed to trigger cameras: <reason>ErrorA message arrived and Node-RED could not connect to the NATS server

The errors are logged without the message, so they appear in the debug sidebar and in the Node-RED log but do not trigger a Catch node.

The node opens the NATS connection that the nodes of the package share when the first message arrives, if no other node has opened it yet. When that fails, the next message tries again.