Skip to content

Commit 4779812

Browse files
committed
Pymodbus v2.4.0
1 parent 29f694c commit 4779812

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

examples/common/async_tornado_client_serial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def callback(protocol, future):
158158
# Rtu
159159
protocol, future = AsyncModbusSerialClient(schedulers.IO_LOOP,
160160
method="rtu",
161-
port="/dev/ptyp0",
161+
port="/tmp/ptyp0",
162162
baudrate=9600,
163163
timeout=2)
164164

examples/common/async_twisted_client_serial.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# state a few constants
2222
# ---------------------------------------------------------------------------#
2323

24-
SERIAL_PORT = "/dev/ptyp0"
24+
SERIAL_PORT = "/tmp/ptyp0"
2525
STATUS_REGS = (1, 2)
2626
STATUS_COILS = (1, 3)
2727
CLIENT_DELAY = 1
@@ -75,12 +75,14 @@ def error_handler(self, failure):
7575

7676

7777
if __name__ == "__main__":
78+
import time
7879
proto, client = AsyncModbusSerialClient(schedulers.REACTOR,
7980
method="rtu",
8081
port=SERIAL_PORT,
8182
timeout=2,
8283
proto_cls=ExampleProtocol)
8384
proto.start()
85+
time.sleep(10) # Wait for operation to complete
8486
# proto.stop()
8587

8688

examples/common/synchronous_server.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ def run_server():
125125
# Udp:
126126
# StartUdpServer(context, identity=identity, address=("0.0.0.0", 5020))
127127

128+
# socat -d -d PTY,link=/tmp/ptyp0,raw,echo=0,ispeed=9600 PTY,link=/tmp/ttyp0,raw,echo=0,ospeed=9600
128129
# Ascii:
129130
# StartSerialServer(context, identity=identity,
130131
# port='/dev/ttyp0', timeout=1)

0 commit comments

Comments
 (0)