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
| Requirement | Purpose |
|---|---|
| Docker Engine (root or docker-group user) | Build and run the discovery / camera containers. |
Local NATS server on nats://127.0.0.1:4222 | Message bus for all control and telemetry. Override with NATS_URL if needed. |
| Node-RED runtime on the same host | Custom nodes interact with /dev/shm created by camera containers. |
Access to /dev/shm | Collector node reads frame buffers via shared memory segments. |
| Sentech SDK 1.2.2 for Linux x64 | Required headers/libs for StApi (bundled installer: sentech-driver/install.sh). |
| Omron GigE camera(s) + compatible NIC | Cameras 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- Runs
sentech-driver/install.sh(with sudo) to unpack the SDK intosentech-driver/SentechSDK/. - Rebuilds the discovery and camera Docker images via their
run.shhelper scripts. - Executes
npm installinsidenode-red/to pull thenatsdependency. - Offers to link the Node-RED package into your user directory (e.g.
~/.node-red). - 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-discoveryCamera 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)
| Node | Inputs | Outputs | Description |
|---|---|---|---|
| omron-collector | 0 | 1 | Discovers cameras, manages discovery/camera containers, streams frame buffers (BGR8) from shared memory into flows. |
| omron-trigger | 1 | 0 | Issues software triggers to selected cameras when a message passes through. |
| omron-config | 1 | 1 | Sends 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
{}toomron/<MAC-HYPHEN>/triggerfor 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) plusAcquisitionMode(Continuous / MultiFrame / SingleFrame), but you can type any additional register name you need. - Runtime overrides: include a
msg.parametersobject (e.g.{ ExposureTime: 22000 }). - Output message includes an
omronConfigsummary:jsmsg.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.
| Subject | Publisher | Subscriber | Description |
|---|---|---|---|
omron/broadcast | Collector/Trigger/Config nodes | Discovery | Request a fresh camera scan (payload {}). |
omron/cameras | Discovery | Node-RED nodes | Camera inventory (cameras: [{mac,status,interface,dockerRunning}, ...]). |
omron/up | Node-RED nodes | Discovery | Start a camera container ({mac,ninterface}). |
omron/down | Node-RED nodes | Discovery | Stop and remove a camera container ({mac}). |
omron/fix | Node-RED nodes | Discovery | Force camera IP addressing based on interface subnet ({mac}). |
omron/<MAC-HYPHEN>/notification | Camera | Collector | Frame metadata; shared-memory segment referenced by segment. |
omron/<MAC-HYPHEN>/trigger | Trigger node | Camera | Software-trigger command ({}). |
omron/<MAC-HYPHEN>/config | Config node | Camera | Parameter 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.