{"id":13572829,"url":"https://github.com/grid-x/modbus","last_synced_at":"2026-01-17T03:01:49.302Z","repository":{"id":29991793,"uuid":"123150863","full_name":"grid-x/modbus","owner":"grid-x","description":"Fault-tolerant, fail-fast implementation of Modbus protocol in Go.","archived":false,"fork":false,"pushed_at":"2025-11-20T12:52:04.000Z","size":510,"stargazers_count":123,"open_issues_count":12,"forks_count":38,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-11-20T13:17:07.686Z","etag":null,"topics":["golang","modbus"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grid-x.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-02-27T15:44:49.000Z","updated_at":"2025-11-20T11:33:24.000Z","dependencies_parsed_at":"2024-02-02T14:28:49.376Z","dependency_job_id":"ab4d3a40-3ecf-4092-93db-ff0f69009e99","html_url":"https://github.com/grid-x/modbus","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/grid-x/modbus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grid-x%2Fmodbus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grid-x%2Fmodbus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grid-x%2Fmodbus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grid-x%2Fmodbus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grid-x","download_url":"https://codeload.github.com/grid-x/modbus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grid-x%2Fmodbus/sbom","scorecard":{"id":445470,"data":{"date":"2025-08-11","repo":{"name":"github.com/grid-x/modbus","commit":"c9ca708272cb0b947e8e15ece02c70374e9cadd9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.8,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":10,"reason":"14 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":9,"reason":"Found 13/14 approved changesets -- score normalized to 9","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":2,"reason":"1 out of the last 3 releases have a total of 1 signed artifacts.","details":["Warn: release artifact v1.3 not signed: https://api.github.com/repos/grid-x/modbus/releases/219027474","Warn: release artifact v1.2 not signed: https://api.github.com/repos/grid-x/modbus/releases/102733977","Info: signed release artifact: modbus-cli.amd64.sig: https://github.com/grid-x/modbus/releases/tag/v1.0","Warn: release artifact v1.3 does not have provenance: https://api.github.com/repos/grid-x/modbus/releases/219027474","Warn: release artifact v1.2 does not have provenance: https://api.github.com/repos/grid-x/modbus/releases/102733977","Warn: release artifact v1.0 does not have provenance: https://api.github.com/repos/grid-x/modbus/releases/36327161"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T06:37:48.204Z","repository_id":29991793,"created_at":"2025-08-19T06:37:48.204Z","updated_at":"2025-08-19T06:37:48.204Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28492593,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T02:39:23.645Z","status":"ssl_error","status_checked_at":"2026-01-17T02:34:19.649Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","modbus"],"created_at":"2024-08-01T15:00:21.514Z","updated_at":"2026-01-17T03:01:49.291Z","avatar_url":"https://github.com/grid-x.png","language":"Go","funding_links":[],"categories":["Industrial protocols"],"sub_categories":["Modbus (Yes it's still alive)"],"readme":"# go modbus\nFault-tolerant, fail-fast implementation of Modbus protocol in Go.\n\n# Supported functions\n\nBit access:\n- Read Discrete Inputs\n- Read Coils\n- Write Single Coil\n- Write Multiple Coils\n\n16-bit access:\n- Read Input Registers\n- Read Holding Registers\n- Write Single Register\n- Write Multiple Registers\n- Read/Write Multiple Registers\n- Mask Write Register\n- Read FIFO Queue\n\nDevice identification:\n- Read Device Identification (Function Code 0x2B)\n\n# Supported formats\n- TCP\n- Serial (RTU, ASCII)\n- UDP\n\n# Usage\nBasic usage:\n```go\n// Modbus TCP\nclient := modbus.TCPClient(\"localhost:502\")\n// Read input register 9\nresults, err := client.ReadInputRegisters(context.Background(), 8, 1)\n\n// Modbus RTU/ASCII\n// Default configuration is 19200, 8, 1, even\nclient = modbus.RTUClient(\"/dev/ttyS0\")\nresults, err = client.ReadCoils(context.Background(), 2, 1)\n```\n\nAdvanced usage:\n```go\n// Modbus TCP\nhandler := modbus.NewTCPClientHandler(\"localhost:502\")\nhandler.Timeout = 10 * time.Second\nhandler.SlaveID = 0xFF\nhandler.Logger = log.New(os.Stdout, \"test: \", log.LstdFlags)\nctx := context.Background()\n// Connect manually so that multiple requests are handled in one connection session\nerr := handler.Connect(ctx)\ndefer handler.Close()\n\nclient := modbus.NewClient(handler)\nresults, err := client.ReadDiscreteInputs(ctx, 15, 2)\nresults, err = client.WriteMultipleRegisters(ctx, 1, 2, []byte{0, 3, 0, 4})\nresults, err = client.WriteMultipleCoils(ctx, 5, 10, []byte{4, 3})\n\n// Read device identification\n// Supported codes: ReadDeviceIDCodeBasic, ReadDeviceIDCodeRegular, ReadDeviceIDCodeExtended\ndeviceInfo, err := client.ReadDeviceIdentification(ctx, modbus.ReadDeviceIDCodeBasic)\n// Or for reading a specific object: ReadDeviceIDCodeSpecific\ndeviceInfo, err := client.ReadDeviceIdentificationSpecificObject(ctx, 0)\n```\n\n```go\n// Modbus RTU/ASCII\nhandler := modbus.NewRTUClientHandler(\"/dev/ttyUSB0\")\nhandler.BaudRate = 115200\nhandler.DataBits = 8\nhandler.Parity = \"N\"\nhandler.StopBits = 1\nhandler.SlaveID = 1\nhandler.Timeout = 5 * time.Second\n\nctx := context.Background()\nerr := handler.Connect(ctx)\ndefer handler.Close()\n\nclient := modbus.NewClient(handler)\nresults, err := client.ReadDiscreteInputs(ctx, 15, 2)\n\n// Read device identification\n// Supported codes: ReadDeviceIDCodeBasic, ReadDeviceIDCodeRegular, ReadDeviceIDCodeExtended\ndeviceInfo, err := client.ReadDeviceIdentification(ctx, modbus.ReadDeviceIDCodeBasic)\n// Or for reading a specific object: ReadDeviceIDCodeSpecific\ndeviceInfo, err := client.ReadDeviceIdentificationSpecificObject(ctx, 0)\n```\n\n# Modbus-CLI\n\nWe offer a CLI tool to read/write registers.\n\n## Usage\n\nFor simplicity, the following examples are all using Modbus TCP.\nFor Modbus RTU, replace the address field and use the `rtu-` arguments in order to use different baudrates, databits, etc.\n```sh\n./modbus-cli -address=rtu:///dev/ttyUSB0 -rtu-baudrate=57600 -rtu-stopbits=2 -rtu-parity=N -rtu-databits=8 ...\n```\n\nFor Modbus UDP, replace the address field with a UDP address.\n```sh\n./modbus-cli --address=udp://127.0.0.1:502 ...\n```\n\n### Reading Registers\n\nRead 1 register and get raw result\n```sh\n./modbus-cli -address=tcp://127.0.0.1:502 -quantity=1 -type-parse=raw -register=42\n```\n\nRead 1 register and decode result as uint16\n```sh\n./modbus-cli -address=tcp://127.0.0.1:502 -quantity=1 -type-parse=uint16 -register=42\n```\n\nRead 1 register and get all possible decoded results\n```sh\n./modbus-cli -address=tcp://127.0.0.1:502 -quantity=1 -type-parse=all -register=42\n```\n\nRead 2 registers and decode result as uint32\n```sh\n./modbus-cli -address=tcp://127.0.0.1:502 -quantity=2 -type-parse=uint32 -register=42\n```\n\nRead 2 registers and get all possible decoded results\n```sh\n./modbus-cli -address=tcp://127.0.0.1:502 -quantity=2 -type-parse=all -register=42\n```\n\nReading multiple registers is only possible in the raw format\n```sh\n./modbus-cli -address=tcp://127.0.0.1:502 -quantity=16 -type-parse=raw -register=42\n```\n\n### Writing Registers\n\nWrite 1 register \n```sh\n./modbus-cli -address=tcp://127.0.0.1:502 -fn-code=0x06 -type-exec=uint16 -register=42 -write-value=7\n```\n\nWrite 2 registers\n```sh\n./modbus-cli -address=tcp://127.0.0.1:502 -fn-code=0x10 -type-exec=uint32 -register=42 -write-value=7\n```\n\n### Reading Device Identification\nRead basic device identification information using function code 43 (0x2B) and code 1 (ReadDeviceIDCodeBasic):\n```sh\n./modbus-cli -address=tcp://127.0.0.1:502 -fn-code=43 -device-id-code=1\n```\n\n## Release\n\nTo release the Modbus-CLI tool, run either `make release` if you have installed `goreleaser` or `make ci_release`.\nThe generated files can be found in the directory in the `dist` directory.\n\nTake the `.tar.gz` and `.zip` files and create a new GitHub release.\n\n# References\n- [Modbus Specifications and Implementation Guides](http://www.modbus.org/specs.php)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrid-x%2Fmodbus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrid-x%2Fmodbus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrid-x%2Fmodbus/lists"}