{"id":39016095,"url":"https://github.com/3cky/mbusd","last_synced_at":"2026-01-17T17:24:59.950Z","repository":{"id":33419988,"uuid":"37065238","full_name":"3cky/mbusd","owner":"3cky","description":"Open-source Modbus TCP to Modbus RTU (RS-232/485) gateway.","archived":false,"fork":false,"pushed_at":"2025-12-01T12:57:30.000Z","size":923,"stargazers_count":634,"open_issues_count":21,"forks_count":239,"subscribers_count":59,"default_branch":"master","last_synced_at":"2025-12-04T01:33:57.952Z","etag":null,"topics":["gateway","modbus","modbus-rtu","modbus-tcp"],"latest_commit_sha":null,"homepage":"","language":"C","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/3cky.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2015-06-08T12:23:59.000Z","updated_at":"2025-12-03T00:55:24.000Z","dependencies_parsed_at":"2022-07-12T16:10:28.784Z","dependency_job_id":"ebbdfd43-f092-49ff-ba61-7d9cdb6b4959","html_url":"https://github.com/3cky/mbusd","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/3cky/mbusd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3cky%2Fmbusd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3cky%2Fmbusd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3cky%2Fmbusd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3cky%2Fmbusd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/3cky","download_url":"https://codeload.github.com/3cky/mbusd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3cky%2Fmbusd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28512901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"last_error":"SSL_read: 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":["gateway","modbus","modbus-rtu","modbus-tcp"],"created_at":"2026-01-17T17:24:59.821Z","updated_at":"2026-01-17T17:24:59.923Z","avatar_url":"https://github.com/3cky.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"About mbusd\n===========\n\n[![mbusd](https://github.com/3cky/mbusd/actions/workflows/build.yml/badge.svg)](https://github.com/3cky/mbusd/actions/workflows/build.yml)\n\n**mbusd** is open-source [Modbus TCP to Modbus RTU (RS-232/485)](https://en.wikipedia.org/wiki/Modbus)\ngateway. It presents a network of RTU slaves as single TCP slave.\n\nThat is a TCP-Slave (or server) which acts as a RTU-master to get data from Modbus RTU-slave devices.\n\nFeatures:\n---------\n\n* Small footprint - suitable to run on embedded devices and SBCs like Raspberry Pi\n* Multi-master - multiple TCP masters can access slave devices in RTU network using same gateway\n* Robustness - can retry requests with mismatched response CRC\n* Flexible RTU modes - speed/parity/stop-bits/timeouts can be configured for RTU network\n* Support for both of automatic and manual (using RTS bit) direction control types for RS-485 transceivers\n\nSupported function codes:\n-------------------------\n\n* 01: Read coil status\n* 02: Read input status\n* 03: Read holding registers\n* 04: Read input registers\n* 05: Force single coil\n* 06: Preset single register\n* 07: Read exception status\n* 15: Force multiple coils\n* 16: Preset multiple registers\n\nPlease note all other function codes (including vendor-specific extensions) are supported on a \"best-effort\" basis and most likely will fail.\n\nInstallation instructions:\n----------------------------\n\n```\n$ git clone https://github.com/3cky/mbusd.git mbusd.git\n$ cd mbusd.git\n$ mkdir -p build \u0026\u0026 cd build\n$ cmake -DCMAKE_INSTALL_PREFIX=/usr ..\n$ make\n$ sudo make install\n```\n\n***Compile time options***\ncan be altered in many ways, e.g. by using the following tools in the `build` dir:\n* ccmake - usually in the package cmake-curses-gui\n* cmake-gui - usually in the package cmake-qt-gui\n\nUsage:\n------\n\n       mbusd [-h] [-d] [-L logfile] [-v level] [-c cfgfile] \n             [-p device] [-s speed] [-m mode] [-S]\n             [-t] [-r] [-y sysfsfile] [-Y sysfsfile] \n             [-A address] [-P port] [-C maxconn] [-N retries]\n             [-R pause] [-W wait] [-T timeout] [-b]\n\n       -h     Usage help.\n       -d     Instruct mbusd not to fork itself (non-daemonize).\n       -L logfile\n              Specifies log file name ('-' for logging to STDOUT only, relative path or bare filename\n              will be stored at /var/log, default is /var/log/mbusd.log).\n       -v level\n              Specifies log verbosity level (0 for errors only, 1 for warnings and 2 for informational \n              messages also). If mbusd was compiled in debug mode, valid log levels are up to 9, \n              where log levels above 2 adds logging of information about additional internal events.\n       -c cfgfile\n              Read configuration from cfgfile.\n       -p device\n              Specifies serial port device name.\n       -s speed\n              Specifies serial port speed.\n       -m mode\n              Specifies serial port mode (like 8N1).\n       -S     Enable RS-485 support for given serial port device (Linux only)\n       -t     Enable RTS RS-485 data direction control using RTS, active transmit.\n       -r     Enable RTS RS-485 data direction control using RTS, active receive.\n       -y sysfsfile\n              Enable RS-485 direction data direction control by writing '1' to sysfs file\n              for transmitter enable and '0' to file for transmitter disable.\n       -Y sysfsfile\n              Enable RS-485 direction data direction control by writing '0' to sysfs file\n              for transmitter enable and '1' to file for transmitter disable.\n       -A address\n             Specifies TCP server address to bind (default is 0.0.0.0).\n       -P port\n              Specifies TCP server port number (default is 502).\n       -C maxconn\n              Specifies maximum number of simultaneous TCP connections (default is 32).\n       -N retries\n              Specifies maximum number of request retries (0 disables retries, default is 3).\n       -R pause\n              Specifies pause between requests in milliseconds (default is 100ms).\n       -W wait\n              Specifies response wait time in milliseconds (default is 500ms).\n       -T timeout\n              Specifies connection timeout value in seconds (0 disables timeout, default is 60).\n       -b\n              Instructs mbusd to reply on a broadcast.\n\nPlease note running **mbusd** on default Modbus TCP port (502) requires root privileges!\n\nConfiguration file:\n-------------------\n**mbusd** can read the configuration from a file specified by `-c` command line flag.\nPlease see [example configuration file](conf/mbusd.conf.example)\nfor complete list of available configuration options.\n\nsystemd:\n---------------\n\n**mbusd** has [systemd](https://wiki.archlinux.org/index.php/systemd) support.\nThe build system detects whether the system has systemd after which `sudo make install`\ninstalls the `mbusd@.service` file on systems with systemd active.\n\nThe **mbusd** service can be started via:\n\n\t# systemctl start mbusd@\u003cserial port\u003e.service\n\nwhere `\u003cserial port\u003e` is escaped serial port device short name (like `ttyUSB0` for `/dev/ttyUSB0` device name or `serial-rs485` for `/dev/serial/rs485` device name).\n\n**mbusd** started by systemd will read its configuration from file named `/etc/mbusd/mbusd-\u003cserial port\u003e.conf`.\nThis way it's possible to run multiple **mbusd** instances with different configurations.\n\nTo see the **mbusd** service status:\n\n\t# systemctl status mbusd@\u003cserial port\u003e.service\n\nTo monitor the **mbusd** service:\n\n\t# journalctl -u mbusd@\u003cserial port\u003e.service -f -n 10\n\nTo start the **mbusd** service on system boot:\n\n\t# systemctl enable mbusd@\u003cserial port\u003e.service\n\nPlease check systemd documentation for other usefull systemd [commands](https://wiki.archlinux.org/index.php/systemd).\n\nDocker:\n-------\n\n**mbusd** can be launched in Docker container with the following command:\n\n```shell\ndocker run -d --privileged \\\n    --name=mbusd \\\n    -p 502:502 \\\n    -v /dev:/dev \\\n    -v /path/to/mbusd.conf:/etc/mbusd.conf \\\n    3cky/mbusd:latest\n```\n\nwhere `/path/to/mbusd.conf` is the path to **mbusd** config file in the local filesystem.\n\nContributing:\n-------------\n\n### Reporting bugs\n\nPlease file [issue](https://github.com/3cky/mbusd/issues) with attached debug log in verbose (`-v9`) mode, i.e.:\n\n       # mbusd -L/tmp/mbusd.log -p /dev/ttyUSB0 -s 9600 -P 502 -d -v9\n\nUnless you were prompted so or there is another pertinent reason (e.g. GitHub fails to accept the bug report),\nplease do not send bug reports via personal email.\n\n### Workflow for code contributions\n\n1. Fork it and clone forked repository\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Make your changes\n4. Commit your changes (`git commit -am 'Add some feature'`)\n5. Push to the branch (`git push origin my-new-feature`)\n6. Create new Pull Request\n\n### Building and Testing\n\nDependencies: please see the correct OS-distribution section in the\n [.gitlab-ci.yml](https://github.com/3cky/mbusd/blob/master/.gitlab-ci.yml)\n\nWith all dependencies met, one is able to *build and execute tests*\nissuing the following *bash* commands:\n```\n# build\nmkdir output.dir/ \u0026\u0026 cd $_\ncmake ../ \u0026\u0026 make\n# execute all tests\n(cd ../ \u0026\u0026 python tests/run_itests.py output.dir/mbusd)\n```\n\nAuthor:\n-------\n\nVictor Antonovich (\u003cv.antonovich@gmail.com\u003e)\n\nContributors:\n-------------\n\nAndrew Denysenko (\u003cnitr0@seti.kr.ua\u003e):\n - RTS RS-485 data direction control\n - RTU response receiving by length\n\nJames Jarvis (\u003cjj@aprsworld.com\u003e):\n - file based RS-485 data direction control\n\nLuuk Loeffen (\u003cluukloeffen@hotmail.com\u003e):\n - systemd support\n\nNick Mayerhofer (\u003cnick.mayerhofer@enchant.at\u003e):\n - CMake build system\n\nLicense:\n--------\n\nThis project is distributed under the BSD license. See the [LICENSE](LICENSE) file for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3cky%2Fmbusd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F3cky%2Fmbusd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3cky%2Fmbusd/lists"}