{"id":19457683,"url":"https://github.com/pymodbus-dev/repl","last_synced_at":"2025-04-25T05:31:23.017Z","repository":{"id":222317304,"uuid":"756898355","full_name":"pymodbus-dev/repl","owner":"pymodbus-dev","description":"REPL client and server for pymodbus","archived":false,"fork":false,"pushed_at":"2025-01-22T02:31:41.000Z","size":536,"stargazers_count":8,"open_issues_count":6,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-03T17:22:19.404Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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/pymodbus-dev.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}},"created_at":"2024-02-13T14:24:25.000Z","updated_at":"2025-01-22T09:21:09.000Z","dependencies_parsed_at":"2024-08-11T14:44:19.973Z","dependency_job_id":"fc787cbb-19cf-42d9-8bb1-d3419142096b","html_url":"https://github.com/pymodbus-dev/repl","commit_stats":null,"previous_names":["pymodbus-dev/repl"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pymodbus-dev%2Frepl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pymodbus-dev%2Frepl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pymodbus-dev%2Frepl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pymodbus-dev%2Frepl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pymodbus-dev","download_url":"https://codeload.github.com/pymodbus-dev/repl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250760795,"owners_count":21482869,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-10T17:23:23.035Z","updated_at":"2025-04-25T05:31:22.145Z","avatar_url":"https://github.com/pymodbus-dev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pymodbus-REPL\n\nPymodbus-REPL is a REPL (Read-Eval-Print Loop) tool for working with Modbus devices using the Pymodbus library.\n\n## Development Setup\n\n### Prerequisites\n\n- Python 3.8+\n- Poetry (installed globally or within a virtual environment)\n\n### Dev instructions\n\n1. Clone the repository:\n\n   `git clone https://github.com/pymodbus-dev/repl.git`\n\n2. Navigate to the project directory:\n\n    `cd repl`\n\n3. Install dependencies using Poetry: \n\n    `poetry install`\n\n**NOTE** This repo is meant to be an helper for [pymodbus](https://github.com/pymodbus-dev/pymodbus) and the usage requires\na working version of pymodbus.\n\nThe installed `pymodbus` library for local development can also have impact on the path resolution while working locally on this repo.\nTo overcome that problem, please make sure to run the [client](./pymodbus/client/main.py) and [server](./pymodbus/server/main.py) files\nfrom with in the respective working directories.\n\nFor .e.g\n\n#### Run Server\n```\n(pymodbus3.8)\n❯ python3 main.py --host 0.0.0.0 --verbose run --modbus-config default_config.json --modbus-server tcp --modbus-framer socket --modbus-port 5020 --unit-id 1 --unit-id 2 -u 4 -r 1 --timeout 2\n2024-02-28 14:38:24,952 INFO  logging:97 Modbus server started\n2024-02-28 14:38:24,952 DEBUG logging:103 Awaiting connections server_listener\n2024-02-28 14:38:24,952 INFO  logging:97 Server listening.\n\n__________                          .______.                    _________\n\\______   \\___.__. _____   ____   __| _/\\_ |__  __ __  ______  /   _____/ ______________  __ ___________\n |     ___\u003c   |  |/     \\ /  _ \\ / __ |  | __ \\|  |  \\/  ___/  \\_____  \\_/ __ \\_  __ \\  \\/ // __ \\_  __ \\\\\n |    |    \\___  |  Y Y  (  \u003c_\u003e ) /_/ |  | \\_\\ \\  |  /\\___ \\   /        \\  ___/|  | \\/\\   /\\  ___/|  | \\/\n |____|    / ____|__|_|  /\\____/\\____ |  |___  /____//____  \u003e /_______  /\\___  \u003e__|    \\_/  \\___  \u003e__|\n           \\/          \\/            \\/      \\/           \\/          \\/     \\/                 \\/\n                                                                                                v2.0.2-Pymodbus3.7.0dev\n\n\nSERVER \u003e 2024-02-28 14:39:15,352 DEBUG logging:103 Connected to server\n2024-02-28 14:39:15,352 DEBUG logging:103 recv: 0x0 0x1 0x0 0x0 0x0 0x6 0x1 0x4 0x0 0x1 0x0 0x1 old_data:  addr=None\n2024-02-28 14:39:15,352 DEBUG logging:103 Handling data: 0x0 0x1 0x0 0x0 0x0 0x6 0x1 0x4 0x0 0x1 0x0 0x1\n2024-02-28 14:39:15,352 DEBUG logging:103 Processing: 0x0 0x1 0x0 0x0 0x0 0x6 0x1 0x4 0x0 0x1 0x0 0x1\n2024-02-28 14:39:15,352 DEBUG logging:103 Factory Request[ReadInputRegistersRequest': 4]\n2024-02-28 14:39:15,352 DEBUG logging:103 validate: fc-[4] address-1: count-1\n2024-02-28 14:39:15,352 DEBUG logging:103 getValues: fc-[4] address-1: count-1\n2024-02-28 14:39:15,352 DEBUG logging:103 send: 0x0 0x1 0x0 0x0 0x0 0x5 0x1 0x4 0x2 0xc5 0x7c\n2024-02-28 14:39:37,029 DEBUG logging:103 recv: 0x0 0x2 0x0 0x0 0x0 0x6 0x4 0x4 0x0 0x1 0x0 0x1 old_data:  addr=None\n2024-02-28 14:39:37,029 DEBUG logging:103 Handling data: 0x0 0x2 0x0 0x0 0x0 0x6 0x4 0x4 0x0 0x1 0x0 0x1\n2024-02-28 14:39:37,029 DEBUG logging:103 Processing: 0x0 0x2 0x0 0x0 0x0 0x6 0x4 0x4 0x0 0x1 0x0 0x1\n2024-02-28 14:39:37,029 DEBUG logging:103 Factory Request[ReadInputRegistersRequest': 4]\n2024-02-28 14:39:37,029 DEBUG logging:103 validate: fc-[4] address-1: count-1\n2024-02-28 14:39:37,029 DEBUG logging:103 getValues: fc-[4] address-1: count-1\n2024-02-28 14:39:37,029 DEBUG logging:103 send: 0x0 0x2 0x0 0x0 0x0 0x5 0x4 0x4 0x2 0xc7 0xbe\n2024-02-28 14:39:41,010 DEBUG logging:103 recv: 0x0 0x3 0x0 0x0 0x0 0x6 0x5 0x4 0x0 0x1 0x0 0x1 old_data:  addr=None\n2024-02-28 14:39:41,010 DEBUG logging:103 Handling data: 0x0 0x3 0x0 0x0 0x0 0x6 0x5 0x4 0x0 0x1 0x0 0x1\n2024-02-28 14:39:41,010 DEBUG logging:103 Processing: 0x0 0x3 0x0 0x0 0x0 0x6 0x5 0x4 0x0 0x1 0x0 0x1\n2024-02-28 14:39:41,010 DEBUG logging:103 Not a valid slave id - 5, ignoring!!\n2024-02-28 14:39:41,010 DEBUG logging:103 Resetting frame - Current Frame in buffer - 0x0 0x3 0x0 0x0 0x0 0x6 0x5 0x4 0x0 0x1 0x0 0x1\n2024-02-28 14:39:44,015 DEBUG logging:103 -\u003e transport: received eof\n2024-02-28 14:39:44,015 DEBUG logging:103 Connection lost server due to None\n2024-02-28 14:39:44,015 DEBUG logging:103 Handler for stream [server] has been canceled\n\n```\n\n#### Run client\n```\npymodbus/repl/client on  repl-server-startup [!?] via 🐍 v3.8.13 (pymodbus3.8)\n❯ python3 main.py tcp --port 5020 --framer tcp\n\n----------------------------------------------------------------------------\n__________          _____             .___  __________              .__\n\\______   \\___.__. /     \\   ____   __| _/  \\______   \\ ____ ______ |  |\n |     ___\u003c   |  |/  \\ /  \\ /  _ \\ / __ |    |       _// __ \\\\\\____ \\|  |\n |    |    \\___  /    Y    (  \u003c_\u003e ) /_/ |    |    |   \\  ___/|  |_\u003e \u003e  |__\n |____|    / ____\\____|__  /\\____/\\____ | /\\ |____|_  /\\___  \u003e   __/|____/\n           \\/            \\/            \\/ \\/        \\/     \\/|__|\n                                                v2.0.2 - Pymodbus-3.7.0dev\n----------------------------------------------------------------------------\n\n\u003e client.read_input_registers address 1 count 1 slave 1\n{\n    \"registers\": [\n        50556\n    ]\n}\n\n\u003e client.read_input_registers address 1 count 1 slave 4\n{\n    \"registers\": [\n        51134\n    ]\n}\n\n\u003e client.read_input_registers address 1 count 1 slave 5\n{\n    \"original_function_code\": \"4 (0x4)\",\n    \"error\": \"[Input/Output] Modbus Error: [Invalid Message] No response received, expected at least 8 bytes (0 received)\"\n}\n\n\u003e\n\n```\n\n\n### Running Tests\nTo run tests, use the following command: \n\n`poetry run pytest`\n\n### Building Distribution\nTo build the distribution package, use the following command: \n\n`poetry build`\n\nThis will create distribution packages in the dist/ directory.\n\n## Usage\n\n### Pymodbus Client\nRefer [REPL Client](./pymodbus_repl/client/README.md)\n\n### Pymodbus Server\nRefer [REPL Server](./pymodbus_repl/server/README.md)\n\n## Contributing\n* Fork the repository.\n* Create a new branch (git checkout -b feature-name).\n* Make your changes and commit them (git commit -am 'Add feature').\n* Push to the branch (git push origin feature-name).\n* Create a new Pull Request.\n\n## License\nThis project is licensed under the MIT License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpymodbus-dev%2Frepl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpymodbus-dev%2Frepl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpymodbus-dev%2Frepl/lists"}