{"id":49444284,"url":"https://github.com/alexs-sh/modbus-tools","last_synced_at":"2026-04-29T21:13:06.107Z","repository":{"id":44151591,"uuid":"511979188","full_name":"alexs-sh/modbus-tools","owner":"alexs-sh","description":"Tool(s) for working with Modbus protocol written in Rust.A fork from my GitLab repo","archived":false,"fork":false,"pushed_at":"2025-02-17T20:12:32.000Z","size":711,"stargazers_count":12,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-03-25T23:12:55.566Z","etag":null,"topics":["converter","embedded","emulator","modbus","modbus-rtu","modbus-slave","modbus-tcp","orange","protocol","raspberrypi","rust","tcp","udp"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexs-sh.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}},"created_at":"2022-07-08T17:42:26.000Z","updated_at":"2025-12-03T17:37:39.000Z","dependencies_parsed_at":"2023-10-31T00:00:25.717Z","dependency_job_id":null,"html_url":"https://github.com/alexs-sh/modbus-tools","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/alexs-sh/modbus-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexs-sh%2Fmodbus-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexs-sh%2Fmodbus-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexs-sh%2Fmodbus-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexs-sh%2Fmodbus-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexs-sh","download_url":"https://codeload.github.com/alexs-sh/modbus-tools/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexs-sh%2Fmodbus-tools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32443849,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T20:22:27.477Z","status":"ssl_error","status_checked_at":"2026-04-29T20:22:26.507Z","response_time":110,"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":["converter","embedded","emulator","modbus","modbus-rtu","modbus-slave","modbus-tcp","orange","protocol","raspberrypi","rust","tcp","udp"],"created_at":"2026-04-29T21:13:05.337Z","updated_at":"2026-04-29T21:13:06.101Z","avatar_url":"https://github.com/alexs-sh.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Table of contents\n* [About](#about)\n* [Tools](#tools)\n    * [slave-rnd](#tools-slave-rnd)\n    * [slave-exchange](#tools-slave-exchange)\n* [Implementation details](#implementation-details)\n* [Cross compile](#cross-compile)\n* [Online examples](#online-examples)\n\n\u003ca name=\"about\"\u003e\u003c/a\u003e\n## About\n[![Build Status](https://gitlab.com/alexs-sh/modbus-tools/badges/master/pipeline.svg)](https://gitlab.com/alexs-sh/modbus-tools/-/commits/master)\n[![Coverage](https://gitlab.com/alexs-sh/modbus-tools/badges/master/coverage.svg)](https://gitlab.com/alexs-sh/modbus-tools/-/commits/master)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nTools for working with Modbus protocol powered by Rust/Tokio. Apps are available\nonline. See [here](#online-examples) for details.\n\n\u003ca name=\"tools\"\u003e\u003c/a\u003e\n## Tools\n\n\u003ca name=\"tools-slave-rnd\"\u003e\u003c/a\u003e\n### slave-rnd\n\nSlave emulator that generates random answers to read requests\nand positively acknowledges on write commands. Useful for fast check of Modbus\nmasters like SCADA systems, custom client implementations, etc.\n\n![](docs/pics/slave-rnd.gif)\n\nThe easiest way is to build and run via Cargo. By default, Modbus TCP uses 502\nport that, in most cases, requires root privileges. Therefore all examples are\npresented on port 1502.\n\n```\ncargo run --bin slave-rnd tcp:0.0.0.0:1502\n..\n[2022-07-08T14:49:25Z INFO  slave_rnd] start server 0.0.0.0:1502\n[2022-07-08T14:49:25Z INFO  slave_rnd] start message processor\n[2022-07-08T14:49:25Z INFO  slave_rnd] press Ctrl+C to exit\n[2022-07-08T14:49:27Z INFO  transport::tcp::server] 127.0.0.1:44544 connected\n[2022-07-08T14:49:30Z INFO  transport::tcp::server] 127.0.0.1:44548 connected\n```\n\nRun with verbose output.\n\n```\nRUST_LOG=trace cargo run --bin slave-rnd tcp:0.0.0.0:1502\n...\n[2022-07-08T14:50:16Z INFO  slave_rnd] start server 0.0.0.0:1502\n[2022-07-08T14:50:16Z INFO  slave_rnd] start message processor\n[2022-07-08T14:50:16Z INFO  slave_rnd] press Ctrl+C to exit\n[2022-07-08T14:50:16Z INFO  transport::tcp::server] 127.0.0.1:56896 connected\n[2022-07-08T14:50:17Z DEBUG codec::net::default] 127.0.0.1:56896 unpack [0, 197, 0, 0, 0, 6, 1, 3, 0, 0, 0, 10]\n[2022-07-08T14:50:17Z DEBUG transport::tcp::server] 127.0.0.1:56896 RequestFrame { id: Some(197), slave: 1, pdu: ReadHoldingRegisters { address: 0, nobjs: 10 } }\n[2022-07-08T14:50:17Z DEBUG transport::tcp::server] 127.0.0.1:56896 ResponseFrame { id: Some(197), slave: 1, pdu: ReadHoldingRegisters { nobjs: 10, data: Data { buffer: [145, 4, 173, 2, 122, 70, 61, 128, 56, 198, 89, 37, 62, 72, 5, 186, 233, 123, 79, 21] } } }\n[2022-07-08T14:50:17Z DEBUG codec::net::default] 127.0.0.1:56896 pack [0, 197, 0, 0, 0, 23, 1, 3, 20, 4, 145, 2, 173, 70, 122, 128, 61, 198, 56, 37, 89, 72, 62, 186, 5, 123, 233, 21, 79]\n[2022-07-08T14:50:17Z DEBUG codec::net::default] 127.0.0.1:56896 unpack [0, 198, 0, 0, 0, 6, 1, 3, 0, 0, 0, 10]\n..\n```\n\nRun in serial mode.\n\n```\ncargo run --bin slave-rnd serial:/dev/ttyUSB0:38400-8-N-1\n```\n\n\u003ca name=\"tools-slave-exchange\"\u003e\u003c/a\u003e\n### slave-exchange\n\nA slave emulator allows connecting N masters. Some masters can write into\nregisters, and others can read. Typical usage is temporary storage for\nconnecting different components of a system.\n\n![](docs/pics/slave-exchange.gif)\n\nRunning:\n\n```\ncargo run --bin slave-exchange tcp:0.0.0.0:1502 udp:0.0.0.0:1502 serial:/dev/ttyUSB0:9600-8-N-1\n..\n[2022-12-07T19:43:18Z INFO  transport::builder] start tcp server 0.0.0.0:1502\n[2022-12-07T19:43:18Z INFO  transport::builder] start udp server 0.0.0.0:1502\n[2022-12-07T19:43:18Z INFO  transport::builder] start rtu slave /dev/ttyUSB0:9600-8-N-1\n[2022-12-07T19:43:18Z INFO  slave_exchange] press Ctrl+C to exit\n```\n\n\u003ca name=\"implementation-details\"\u003e\u003c/a\u003e\n## Implementation details\n\nSupported modes:\n\n- [x] Slave\n- [ ] Master\n\nSupported transport: \n\n- [x] TCP\n- [x] UDP\n- [x] Serial\n\nSupported functions: \n\n- [x] 0x01 Read Coils\n- [x] 0x02 Read Discrete Inputs\n- [x] 0x03 Read Holding Registers\n- [x] 0x04 Read Input Registers\n- [x] 0x05 Write Single Coil\n- [x] 0x06 Write Single Register\n- [ ] 0x07 Read Exception Status\n- [ ] 0x08 Diagnostics\n- [ ] 0x0B Get Comm Event Counter\n- [ ] 0x0C Get Comm Event Log\n- [x] 0x0F Write Multiple Coils\n- [x] 0x10 Write Multiple registers\n- [ ] 0x11 Report Slave ID\n- [ ] 0x14 Read File Record\n- [ ] 0x15 Write File Record\n- [ ] 0x16 Mask Write Register\n- [ ] 0x17 Read/Write Multiple registers\n- [ ] 0x18 Read FIFO Queue\n- [ ] 0x2B/0x0D Encapsulated Interface Transport\n- [x] 0x2B/0x0E Encapsulated Interface Transport. Read Device Identification\n\n\n\n\u003ca name=\"cross-compile\"\u003e\u003c/a\u003e\n## Cross-compile\n\n#### ARMv7\n\nARMv7 binaries could be run, for example, on Raspperry PI (32 bit) or iMX6UL.\n\n```\ncargo build --target=armv7-unknown-linux-gnueabihf \n```\n\n#### Windows 10\n\n```\ncargo build --release --target=x86_64-pc-windows-gnu\n```\n\n\u003ca name=\"online-examples\"\u003e\u003c/a\u003e\n## Online examples\n\nslave-rnd - 173.212.202.137:502. TCP and UDP transport is enabled.\n\nslave-exchange - 173.212.202.137:1502. TCP and UDP transport is enabled.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexs-sh%2Fmodbus-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexs-sh%2Fmodbus-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexs-sh%2Fmodbus-tools/lists"}