{"id":37118463,"url":"https://github.com/favalex/modbus-cli","last_synced_at":"2026-01-14T13:50:27.319Z","repository":{"id":45980141,"uuid":"93306512","full_name":"favalex/modbus-cli","owner":"favalex","description":"Command line tool to access Modbus devices","archived":false,"fork":false,"pushed_at":"2025-02-03T06:37:50.000Z","size":88,"stargazers_count":205,"open_issues_count":15,"forks_count":35,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-08-18T06:40:35.885Z","etag":null,"topics":["cli","modbus","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/favalex.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2017-06-04T10:37:32.000Z","updated_at":"2025-07-26T19:35:48.000Z","dependencies_parsed_at":"2024-06-09T17:47:04.070Z","dependency_job_id":"0388ae80-cfcb-4830-94fb-0361108b1797","html_url":"https://github.com/favalex/modbus-cli","commit_stats":{"total_commits":104,"total_committers":9,"mean_commits":"11.555555555555555","dds":"0.16346153846153844","last_synced_commit":"c889b6d5f463d4f4de3cc4dfc43924f23076cf41"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/favalex/modbus-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/favalex%2Fmodbus-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/favalex%2Fmodbus-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/favalex%2Fmodbus-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/favalex%2Fmodbus-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/favalex","download_url":"https://codeload.github.com/favalex/modbus-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/favalex%2Fmodbus-cli/sbom","scorecard":{"id":393971,"data":{"date":"2025-08-11","repo":{"name":"github.com/favalex/modbus-cli","commit":"aa4067009ef42266667ffdf84e56ca7962c0cd48"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-app.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/favalex/modbus-cli/python-app.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-app.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/favalex/modbus-cli/python-app.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/python-app.yml:25","Warn: pipCommand not pinned by hash: .github/workflows/python-app.yml:26","Warn: pipCommand not pinned by hash: .github/workflows/python-app.yml:27","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 pipCommand dependencies pinned"],"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":"Code-Review","score":3,"reason":"Found 6/18 approved changesets -- score normalized to 3","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":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/python-app.yml:1","Info: no jobLevel write permissions found"],"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":"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Mozilla Public License 2.0: 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":-1,"reason":"no releases found","details":null,"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":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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":"SAST","score":-1,"reason":"internal error: internal error: Client.Checks.ListCheckRunsForRef: error during graphqlHandler.setupCheckRuns: non-200 OK status code: 502 Bad Gateway body: \"\u003chtml\u003e\\r\\n\u003chead\u003e\u003ctitle\u003e502 Bad Gateway\u003c/title\u003e\u003c/head\u003e\\r\\n\u003cbody\u003e\\r\\n\u003ccenter\u003e\u003ch1\u003e502 Bad Gateway\u003c/h1\u003e\u003c/center\u003e\\r\\n\u003chr\u003e\u003ccenter\u003enginx\u003c/center\u003e\\r\\n\u003c/body\u003e\\r\\n\u003c/html\u003e\\r\\n\"","details":null,"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-18T18:30:03.564Z","repository_id":45980141,"created_at":"2025-08-18T18:30:03.564Z","updated_at":"2025-08-18T18:30:03.564Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28422355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T13:30:50.153Z","status":"ssl_error","status_checked_at":"2026-01-14T13:29:08.907Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["cli","modbus","python"],"created_at":"2026-01-14T13:50:26.675Z","updated_at":"2026-01-14T13:50:27.308Z","avatar_url":"https://github.com/favalex.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"=========\nmodbus\n=========\n\n---------------------------------------------\nAccess Modbus devices from the command line\n---------------------------------------------\n\n:Author: favalex@gmail.com\n:Date: 2023-02-26\n:Copyright: MPL 2.0\n:Version: 0.1.10\n:Manual section: 1\n\nSYNOPSIS\n========\n\n  modbus [-h] [-r REGISTERS] [-s SLAVE_ID] [-b BAUD] [-p STOP_BITS] [-P {e,o,n}] [-v] device access [access ...]\n\nDESCRIPTION\n===========\n\nRead and write registers of Modbus devices.\n\nAccess both TCP and RTU (i.e. serial) devices and encode and decode types\nlarger than 16 bits (e.g. floats) into Modbus 16 bits registers.\n\nOptionally access registers by symbolic names, as defined in a registers file.\nSymbolic names for enumerations and bitfields are supported too.\n\nDesigned to work nicely with other standard UNIX tools (``watch``, ``socat``,\netc.), see the examples.\n\nImplemented in python on top of the protocol implementation provided by the\numodbus python library.\n\nINSTALL\n=======\n\nRegular python install, either ``pip install modbus_cli`` to install from pypi\nor ``python setup.py install`` to install from source.\n\nOPTIONS\n=======\n\ndevice\n  ``/dev/ttyXXX`` for serial devices, or ``hostname[:port]`` for TCP devices\n\naccess\n  One or more read or write operations. See ACCESS SYNTAX below.\n\n-r FILE, --registers=FILE     Read registers definitions from FILE. Can be specified multiple times.\n-v, --verbose                 Print on screen the bytes transferred on the wire.\n-b BAUD, --baud=BAUD          Set the baud rate for serial connections.\n-p BITS, --stop-bits=BITS     Set the number of stop bits for serial connections.\n-P PARITY, --parity=PARITY    Set the parity for serial connections: (e)ven, (o)dd or (n)one\n-B ORDER, --byte-order=ORDER  Set the byte order to one of 'le' (little endian), 'be' (big endian) or 'mixed'\n-h, --help                    Show this help message and exit.\n\nACCESS SYNTAX\n=============\n\n::\n\n  [MODBUS_TYPE@]ADDRESS[/BINARY_TYPE][:ENUMERATION_NAME][=VALUE]\n\nMnemonic: access the register(s) of MODBUS_TYPE starting *at* ADDRESS,\ninterpreting them as BINARY_TYPE. The ``/`` syntax is inspired by gdb (but the\navailable types are different.)\n\nMODBUS_TYPE = h|H|i|c|C|d\n  The modbus type, one of\n\n  ========== ================ ======= =========\n  code       name             size    writable\n  ========== ================ ======= =========\n  ``h or H`` holding register 16 bits yes\n  ``i``      input register   16 bits no\n  ``c or C`` coil             1 bit   yes\n  ``d``      discrete input   1 bit   no\n  ========== ================ ======= =========\n\n  Types ``C`` and ``H`` force the use of \"write multiple registers\" even when accessing a single register.  This\n  is useful for some devices that don't support singular write functions.\n\n\n  The default modbus type is holding register.\n\nADDRESS = \u003cnumber\u003e\n  0-based register address\n\nBINARY_TYPE = \u003cpack format\u003e\n  Any format description accepted by the python standard ``pack`` module. Some common formats are:\n\n  ===== ====\n  code  type\n  ===== ====\n  ``h`` 16 bits signed integer\n  ``H`` 16 bits unsigned integer\n  ``i`` 32 bits signed integer\n  ``I`` 32 bits unsigned integer\n  ``f`` 32 bits IEEE 754 float\n  ===== ====\n\n  The default byte order is big-endian.\n  To use little endian, use a ``\u003c`` prefix, or ``--byte-order=le``.\n  To use mixed endian (little endian, but individual 16 bit registers are big endian), use ``--byte-order=mixed``.\n\nVALUE = \u003cnumber\u003e\n  The value to be written to the register. If not present, the register will be read instead.\n\n  If only one register is written to, the modbus function ``6 (0x6)``, \"write single register\" is used.\n  If multiple registers are written to, the modbus function ``16 (0x10)``, \"write multiple registers\" is used.\n\nEXAMPLES\n========\n\nRead a holding register\n-----------------------\n\n::\n\n  $ modbus $IP_OF_MODBUS_DEVICE 100\n\nWrite a holding register\n------------------------\n\n::\n\n  $ modbus $IP_OF_MODBUS_DEVICE 100=42\n\nRead multiple registers\n-----------------------\n\nTo read (or write) multiple registers simply list them on the command line::\n\n  $ modbus $IP_OF_MODBUS_DEVICE 100 c@2000\n\nWhen performing access to multiple contiguous registers, one single modbus operation is performed.\n\nWhen multiple modbus operations are needed, they are all initiated at once, and\nthe results are collected as they arrive.\n\nMore examples of the access syntax\n----------------------------------\n\n==================== ====\n``h@39/I``           read the 32-bits unsigned integer stored in holding registers at addresses 39 and 40\n``39/I``             same as above (h is the default modbus type)\n``39/I=42``          write the integer 42 to that register\n``SOME_REGISTER=42`` same as above, provided the registers file contains the definition ``SOME_REGISTER h@39/I``\n``39/I=0xcafe``      the value can be specified in hexadecimal\n``c@5``              read coil at address 5\n``h@24/f=6.78``      write a floating point value to holding registers at addresses 24 and 25\n``i@1/6B``           read six unsigned bytes stored in input registers at addresses 1, 2 and 3\n==================== ====\n\nMonitor a register\n------------------\n\nThe UNIX command ``watch`` can be used to read a register at regular intervals::\n\n  $ watch modbus $IP_OF_MODBUS_DEVICE 100\n\nRead a serial device attached to a remote computer\n--------------------------------------------------\n\nThe UNIX command ``socat`` can be used to access a remote device through a TCP\ntunnel::\n\n  remote$ socat -d -d tcp-l:54321,reuseaddr file:/dev/ttyUSB0,raw,b19200\n  local$ socat -d -d tcp:sc:54321 pty,waitslave,link=/tmp/local_device,unlink-close=0\n  local$ modbus /tmp/local_device 100\n\nRead multiple registers based on their names\n--------------------------------------------\n\nGiven the following registers definitions::\n\n  $ cat registers.modbus\n  di0 d@0\n  di1 d@1\n  ai0 i@512\n  ai1 i@513\n\nglob matching (\\*, ?, etc.) can be used to read all the ``ai`` registers at once::\n\n  $ modbus -r registers.modbus $IP_OF_MODBUS_DEVICE ai\\*\n\nREGISTERS FILES\n=====================\n\nThe purpose of the registers files is to be able to refer to registers by name.\n\nThere can be multiple definition files, specified using either the ``-r``\ncommand line switch or the ``MODBUS_DEFINITIONS`` environment variable.\n\nA ``#`` in a definition file starts a comment.\n\nEach line contains a symbolic name followed by a register definition. The name\nand the definitions are separated by spaces, for example::\n\n  status i@512:STATUS\n  leds 513:LEDS\n\nThe file can also contain the possible values for an enumeration or a bitmask,\nfor example::\n\n  # This is an enumeration named STATUS\n  :STATUS\n    0=OFF\n    1=ON\n    2=ERROR\n\n  # This is a bitmask named LEDS\n  |LEDS\n    0=LED0\n    1=LED1\n    3=LED3\n    4=LED4\n\nENVIRONMENT\n===========\n\nMODBUS_DEFINITIONS\n  A colon separated list of register definitions files.\n\nSEE ALSO\n========\n\n* `modbus \u003chttps://en.wikipedia.org/wiki/Modbus\u003e`__\n* `umodbus \u003chttps://pypi.python.org/pypi/uModbus\u003e`__\n* `pack format \u003chttps://docs.python.org/3/library/struct.html#format-characters\u003e`__\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffavalex%2Fmodbus-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffavalex%2Fmodbus-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffavalex%2Fmodbus-cli/lists"}