npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

node-red-contrib-modbus

v5.60.2

Published

The all in one Modbus TCP, UDP and Serial contribution long term supported package for Node-RED.

Downloads

44,650

Readme

Platform Node-RED Contribution Modbus Financial Contributors on Open Collective NPM version Node.js Node-RED Standard - JavaScript Style Guide NPM download Build and publish Codacy Badge Gitpod Ready-to-Code Supported with Claude Code Pro

node-red-contrib-modbus

The all-in-one Modbus TCP and Serial contribution package for Node-RED

nodemodbus64

Public LTS line: v5.x (current: 5.60.2) · License BSD-3-Clause · Repo: GitHub

If you like this package, please give us a star on GitHub.

AI-assisted maintenance: This project is actively developed and supported with Claude Code Pro (Anthropic). Issue triage, specs, tests, and patches on the v5 LTS line are routinely done with Claude Code as part of the maintainer workflow — alongside human review before release.


Requirements

| | Minimum | |--|---------| | Node.js | >= 22 (package.json engines) | | Node-RED | >= 4 (node-red.version) | | Install | Palette Manager or npm install node-red-contrib-modbus |

Older Node.js / Node-RED combinations: see historical notes in HISTORY.md. Prefer staying on current LTS Node.js with this release line.


What’s in the package (v5)

TCP / serial Modbus client nodes plus an in-package buffer Modbus TCP server for demos and tests.

| Palette node | Role | |--------------|------| | Modbus-Client | Config: TCP or Serial, queue, reconnect (XState FSM) | | Modbus-Read | Periodic FC1–4 poll | | Modbus-Getter | On-demand FC1–4 read | | Modbus-Flex-Getter | Payload-driven FC1–4 read | | Modbus-Write | FC5 / 6 / 15 / 16 write | | Modbus-Flex-Write | Payload-driven write | | Modbus-Flex-Sequencer | Ordered multi-range reads | | Modbus-Flex-FC | Custom FC maps (extras/argumentMaps) | | Modbus-Flex-Connector | Runtime reconnect / endpoint switch | | Modbus-Queue-Info | Client queue depth / reset | | Modbus-Response | Status display for responses | | Modbus-IO-Config | Named IO JSON mapping | | Modbus-Response-Filter | Filter IO payload by name | | Modbus-Server | Buffer-backed TCP slave (jsmodbus) |

Not in v5: TLS client (Modbus-Client-TLS is v6), flow-based dynamic request/response gateway (#567 → separate package recommendation), modbus-flex-server (own package — see below).

Highlights since 5.46 / in 5.50.0

  • Client FSM / reconnect / queue hardening (from 5.46.x)
  • Safer unit ID handling (unitId / unitid, including unit 0)
  • Modbus address/quantity validation improvements
  • Numbered learning examples 0118 + Learning Path docs
  • Requires Node-RED >= 4 and Node.js >= 22

See CHANGELOG.md for the full list.


How to use / Learning Path

Recommended: use the in-package numbered learning examples (0115).

  1. Install this package and restart Node-RED.
  2. Open Menu → Import → Examples → node-red-contrib-modbus.
  3. Work through the flows in order (or jump to a single node tutorial).

| Doc | Content | |-----|---------| | Learning Path guide | Stages, Modbus cheat sheet, node ↔ example map | | Examples index | Full file list, TCP ports, IO path, old→new mapping | | Docs hub | All documentation entry points |

Each example tab has an English comment node with run instructions. Node sidebar help points at the matching example filename.

| Learn… | Import example | |--------|----------------| | Modbus registers & FCs | 01-Modbus-Basics-Registers-And-FCs | | First TCP client + server | 02-Getting-Started-Client-And-Server | | Polling / on-demand / flex read-write | 0306 | | Sequencer, Flex-FC, Connector, Queue, IO | 0711 | | Buffer server & patterns (HTTP, serial, gateway) | 1215 |

Also: Wiki / DEBUG · YouTube Playlist · Leanpub Modbus book · optional older flow on flows.nodered.org

Flow Example


Install

In your Node-RED user directory (typically ~/.node-red):

npm install node-red-contrib-modbus

Global (less common):

npm install -g node-red-contrib-modbus

If native modules fail to build:

npm install node-red-contrib-modbus --unsafe-perm --build-from-source

List published versions:

npm show node-red-contrib-modbus versions

Install a specific version (example):

npm install [email protected]

Runtime libraries

| Package | Role in this contrib | |---------|----------------------| | @openp4nr/modbus-serial | Modbus client I/O (TCP / serial / ASCII, etc.) | | jsmodbus | In-package Modbus-Server (buffer slave) | | @xstate/fsm | Client connection state machine | | serialport / @serialport/list | Optional — list serial ports in the UI (not the runtime Modbus stack) |

If TCP fails, verify connectivity with a plain Modbus client first. If serial fails, verify the port with serialport first.

Logging uses the debug package (not winston — winston is a v6 direction):

DEBUG=contribModbus*,modbus-serial node-red -v

More options: Wiki DEBUG.


Modbus Flex Server (separate package)

Modbus-Flex-Server was moved out of this package (vm2 / maintenance boundary). Install the dedicated contrib if you still need it. Further package splits (client vs server) remain a longer-term v6 architecture topic; v5 keeps Modbus-Server in this package as the buffer slave for demos and tests.


P4NR B2B Community

The P4NR B2B Community (driven by Iniationware) supports development and commercial help around Modbus for Node-RED. Bianco Royal partners with P4NR.

Leanpub live book

The Online Leanpub Book (Edition 2 for 5.60+, Node-RED 5 / Node.js 24) covers v5.x nodes and options in depth (“buy once, update forever”). For a free start in this repo, use the Learning Path (examples 0118).


Errors & status

From v5.22 onward, client and server nodes catch many network and protocol errors so Node-RED should not crash for those handled cases. Always watch node status, Catch nodes, and optional empty-msg-on-fail settings in your flows.


Contributing

Contributors welcome. Fork the repo and open PRs against develop (or discuss via issues). For larger features, see the maintainer pipeline under docs/p4nr/.

Useful scripts (see package.json):

npm run build          # lint + gulp → modbus/
npm test               # Mocha (parallel)
npm run test:units
npm run coverage
npm run dev-link       # local link into Node-RED

Authors

Since April 2016 by Klaus Landsdorf and the community.

Version history · CHANGELOG


Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]