Skip to content

node-red-contrib-rosepetal-omron-camera

Comprehensive tooling for deploying Rosepetal Omron GigE cameras with Dockerized services and Node-RED automation. This repository contains:

  • Discovery service (C++) – detects cameras via the Sentech SDK, manages per-camera publishers through Docker, and answers control commands over NATS.
  • Camera publisher (C++) – streams frames into POSIX shared memory, publishes metadata on NATS, and accepts trigger/parameter updates.
  • Node-RED package – three custom nodes that expose discovery, trigger, and configuration workflows inside Node-RED.
  • Sentech SDK installer wrapper – automates installation of the vendor SDK required to build and run the C++ components.

1. Prerequisites

RequirementPurpose
Docker Engine (root or docker-group user)Build and run the discovery / camera containers.
Local NATS server on nats://127.0.0.1:4222Message bus for all control and telemetry. Override with NATS_URL if needed.
Node-RED runtime on the same hostCustom nodes interact with /dev/shm created by camera containers.
Access to /dev/shmCollector node reads frame buffers via shared memory segments.
Sentech SDK 1.2.2 for Linux x64Required headers/libs for StApi (bundled installer: sentech-driver/install.sh).
Omron GigE camera(s) + compatible NICCameras must be reachable on the same L2 network.

Docker images install toolchains (g++, cmake, pkg-config, libssl-dev, uuid-dev) internally. Install them on the host only if you plan to compile the binaries outside Docker.


2. Repository Layout

.
├── install.sh                     # End-to-end installer (SDK + Docker build + Node-RED deps)
├── node-red/
│   ├── package.json               # Registers custom nodes with Node-RED
│   ├── omron-collector/           # Collector node runtime + editor UI
│   ├── omron-trigger/             # Trigger node runtime + editor UI
│   └── omron-config/              # Parameter configuration node runtime + editor UI
├── rosepetal-omron-engine/
│   ├── main/                      # Discovery service source & Dockerfile
│   └── camera/                    # Camera publisher source & Dockerfile
└── sentech-driver/                # SDK installer wrapper + payload (`SentechSDK-1.2.2-*.run`)

3. Installation

3.1 Automated install

bash
./install.sh
  1. Runs sentech-driver/install.sh (with sudo) to unpack the SDK into sentech-driver/SentechSDK/.
  2. Rebuilds the discovery and camera Docker images via their run.sh helper scripts.
  3. Executes npm install inside node-red/ to pull the nats dependency.
  4. Offers to link the Node-RED package into your user directory (e.g. ~/.node-red).
  5. Reminds you to restart Node-RED so the new nodes load.

3.2 Manual Docker build/run

Use these commands if you prefer manual control (taken from the docker_run_command.txt files):

Discovery service

bash
# Build (run from repo root)
docker build -t omron-camera-discovery \
    -f rosepetal-omron-engine/main/Dockerfile .

# Run
docker run --name omron-discovery \
    --network host \
    --privileged \
    -v /var/run/docker.sock:/var/run/docker.sock \
    --restart unless-stopped \
    -d omron-camera-discovery

Camera publisher

bash
# Build (run from repo root)
docker build -t omron-camera-publisher \
    -f rosepetal-omron-engine/camera/Dockerfile .

# Run (replace placeholders)
docker run --name omron-<mac-with-dashes> \
    --network host \
    --shm-size 2g \
    -v /dev/shm:/dev/shm \
    --restart unless-stopped \
    -d omron-camera-publisher \
    --mac <mac-with-colons> \
    --interface <network-interface> \
    [--nats nats://host:4222] \
    [--segments 8]

4. Node-RED Nodes (@rosepetal/node-red-omron)

NodeInputsOutputsDescription
omron-collector01Discovers cameras, manages discovery/camera containers, streams frame buffers (BGR8) from shared memory into flows.
omron-trigger10Issues software triggers to selected cameras when a message passes through.
omron-config11Sends parameter updates (e.g. exposure, gain, frame rate) to running camera containers. Values can be constants or sourced from msg/flow/global.

4.1 Collector highlights

  • Sidebar in the editor shows Omron service status and available cameras.
  • Buttons to start/stop discovery (/omron-collector/start-omron) and per-camera containers.
  • Output message example:
    js
    {
      topic: 'omron/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: '2024-03-15T12:34:56.123456Z',
      segment: 'omron_AA-BB-CC-DD-EE-FF_0'
    }

4.2 Trigger highlights

  • Accepts any message; warns if no cameras are selected.
  • Publishes {} to omron/<MAC-HYPHEN>/trigger for each selected camera.

4.3 Config highlights

  • Parameter table now accepts any GenICam node name—either pick from the presets or type a custom register—and lets you choose the value source (str, num, bool, msg., flow., global.). Unknown names are sent as-is and silently ignored if the camera does not expose them.
  • Built-in presets (with hints) cover the common ROI/exposure/gain parameters (Width, Height, OffsetX, OffsetY, ExposureTime, Gain) plus AcquisitionMode (Continuous / MultiFrame / SingleFrame), but you can type any additional register name you need.
  • Runtime overrides: include a msg.parameters object (e.g. { ExposureTime: 22000 }).
  • Output message includes an omronConfig summary:
    js
    msg.omronConfig = {
      cameras: ['aa:bb:cc:dd:ee:ff'],
      parameters: ['ExposureTime', 'GainAuto'],
      timestamp: 1710500000000
    }

5. NATS Subject Map

All services default to nats://127.0.0.1:4222.

SubjectPublisherSubscriberDescription
omron/broadcastCollector/Trigger/Config nodesDiscoveryRequest a fresh camera scan (payload {}).
omron/camerasDiscoveryNode-RED nodesCamera inventory (cameras: [{mac,status,interface,dockerRunning}, ...]).
omron/upNode-RED nodesDiscoveryStart a camera container ({mac,ninterface}).
omron/downNode-RED nodesDiscoveryStop and remove a camera container ({mac}).
omron/fixNode-RED nodesDiscoveryForce camera IP addressing based on interface subnet ({mac}).
omron/<MAC-HYPHEN>/notificationCameraCollectorFrame metadata; shared-memory segment referenced by segment.
omron/<MAC-HYPHEN>/triggerTrigger nodeCameraSoftware-trigger command ({}).
omron/<MAC-HYPHEN>/configConfig nodeCameraParameter update ({params:{...}}).

<MAC-HYPHEN> is the uppercase MAC with hyphens (e.g. AA-BB-CC-DD-EE-FF).


With the prerequisites met and NATS/Docker services running, these assets let you operate Omron GigE cameras entirely through Node-RED flows.