node-red-contrib-modbus-modpackqt 1.1.85 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,58 @@
1
+ # Changelog
2
+
3
+ All notable changes to **node-red-contrib-modbus-modpackqt** are documented
4
+ here. This project follows [Semantic Versioning](https://semver.org/) — pin a
5
+ major version (`^2.0.0`) in production.
6
+
7
+ ## [2.0.0] — Unreleased
8
+
9
+ ### ⚠️ Breaking changes
10
+
11
+ - **Removed cloud gateway dependency.** Modbus communication now runs entirely
12
+ inside the Node-RED process via [`modbus-serial`](https://www.npmjs.com/package/modbus-serial).
13
+ No companion app required. Existing flows from `1.x` must be re-created — the
14
+ config node schema and node IDs have changed.
15
+ - **Slave nodes no longer accept `slaveId`.** The embedded slave server is
16
+ single-unit (`unitID: 1`). Multi-unit support is on the roadmap.
17
+ - **Master read/write nodes output raw register arrays only.** Type decoding
18
+ was removed in favour of the new
19
+ [`node-red-contrib-bytes-modpackqt`](https://www.npmjs.com/package/node-red-contrib-bytes-modpackqt)
20
+ palette — install both for the full experience.
21
+
22
+ ### Added
23
+
24
+ - **Embedded Modbus TCP slave server** with a 65 536-register store per
25
+ register type (coils, discrete inputs, holding, input).
26
+ - **`modpackqt-traffic` node** — free passive monitor that emits one message
27
+ per Modbus operation. Filters by direction, kind, function code, target.
28
+ - **Local rate limit** (1 000 ops/day per Node-RED instance) for the free tier.
29
+ - **Modbus spec quantity validation** — read/write requests exceeding the
30
+ protocol maximums (125 regs read, 123 regs write, 2 000 / 1 968 bits)
31
+ return a clear error before hitting the wire.
32
+ - **Strict input validation on master writes** — non-integer or out-of-range
33
+ values now produce a helpful error pointing at the bytes palette instead of
34
+ silently truncating.
35
+ - **Traffic events for external slave reads/writes** — Modbus masters writing
36
+ to the embedded slave server now appear in the traffic monitor with
37
+ `via: 'external'`.
38
+ - **`DISCLAIMER.md`, `SECURITY.md`, `CONTRIBUTING.md`** documenting safe use,
39
+ vulnerability disclosure, and contribution guidelines.
40
+ - **Bundled example flow** (`examples/basic-flow.json`) with six sections
41
+ combining this palette with the bytes palette.
42
+
43
+ ### Changed
44
+
45
+ - Connection pooling per `(host, port, unitId)` for TCP and `(serial, unitId)`
46
+ for RTU — repeated reads/writes to the same target reuse a single client.
47
+ - All master ops are serialised through a single promise queue to prevent
48
+ collisions on shared serial ports.
49
+
50
+ ### Security
51
+
52
+ - Removed unauthenticated cloud gateway endpoints. Communication is local-only
53
+ unless you explicitly enable the embedded slave server (off by default).
54
+
55
+ ## [1.x] — Legacy
56
+
57
+ Prior releases used a cloud gateway (`modsim`) for Modbus communication. They
58
+ are deprecated; please migrate to 2.x.
@@ -0,0 +1,70 @@
1
+ # Contributing
2
+
3
+ Thanks for your interest in improving **node-red-contrib-modbus-modpackqt**.
4
+ This document explains how to report issues, suggest features, and submit code
5
+ changes.
6
+
7
+ ## Reporting bugs
8
+
9
+ Before opening an issue:
10
+
11
+ 1. Make sure you're on the **latest version** (`npm outdated` in `~/.node-red`).
12
+ 2. Check if the issue is reproducible against the [bundled example flow](./examples/basic-flow.json).
13
+ 3. Re-read [`DISCLAIMER.md`](./DISCLAIMER.md) — some "bugs" are actually
14
+ undocumented behaviour or known limitations.
15
+
16
+ When you file an issue, please include:
17
+
18
+ - Palette version (from `package.json` or the Node-RED palette manager)
19
+ - Node.js version (`node --version`)
20
+ - Node-RED version
21
+ - Operating system
22
+ - The smallest possible Node-RED flow that reproduces the issue (export from
23
+ Menu → Export → JSON)
24
+ - Console / debug output, with timestamps if possible
25
+ - A `modpackqt-traffic` node's output if the issue involves Modbus operations
26
+
27
+ Where to file:
28
+
29
+ - **Bugs and feature requests:** <https://modpackqt.com/contact> (or the
30
+ package's GitHub repo when listed in `package.json`)
31
+ - **Security issues:** see [`SECURITY.md`](./SECURITY.md) — do not file
32
+ publicly
33
+
34
+ ## Suggesting features
35
+
36
+ We're happy to consider new ideas. Before opening a request:
37
+
38
+ - Describe the use case in plain language ("I want to read a 64-bit timestamp
39
+ from a Schneider device") — not the implementation ("add a new
40
+ decode-timestamp node").
41
+ - Explain why the existing nodes can't already solve it (often they can —
42
+ composing `decode-uint32 BE_SWAP` + a `function` node solves a lot).
43
+
44
+ ## Submitting code changes
45
+
46
+ 1. **Open an issue first** for non-trivial changes so we can agree on the
47
+ approach before you spend time on a PR.
48
+ 2. **Keep changes small and focused** — one feature or fix per PR.
49
+ 3. **Preserve backward compatibility.** This package is shipped to many
50
+ production deployments; breaking changes require a major version bump and
51
+ a clear migration path.
52
+ 4. **Test against the example flow.** At minimum, importing `basic-flow.json`
53
+ and running each section should still work.
54
+ 5. **Update `CHANGELOG.md`** under "Unreleased".
55
+ 6. **Update the README** if you add or change a node's behaviour.
56
+ 7. **Bump versions only on release.** Maintainers handle the version bump
57
+ when publishing.
58
+
59
+ ## Code style
60
+
61
+ - Vanilla Node.js — no TypeScript, no transpilation, no build step.
62
+ - 2-space indent.
63
+ - Prefer small, well-named helper functions over clever one-liners.
64
+ - Wrap risky operations in `try/finally` and emit errors via `node.error()`
65
+ rather than throwing into Node-RED's runtime.
66
+
67
+ ## Licence
68
+
69
+ By submitting a PR you agree to licence your contribution under the project's
70
+ [MIT licence](./LICENSE).
package/DISCLAIMER.md ADDED
@@ -0,0 +1,92 @@
1
+ # ⚠️ Industrial use disclaimer
2
+
3
+ This software talks to industrial control systems (PLCs, RTUs, drives, meters).
4
+ A Modbus write can move physical equipment — valves, motors, heaters, pumps —
5
+ and a wrong write can damage equipment, ruin a batch, or cause a safety incident.
6
+
7
+ **Read this before deploying in production.**
8
+
9
+ ## You are responsible for
10
+
11
+ - **What your flows do.** Node-RED, this palette, and the bytes palette only
12
+ carry your bytes — they don't know whether `setpoint=200` means 200 °C or
13
+ 200 RPM, or whether opening valve 7 floods the building.
14
+ - **Testing.** Always test against the embedded slave server (or a simulator
15
+ like ModPackQT's own Modbus simulator) before pointing at a live device.
16
+ - **Staging.** Have an air-gapped or read-only staging environment between
17
+ development and production. Never deploy a flow change directly to a system
18
+ controlling real assets.
19
+ - **Backups.** Keep your Node-RED flows in version control. A flow recovery
20
+ is faster than a hardware recovery.
21
+ - **Compliance.** If your installation is subject to safety regulations
22
+ (IEC 61508, ISO 13849, OSHA, FDA 21 CFR Part 11, etc.), this software is
23
+ **not certified** for safety-instrumented systems (SIS). Use it for
24
+ monitoring, supervisory control, and data acquisition — not for safety
25
+ interlocks.
26
+
27
+ ## Recommended safe-use workflow
28
+
29
+ 1. **Always start with reads.** Get the values flowing in before you wire any
30
+ write back out.
31
+ 2. **Use the embedded slave server as a sandbox.** Wire your flows to write
32
+ into the local slave first; verify the bytes are correct with `decode-…`
33
+ nodes; only then point them at a real device.
34
+ 3. **Add the `modpackqt-traffic` node** (free) to every config — it logs every
35
+ read and write with timing, value, and error info. If something goes wrong,
36
+ the trail is right there.
37
+ 4. **Test the worst case in the bytes palette.** Round-trip your values
38
+ through `encode-… → decode-…` to confirm the byte/word order matches the
39
+ target device. Wrong endianness on a setpoint write is a common cause of
40
+ damage.
41
+ 5. **Wrap critical writes in a guard.** A `function` node that rejects values
42
+ outside a safe range, or a `switch` node that blocks writes during
43
+ maintenance windows, costs you 30 seconds and saves you a service call.
44
+ 6. **Pin a major version in production** (`"node-red-contrib-modbus-modpackqt": "^2.0.0"`).
45
+ We follow semver — patch and minor releases are backward compatible; major
46
+ releases may not be.
47
+
48
+ ## What this software does NOT promise
49
+
50
+ - It is **not** safety-rated.
51
+ - It is **not** suitable for safety-instrumented systems (SIS / SIL-rated loops).
52
+ - It is **not** a substitute for a real PLC's hardwired interlocks.
53
+ - It does **not** guarantee delivery, ordering, or completeness of writes
54
+ beyond what the underlying `modbus-serial` library and the network/serial
55
+ link provide.
56
+ - The free tier is rate-limited; if you exceed 1,000 ops/day, master read/write
57
+ nodes will return errors. **Do not rely on the free tier for production.**
58
+
59
+ ## Reporting issues
60
+
61
+ - **Bugs / unexpected behavior:** open an issue at
62
+ <https://modpackqt.com/contact> (or the package's GitHub repo when listed).
63
+ - **Security issues:** email **support@modpackqt.com** privately. Please
64
+ follow responsible disclosure — give us 90 days to fix before publishing.
65
+ - **Paid customers:** include your customer ID for priority response.
66
+
67
+ ## Updates
68
+
69
+ This package is distributed via npm. **Updates are never automatic.** Node-RED
70
+ will show "update available" in the palette manager when a new version is
71
+ published; you choose when to upgrade.
72
+
73
+ We strongly recommend subscribing to release notifications:
74
+
75
+ - **GitHub:** watch the repository (when listed in `package.json`)
76
+ - **npm:** `npm view node-red-contrib-modbus-modpackqt versions`
77
+ - **Email** (paid customers): security and breaking-change notices go to your
78
+ registered address.
79
+
80
+ ## Licence
81
+
82
+ This software is provided under the MIT License — see `LICENSE`. Paid plans
83
+ provide commercial support and remove the daily op cap. **Paid plans do not
84
+ add a warranty** — the limitation of liability in the LICENSE applies to all
85
+ users. See <https://modpackqt.com/nodered/terms> for the full terms.
86
+
87
+ ---
88
+
89
+ If any of the above is unacceptable for your project, **do not use this
90
+ software in production**. There is no shame in that — Modbus is a mature
91
+ protocol with many alternative implementations, including hardware-based
92
+ gateways with safety certifications.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ModPackQT
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.