Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Protokit

A kit of device communication protocols.

Industrial device comms (Modbus, MC, Open Protocol) — multi-language, not related to protobuf tooling.

Protokit is a monorepo of small, focused libraries and services for talking to industrial devices (PLCs, controllers, assembly tools), organized by language:

protokit/
  node/   npm workspaces — @digta/* packages (published to npm)
  go/     Go module — libraries + runnable commands (compiled binaries)

Each language uses its own native tooling — npm for node/, Go modules for go/ — so they don't step on each other.

Node.js packages (node/)

Published under the @digta scope; install only the protocol you need.

Package Protocol Status npm
@digta/fins Omron FINS TCP ✅ Working (app/service) npm i @digta/fins
@digta/modbus Modbus TCP ✅ Working (zero-dep TCP master) npm i @digta/modbus
@digta/mcprotocol Mitsubishi MELSEC MC (1E/3E) ✅ Working (fork of mcprotocol 0.1.2 + ASCII 3E framing fix) npm i @digta/mcprotocol
@digta/open-protocol Atlas Copco Open Protocol ✅ Working (zero-dep MID codec + TCP client) npm i @digta/open-protocol

Status legend: ✅ usable today · 🚧 scaffolded, implementation in progress.

Note: @digta/open-protocol is the Atlas Copco assembly-tool protocol, not Google Protocol Buffers.

Go (go/)

Go module github.com/digtaalfathir/protokit/go — compiles to single static binaries (no runtime needed on the target). See go/README.md for layout and how to build, run, and autostart (systemd / pm2).

Package Protocol Status
go/mcprotocol Mitsubishi MELSEC MC (3E binary, word devices) ✅ read/write words
go/modbus Modbus TCP (master) ✅ read/write coils + registers
go/open-protocol Atlas Copco Open Protocol ✅ codec + client (reconnect/heartbeat)
go/fins Omron FINS/TCP ✅ read/write memory areas

Install (Node.js)

npm i @digta/fins
npm i @digta/modbus
npm i @digta/mcprotocol
npm i @digta/open-protocol

Development

Node.js (node/)

Native npm workspaces (no Lerna/Nx/Turborepo).

git clone https://github.com/digtaalfathir/protokit.git
cd protokit
npm install                          # install + link all node/ workspaces
npm run start -w @digta/fins         # run a script in one package
npm test --workspaces --if-present   # run tests across all packages

Go (go/)

cd go
go run ./cmd/<tool>                  # run during development
go build -o <tool> ./cmd/<tool>      # build a binary
GOOS=linux GOARCH=amd64 go build ...  # cross-compile for a Linux device

How to add a protocol

A Node.js package (node/)

  1. Create node/<name>/.
  2. Add node/<name>/package.json:
    • "name": "@digta/<name>", "version": "0.1.0"
    • description + keywords (protocol, industrial, plc, iot, tcp, serial, …)
    • "license": "MIT", "author": "Rifky Andigta Al-Fathir"
    • main / exports and a "files" field (publish only what's needed)
    • repository: { "type": "git", "url": "git+https://github.com/digtaalfathir/protokit.git", "directory": "node/<name>" }
  3. Add node/<name>/index.js (entrypoint) and node/<name>/README.md.
  4. Run npm install at the repo root to wire the new workspace in.
  5. Add a row to the Node.js packages table above.

A Go package (go/)

Add a library under go/<name>/ and/or a runnable command under go/cmd/<tool>/. See go/README.md.

Publishing (npm)

📖 First time? Full step-by-step walkthrough: PUBLISHING.md.

Node packages are not published automatically. Prerequisites: create the npm org digta and npm login. Scoped packages default to private, so pass --access public:

npm publish -w @digta/<name> --access public

License

MIT © Rifky Andigta Al-Fathir

About

Industrial device communication protocols in Node.js (@digta/*) and Go — Modbus, Omron FINS, Mitsubishi MC, Atlas Copco Open Protocol. Monorepo (npm workspaces + Go module). Not related to protobuf tooling.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages