Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a2d79e1
#357 Support registration of custom requests
dhoomakethu Dec 3, 2018
f07dcee
#368 Fixes write to broadcast address
mdmuhlbaier Jan 10, 2019
2e169b6
Bump version to 2.2.0
dhoomakethu Jan 14, 2019
c410f5b
Merge branch '#357-Custom-Function' into pymodbus-2.2.0
dhoomakethu Jan 14, 2019
826240b
Fix #371 pymodbus repl on python3
dhoomakethu Jan 14, 2019
6e72e44
1. Fix tornado async serial client `TypeError` while processing incom…
dhoomakethu Jan 15, 2019
18fe036
[fix v3] poprawa sprawdzania timeout
MarekLew Jan 6, 2019
964a565
Release candidate for pymodbus 2.2.0
dhoomakethu Jan 16, 2019
6960d9c
Fix #377 when invalid port is supplied and minor updates in logging
dhoomakethu Jan 26, 2019
249ad8f
Merge remote-tracking branch 'upstream/dev' into dev
muhlbaier Jan 31, 2019
60aca50
#368 adds broadcast support for sync client and server
muhlbaier Jan 31, 2019
e07e01e
#368 Fixes minor bug in broadcast support code
muhlbaier Jan 31, 2019
5030514
Fixed erronous CRC handling
JStrbg Jan 16, 2019
1a24c1d
Merge branch 'pull/372' into pymodbus-2.2.0
dhoomakethu Feb 11, 2019
e5c2615
Update Changelog
dhoomakethu Feb 11, 2019
f66f464
Fix test coverage
dhoomakethu Feb 11, 2019
7650421
Fix #387 Transactions failing on 2.2.0rc2.
dhoomakethu Feb 16, 2019
6233706
Task Cancellation and CRC Errors
pazzarpj Dec 12, 2018
89d3909
Cherry pick commit from PR #367 , Update changelog , bump version to …
dhoomakethu Mar 6, 2019
e4f202c
#389 Support passing all serial port parameters to asynchronous server
dhoomakethu Mar 23, 2019
3f48b90
Fix BinaryPayloadDecoder and Builder wrt to coils
dhoomakethu Apr 18, 2019
c919fe4
Misc updates, bump version to 2.2.0
dhoomakethu Apr 18, 2019
3d34820
ReportSlaveIdResponse now tries to get slave id based on server ident…
dhoomakethu Apr 18, 2019
2d8d467
Update missing bcrypt requirement for testing
dhoomakethu Apr 18, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
#389 Support passing all serial port parameters to asynchronous server
  • Loading branch information
dhoomakethu committed Mar 23, 2019
commit e4f202cb0973b08c8c38c0f667c4b29b80a1a64e
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ from pymodbus.client.asynchronous import ModbusTcpClient

* Support Python 3.7
* Fix to task cancellations and CRC errors for async serial clients.
* Fix passing serial settings to asynchronous serial server.
* Fix `AttributeError` when setting `interCharTimeout` for serial clients.
* Provide an option to disable inter char timeouts with Modbus RTU.
* Add support to register custom requests in clients and server instances.
Expand Down
10 changes: 9 additions & 1 deletion pymodbus/server/asynchronous.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,12 @@ def StartSerialServer(context, identity=None, framer=ModbusAsciiFramer,
port = kwargs.get('port', '/dev/ttyS0')
baudrate = kwargs.get('baudrate', Defaults.Baudrate)
console = kwargs.get('console', False)
bytesize = kwargs.get("bytesize", Defaults.Bytesize)
stopbits = kwargs.get("stopbits", Defaults.Stopbits)
parity = kwargs.get("parity", Defaults.Parity)
timeout = kwargs.get("timeout", 0)
xonxoff = kwargs.get("xonxoff", 0)
rtscts = kwargs.get("rtscts", 0)

_logger.info("Starting Modbus Serial Server on %s" % port)
factory = ModbusServerFactory(context, framer, identity, **kwargs)
Expand All @@ -329,7 +335,9 @@ def StartSerialServer(context, identity=None, framer=ModbusAsciiFramer,

protocol = factory.buildProtocol(None)
SerialPort.getHost = lambda self: port # hack for logging
SerialPort(protocol, port, reactor, baudrate)
SerialPort(protocol, port, reactor, baudrate=baudrate, parity=parity,
stopbits=stopbits, timeout=timeout, xonxoff=xonxoff,
rtscts=rtscts, bytesize=bytesize)
if not defer_reactor_run:
reactor.run(installSignalHandlers=_is_main_thread())

Expand Down
2 changes: 1 addition & 1 deletion pymodbus/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __str__(self):
return '[%s, version %s]' % (self.package, self.short())


version = Version('pymodbus', 2, 2, 0, "rc4")
version = Version('pymodbus', 2, 2, 0, "rc5")


version.__name__ = 'pymodbus' # fix epydoc error
Expand Down
16 changes: 4 additions & 12 deletions test/test_server_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,7 @@ def testTcpExecuteFailure(self):

# CASE-1: test NoSuchSlaveException exceptions
request.execute.side_effect = NoSuchSlaveException()
self.assertRaises(
NoSuchSlaveException, protocol._execute(request)
)
protocol._execute(request)
self.assertTrue(request.doException.called)

# CASE-2: NoSuchSlaveException with ignore_missing_slaves = true
Expand All @@ -131,9 +129,7 @@ def testTcpExecuteFailure(self):

# test other exceptions
request.execute.side_effect = ModbusIOException()
self.assertRaises(
ModbusIOException, protocol._execute(request)
)
protocol._execute(request)
self.assertTrue(protocol._send.called)

def testSendTcp(self):
Expand Down Expand Up @@ -273,9 +269,7 @@ def testUdpExecuteFailure(self):

# CASE-1: test NoSuchSlaveException exceptions
request.execute.side_effect = NoSuchSlaveException()
self.assertRaises(
NoSuchSlaveException, protocol._execute(request, mock_addr)
)
protocol._execute(request, mock_addr)
self.assertTrue(request.doException.called)

# CASE-2: NoSuchSlaveException with ignore_missing_slaves = true
Expand All @@ -285,9 +279,7 @@ def testUdpExecuteFailure(self):

# test other exceptions
request.execute.side_effect = ModbusIOException()
self.assertRaises(
ModbusIOException, protocol._execute(request, mock_addr)
)
protocol._execute(request, mock_addr)
self.assertTrue(protocol._send.called)

def testStopServer(self):
Expand Down