{"id":49222947,"url":"https://github.com/jackcvr/mbsc","last_synced_at":"2026-04-24T05:03:08.282Z","repository":{"id":352344343,"uuid":"1196601078","full_name":"jackcvr/mbsc","owner":"jackcvr","description":"A Modbus command-line interface.","archived":false,"fork":false,"pushed_at":"2026-04-19T04:47:39.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-19T06:18:55.194Z","etag":null,"topics":["cpp","modbus"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jackcvr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2026-03-30T21:22:14.000Z","updated_at":"2026-04-19T04:47:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jackcvr/mbsc","commit_stats":null,"previous_names":["jackcvr/mbsc"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jackcvr/mbsc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackcvr%2Fmbsc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackcvr%2Fmbsc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackcvr%2Fmbsc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackcvr%2Fmbsc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jackcvr","download_url":"https://codeload.github.com/jackcvr/mbsc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackcvr%2Fmbsc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32209897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T03:15:14.334Z","status":"ssl_error","status_checked_at":"2026-04-24T03:15:11.608Z","response_time":64,"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":["cpp","modbus"],"created_at":"2026-04-24T05:03:04.657Z","updated_at":"2026-04-24T05:03:08.277Z","avatar_url":"https://github.com/jackcvr.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mbsc\n\n`mbsc` is a lightweight, interactive Modbus command-line tool.\nIt supports both single-shot commands for scripting and an interactive REPL for real-time device interaction.\n\n## Features\n\n* Interactive REPL.\n* Background traffic sniffing.\n* Support for standard Modbus functions (Read/Write Coils, Registers).\n* Raw PDU frame transmission.\n\n## Usage\n\nNote: all the payload(printed and expected) is in hexidecimal format, while `slave_id`, `address` and `count` can be in both hexidecimal or decimal formats.\n\n```text\nUsage: ./mbsc [-s] [-o device,baud_rate,parity,data_bits,stop_bits] [\u003caction(rb|rr|rib|rir|wb|wr|req)\u003e \u003cslave_id\u003e \u003caddress\u003e [\u003ccount|payload\u003e]]\n\nConnection Parameters (-o, comma-separated, omit to use defaults):\n  device      (default: /dev/ttyUSB0)\n  baud_rate   (default: 115200)\n  parity      (default: N)\n  data_bits   (default: 8)\n  stop_bits   (default: 1)\n\nOptions:\n  -h, --help    Show this help message and exit\n  -s            Enable background sniffing (Interactive mode only)\n  -o \u003cparams\u003e   Connection parameters\n\nExecution Modes:\n  Interactive:  Run without an action command. Opens a REPL.\n  Single-shot:  Provide an action command to execute it once and exit.\n\nExamples:\n  ./mbsc -o /dev/ttyS0,9600,E           (Interactive: Changes device, baud_rate, parity)\n  ./mbsc -s -o /dev/ttyUSB1             (Interactive: Enable sniffer on custom device)\n  ./mbsc rr 1 0x64 2                    (Single-shot: Read 2 registers from slave 1 at addr 0x64)\n\nActions:\n  req \u003cframe\u003e                                 - Send raw frame\n  wb  \u003cslave_id\u003e \u003caddress\u003e \u003cpayload\u003e          - Write Bit(s)\n  rb  \u003cslave_id\u003e \u003caddress\u003e \u003ccount\u003e            - Read Bit(s)\n  wr  \u003cslave_id\u003e \u003caddress\u003e \u003cpayload\u003e          - Write Register(s)\n  rr  \u003cslave_id\u003e \u003caddress\u003e [\u003ccount\u003e]          - Read Register(s)\n  rib \u003cslave_id\u003e \u003caddress\u003e [\u003ccount\u003e]          - Read Input Bit(s)\n  rir \u003cslave_id\u003e \u003caddress\u003e [\u003ccount\u003e]          - Read Input Register(s)\n```\n\n## Examples\n\n```bash\n# read holding registers\n\u003e rr 1 0x62 2\n00110011\n\n# write bits\n\u003e wb 2 50 01000101\n01000101\n\n# write single register\n\u003e wr 5 10 ff00\nff00\n\n# read discrete input bits\n\u003e rib 1 0 4\n01010000\n\n# raw ADU request\n\u003e req 01030062000265D5\n010304001100116a3a\n\n# error handling (printed to stderr)\n\u003e rr 1 0x64 2\nmodbus: modbus exception 2: illegal data address\n\n# sniffer output (started with -s)\n01030062000265D5\n010304001100118AA9\n```\n\n## Dependencies\n\nTo build `mbsc`, you need the following:\n\n* **C++ Compiler:** Must support C++23 (e.g., GCC 13+ or Clang 16+)\n* **Build Tools:** `make`, `pkg-config`, `wget`\n* **Libraries:** `libreadline-dev`, `libncurses-dev` (required for interactive REPL)\n* **Cross-compilation (Optional):** Docker with `buildx` emulation support\n\n## Building\n\nTo build `mbsc` for your current host machine (defaults to amd64), run:\n\n```bash\nmake\n```\n\nThe statically linked executable will be generated at build/mbsc.amd64 (or your specified ARCH).\n\n#### Cross-Compiling (Docker Buildx)\n\nCross-compilation is fully containerized using Docker Buildx and QEMU emulation. To build for a different architecture (e.g., arm64, armhf), run:\n\n```bash\nmake buildx ARCH=arm64\n```\n\nThis automatically registers the QEMU emulators, builds the toolchain container, and outputs the cross-compiled binary to the build/ directory.\n\n## License\n\n[MIT](https://spdx.org/licenses/MIT.html)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackcvr%2Fmbsc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjackcvr%2Fmbsc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackcvr%2Fmbsc/lists"}