Skip to content

Commit 1130fb2

Browse files
dhoomakethusanjay
authored andcommitted
update readme
1 parent 5efceda commit 1130fb2

File tree

2 files changed

+76
-2
lines changed

2 files changed

+76
-2
lines changed

README.md

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Pymodbus-REPL is a REPL (Read-Eval-Print Loop) tool for working with Modbus devi
99
- Python 3.8+
1010
- Poetry (installed globally or within a virtual environment)
1111

12-
### Installation
12+
### Dev instructions
1313

1414
1. Clone the repository:
1515

@@ -23,6 +23,80 @@ Pymodbus-REPL is a REPL (Read-Eval-Print Loop) tool for working with Modbus devi
2323

2424
`poetry install`
2525

26+
**NOTE** This repo is meant to be an helper for [pymodbus](https://github.com/pymodbus-dev/pymodbus) and the usage requires
27+
a working version of pymodbus.
28+
29+
The installed `pymodbus` library for local development can also have impact on the path resolution while working locally on this repo.
30+
To overcome that problem, please make sure to run the [client](./pymodbus/client/main.py) and [server](./pymodbus/server/main.py) files
31+
from with in the respective working directories.
32+
33+
For .e.g
34+
35+
#### Run Server
36+
```
37+
(pymodbus3.8)
38+
pymodbus/repl/server on  repl-server-startup [!?] via 🐍 v3.8.13 (pymodbus3.8)
39+
❯ 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
40+
2024-02-17 13:27:17,218 INFO logging:97 Modbus server started
41+
2024-02-17 13:27:17,219 DEBUG logging:103 Awaiting connections server_listener
42+
2024-02-17 13:27:17,219 INFO logging:97 Server listening.
43+
44+
__________ .______. _________
45+
\______ \___.__. _____ ____ __| _/\_ |__ __ __ ______ / _____/ ______________ __ ___________
46+
| ___< | |/ \ / _ \ / __ | | __ \| | \/ ___/ \_____ \_/ __ \_ __ \ \/ // __ \_ __ \\
47+
| | \___ | Y Y ( <_> ) /_/ | | \_\ \ | /\___ \ / \ ___/| | \/\ /\ ___/| | \/
48+
|____| / ____|__|_| /\____/\____ | |___ /____//____ > /_______ /\___ >__| \_/ \___ >__|
49+
\/ \/ \/ \/ \/ \/ \/ \/
50+
51+
52+
SERVER >
53+
```
54+
55+
#### Run client
56+
```
57+
pymodbus/repl/client on  repl-server-startup [!?] via 🐍 v3.8.13 (pymodbus3.8)
58+
❯ python3 main.py tcp --port 5020 --framer tcp
59+
60+
----------------------------------------------------------------------------
61+
__________ _____ .___ __________ .__
62+
\______ \___.__. / \ ____ __| _/ \______ \ ____ ______ | |
63+
| ___< | |/ \ / \ / _ \ / __ | | _// __ \\\____ \| |
64+
| | \___ / Y ( <_> ) /_/ | | | \ ___/| |_> > |__
65+
|____| / ____\____|__ /\____/\____ | /\ |____|_ /\___ > __/|____/
66+
\/ \/ \/ \/ \/ \/|__|
67+
v1.3.1 - 3.6.4
68+
----------------------------------------------------------------------------
69+
70+
> client.read_input_registers address 1 count 1 slave 4
71+
{
72+
"registers": [
73+
34518
74+
]
75+
}
76+
77+
> client.read_input_registers address 1 count 1 slave 1
78+
{
79+
"registers": [
80+
32198
81+
]
82+
}
83+
84+
> client.read_input_registers address 1 count 1 slave 2
85+
{
86+
"registers": [
87+
51557
88+
]
89+
}
90+
91+
> client.read_input_registers address 1 count 1 slave 3
92+
{
93+
"original_function_code": "4 (0x4)",
94+
"error": "[Input/Output] Modbus Error: [Invalid Message] No response received, expected at least 8 bytes (0 received)"
95+
}
96+
97+
```
98+
99+
26100
### Running Tests
27101
To run tests, use the following command:
28102

pymodbus_repl/server/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ def print_title():
114114
max_len = max( # pylint: disable=consider-using-generator
115115
[len(t) for t in TITLE.split("\n")]
116116
)
117+
title = TITLE.format(repl_version, pymodbus_version)
117118
if col > max_len:
118-
title = TITLE.format(repl_version, pymodbus_version)
119119
info(title)
120120
else:
121121
print_formatted_text(

0 commit comments

Comments
 (0)