node-red-contrib-datamatrix-restore 1.1.1
Reads QR and Data Matrix codes from noisy DPM photos and returns the scanned text
node-red-contrib-datamatrix-restore
Node-RED node Code restore. It crops a noisy QR or Data Matrix photo (including industrial DPM), reads the code, and returns the scanned text.
The same node runs on Windows, Linux, and ARM. Install dependencies on the machine that runs Node-RED. Do not copy node_modules between operating systems.
Requirements
- Node.js 18 or later
- Node-RED 3.0 or later
- Internet only during
npm install(sosharpcan download the native binary for that OS/CPU)
Install
Palette Manager (after the node is in the Node-RED library)
- Menu → Manage palette → Install
- Search for
datamatrix-restoreorCode restore - Install node-red-contrib-datamatrix-restore
- Restart Node-RED if the editor asks you to
npm (recommended)
In your Node-RED user directory:
cd ~/.node-red
npm install node-red-contrib-datamatrix-restore
Windows:
cd %USERPROFILE%\.node-red
npm install node-red-contrib-datamatrix-restore
Restart Node-RED. The node appears in the palette as Code restore.
From GitHub
cd ~/.node-red
npm install rivasrayos/node-red-contrib-datamatrix-restore
From a local clone
git clone https://github.com/rivasrayos/node-red-contrib-datamatrix-restore.git
cd ~/.node-red
npm install /path/to/node-red-contrib-datamatrix-restore
Docker / offline devices
If the Node-RED host has no outbound internet, npm install on that device will fail.
On a PC with internet, install native modules for the target OS, then copy the package (including node_modules) into the Node-RED user directory.
Example for Alpine Linux ARM64:
npm install --omit=dev --cpu=arm64 --os=linux --libc=musl
Copy the folder into node_modules/node-red-contrib-datamatrix-restore inside the Node-RED user directory and restart Node-RED.
zxing-wasm is loaded from the local .wasm file. The node does not download WASM at runtime.
Flow
image URL or Buffer → Code restore → debug
A separate crop node is not required. Send the image in msg.payload and { x, y, width, height } in msg.crop.
Input
| Property | Type | Description |
|---|---|---|
msg.payload |
string or Buffer | Image URL or image Buffer (configurable) |
msg.crop.x |
number | Crop left |
msg.crop.y |
number | Crop top |
msg.crop.width |
number | Crop width |
msg.crop.height |
number | Crop height |
Output
| Property | Type | Description |
|---|---|---|
msg.payload |
string | Scanned text |
msg.format |
string | QR or DataMatrix |
msg.image |
Buffer | Clean 200×200 PNG |
msg.original |
Buffer | Cropped photo |
If the code cannot be read, the node reports an error and does not send a message.
License
MIT