Skip to content

basler-collector ​

Emits the frames of the selected cameras, one message per frame, with the image in msg.payload. Its dialog also starts and stops the discovery service and the publisher container of each camera.

The node has no input and one output.

Properties ​

PropertyDescription
NameLabel of the node in the flow. basler-collector when empty
Basler ServicesState of the services on the host, with the Start Basler and Stop Basler buttons
Available CamerasThe cameras that the discovery service finds: their state, the buttons that act on them and the checkbox that selects them for this node

The buttons of both panels act on the host at once; they do not wait for a deploy. The selection of cameras is saved with the node and applies from the next deploy.

The services and the publisher containers are shared by all the nodes of the package: a camera started from one dialog can be selected in any basler-collector, basler-trigger or basler-config node, and several basler-collector nodes can select the same camera.

Basler Services ​

The panel shows Running when a container whose name starts with basler- is running on the host, and Stopped otherwise. Start Basler is disabled while it shows Running, and Stop Basler while it shows Stopped.

  • Start Basler starts the discovery container, basler-discovery. The Docker images of the package version that are not on the host are pulled first, which can take a while. A stopped basler-discovery container that already exists is started again as it is; otherwise the container is created.
  • Stop Basler removes every container whose name starts with basler-, running or not: the discovery container and the publisher of every camera. The cameras have to be started again afterwards.

Available Cameras ​

The table lists the Basler devices that the discovery service finds, and is refreshed every 5 seconds while the dialog is open. It reads Waiting for camera information... until the first list arrives.

ColumnContent
SelectCheckbox that adds the camera to the selection of this node. It appears once the publisher container of the camera is running, and for the cameras that are already selected
MACMAC address of the camera, in lower case with colons
InterfaceNetwork interface of the host that the pylon SDK reports for the camera
StatusState of the camera, see the next table
ActionsButtons available for the camera
StatusMeaning
FreeNo publisher container runs for the camera, and the discovery service could open and close it
Controlled (ours)The publisher container of the camera is running on this host
Controlled (other)No publisher container runs for the camera, and the discovery service could not open it, for example because another application controls it
No accessNo publisher container runs for the camera, and opening it failed with an access error
Not foundA selected camera that the discovery service does not list

To tell these states apart, the discovery service opens every camera without a publisher each time it lists the cameras.

ActionOffered forEffect
StopA camera whose publisher container is runningThe discovery service removes the publisher container of the camera
Fix IPA camera in No accessThe discovery service runs the automatic IP configuration of pylon (PylonGigEConfigurator auto-ip, class C) on the adapter shown in the Interface column. The command acts on the adapter, not on one camera, so other cameras connected to the same adapter can get a new address too
StartA camera in FreeThe discovery service starts the publisher container of the camera
RemoveA Not found rowThe camera leaves the selection of this node. Unticking its checkbox does the same

The other rows show a note instead of a button.

When Node-RED cannot run an action (a Docker or NATS error), the editor shows a notification with the error text. Stop, Fix IP and Start are requests to the discovery service: what it cannot do is written to the log of its container (docker logs basler-discovery).

Output ​

One message per frame of each selected camera:

javascript
{
  topic: "basler/AA-BB-CC-DD-EE-FF/notification",
  mac: "aa:bb:cc:dd:ee:ff",
  payload: {
    data: <Buffer ...>,
    width: 1920,
    height: 1080,
    channels: 3,
    colorSpace: "BGR",
    dtype: "uint8"
  },
  timestamp: "2026-01-15T10:15:30.123456Z",
  segment: "/basler_AA-BB-CC-DD-EE-FF_3"
}
PropertyTypeContent
payload.dataBufferPixels of the frame, 8 bits per channel in B, G, R order. It is a copy of the shared memory segment: later frames do not change it
payload.width, payload.heightnumberSize of the frame in pixels
payload.channelsnumber3
payload.colorSpacestringBGR
payload.dtypestringuint8
topicstringNATS subject on which the publisher announced the frame, with the MAC address in upper case and hyphens
macstringMAC address of the camera, in lower case with colons
timestampstringUTC time at which the publisher announced the frame, in ISO 8601 with microseconds
segmentstringName of the shared memory segment the frame was read from

The publisher converts every frame to BGR8, whatever the pixel format of the camera: channels is always 3 and colorSpace always BGR, also for a monochrome camera. msg.payload is the raw image object that the nodes of @rosepetal/node-red-contrib-image-tools take.

Each publisher writes the frames in turn to 8 shared memory segments, named /basler_ followed by the MAC address and the number of the segment. The segments grow when a frame does not fit them.

Status ​

StatusMeaning
Grey dot, idleNo camera is selected
Green dot, subscribed NThe node listens to its N selected cameras. It does not tell whether their publisher containers are running
Yellow ring, reconnecting X/NThe publishers of X of the N selected cameras have lost the link with their camera and are trying to reopen it. The status goes back to subscribed N when they report the camera connected or a frame arrives
Red ring, nats errorThe node could not connect to the NATS server when it started

Errors ​

MessageLevelCause
Failed to connect to NATS: <reason>ErrorThe NATS server could not be reached when the node started
Shared memory segment <name> missing for <mac>; awaiting new frames.WarningThe publisher announced a frame, but its segment is not in the /dev/shm that Node-RED sees. The frame is skipped. Written at most once every 10 seconds per camera
Missing segment or size for <subject>WarningThe announcement of a frame carries no segment name or no size. The frame is skipped
Invalid segment size <size> for <subject>WarningThe announced size is not a positive number. The frame is skipped
Failed to read shared memory <name>: <reason>ErrorThe segment exists but could not be read. The frame is skipped
Failed to process frame: <reason>ErrorThe announcement of a frame could not be processed

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

The basler-collector nodes and their dialog share one connection to NATS, opened the first time one of them needs it. If that first attempt fails it is not repeated: start the NATS server and restart Node-RED. If the connection is lost later and the nats client gives up reconnecting, the node stops receiving frames and keeps its status: deploy the flow again once the NATS server is back.