Skip to content

Commit 2ef91e9

Browse files
authored
Pymodbus v2.2.0 (#406)
* Rebase to dev3.7 * Adding 3.7 to travis configuration * Updated documentation to resolve warnings introduced with the longer names Updated requirements-docs.txt to include missing modules * Fixed reference to deprecated asynchronous * Adding gmp disable to fix pypy build issues * Adding gmp disable to fix pypy build issues * Removing travis python 3.7 configuration Commenting out python3.7 from Travis while waiting for support. You can run teh 3.7 tests with tox without issues * Adding asserts for Payload Endianness * Fixing example of Payload. Same Endianness for builder and decoder. * Fix Sql db slave context validate and get methods - #139 * #353 - debugging, Add debug logs to check size of avaialble data in read buffer * #353 Provide an option to disable inter char timeouts * #353 Bump version, update changelog * check self.socket (#354) * check self.socket self.socket might be None at this point * Update pymodbus/client/sync.py Co-Authored-By: mpf82 <[email protected]> * Fix typo (#378) * Pymodbus 2.2.0 (#375) * #357 Support registration of custom requests * #368 Fixes write to broadcast address When writing to broadcast address (unit_id=0) there should be no response according to the Modbus spec. This fix changes expected_response_length to 0 when writing to unit_id=0. This will break any existing code that is improperly using unit_id 0 for a slave address. * Bump version to 2.2.0 Fix #366 Update failures in sql context Update Changelog Fix major minor version in example codes * Fix #371 pymodbus repl on python3 * 1. Fix tornado async serial client `TypeError` while processing incoming packet. 2. Fix asyncio examples. 3. Minor update in factory.py, now server logs prints received request instead of only function cod * [fix v3] poprawa sprawdzania timeout * Release candidate for pymodbus 2.2.0 * Fix #377 when invalid port is supplied and minor updates in logging * #368 adds broadcast support for sync client and server Adds broadcast_enable parameter to client and server, default value is False. When true it will treat unit_id 0 as broadcast and execute requests on all server slave contexts and not send a response and on the client side will send the request and not try to receive a response. * #368 Fixes minor bug in broadcast support code * Fixed erronous CRC handling If the CRC recieved is not correct in my case my slave got caught in a deadlock, not taking any new requests. This addition fixed that. * Update Changelog * Fix test coverage * Fix #387 Transactions failing on 2.2.0rc2. * Task Cancellation and CRC Errors Alternate solution for #356 and #360. Changes the RTU to make the transaction ID as the unit ID instead of an ever incrementing number. Previously this transaction ID was always 0 on the receiving end but was the unique transaction ID on sending. As such the FIFO buffer made the most sense. By tying it to the unit ID, we can recover from failure modes such as: - - Asyncio task cancellations (eg. timeouts) #360 - Skipped responses from slaves. (hangs on master #360) - CRC Errors #356 - Busy response * Cherry pick commit from PR #367 , Update changelog , bump version to 2.2.0rc4 * #389 Support passing all serial port parameters to asynchronous server * Fix BinaryPayloadDecoder and Builder wrt to coils * Misc updates, bump version to 2.2.0 * ReportSlaveIdResponse now tries to get slave id based on server identity for pymodbus servers * Update missing bcrypt requirement for testing
1 parent f0edef3 commit 2ef91e9

File tree

106 files changed

+1315
-689
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+1315
-689
lines changed

.coveragerc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[run]
22
omit =
3-
pymodbus/repl/*
3+
pymodbus/repl/*
4+
pymodbus/internal/*

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ matrix:
1010
python: "3.5"
1111
- os: linux
1212
python: "3.6"
13+
# - os: linux
14+
# python: "3.7"
1315
- os: osx
1416
osx_image: xcode8.3
1517
language: generic

CHANGELOG.rst

+40
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
1+
Version 2.2.0
2+
-----------------------------------------------------------
3+
**NOTE: Supports python 3.7, async client is now moved to pymodbus/client/asychronous**
4+
```
5+
from pymodbus.client.asynchronous import ModbusTcpClient
6+
```
7+
8+
* Support Python 3.7
9+
* Fix to task cancellations and CRC errors for async serial clients.
10+
* Fix passing serial settings to asynchronous serial server.
11+
* Fix `AttributeError` when setting `interCharTimeout` for serial clients.
12+
* Provide an option to disable inter char timeouts with Modbus RTU.
13+
* Add support to register custom requests in clients and server instances.
14+
* Fix read timeout calculation in ModbusTCP.
15+
* Fix SQLDbcontext always returning InvalidAddress error.
16+
* Fix SQLDbcontext update failure
17+
* Fix Binary payload example for endianess.
18+
* Fix BinaryPayloadDecoder.to_coils and BinaryPayloadBuilder.fromCoils methods.
19+
* Fix tornado async serial client `TypeError` while processing incoming packet.
20+
* Fix erroneous CRC handling in Modbus RTU framer.
21+
* Support broadcasting in Modbus Client and Servers (sync).
22+
* Fix asyncio examples.
23+
* Improved logging in Modbus Server .
24+
* ReportSlaveIdRequest would fetch information from Device identity instead of hardcoded `Pymodbus`.
25+
* Fix regression introduced in 2.2.0rc2 (Modbus sync client transaction failing)
26+
* Minor update in factory.py, now server logs prints received request instead of only function code
27+
28+
```
29+
# Now
30+
DEBUG:pymodbus.factory:Factory Request[ReadInputRegistersRequest: 4]
31+
# Before
32+
DEBUG:pymodbus.factory:Factory Request[4]
33+
34+
```
35+
36+
137
Version 2.1.0
238
-----------------------------------------------------------
339
* Fix Issues with Serial client where in partial data was read when the response size is unknown.
@@ -49,10 +85,14 @@ Version 1.5.1
4985
5086
res = client.read_holding_registers(...)
5187
if not res.isError():
88+
5289
# proceed
90+
5391
else:
5492
# handle error or raise
5593
94+
"""
95+
5696
* Add examples for MEI read device information request
5797
5898
Version 1.5.0

doc/conf.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
# Add any Sphinx extension module names here, as strings. They can be
4646
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
4747
# ones.
48-
extensions = ['sphinx.ext.autodoc', 'recommonmark']
48+
extensions = ['sphinx.ext.autodoc', 'm2r', 'recommonmark']
4949

5050
# Add any paths that contain templates here, relative to this directory.
5151
templates_path = ['_templates']
@@ -112,7 +112,8 @@
112112
# Add any paths that contain custom static files (such as style sheets) here,
113113
# relative to this directory. They are copied after the builtin static files,
114114
# so a file named "default.css" will overwrite the builtin "default.css".
115-
html_static_path = ['_static']
115+
# html_static_path = ['_static']
116+
html_static_path = []
116117

117118
# Custom sidebar templates, must be a dictionary that maps document names
118119
# to template names.

doc/source/library/pymodbus.client.async.asyncio.rst

-8
This file was deleted.

doc/source/library/pymodbus.client.async.factory.rst

-36
This file was deleted.

doc/source/library/pymodbus.client.async.rst

-55
This file was deleted.

doc/source/library/pymodbus.client.async.schedulers.rst

-8
This file was deleted.

doc/source/library/pymodbus.client.async.tornado.rst

-8
This file was deleted.

doc/source/library/pymodbus.client.async.twisted.rst

-8
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
pymodbus\.client\.asynchronous\.asyncio package
2+
===============================================
3+
4+
.. automodule:: pymodbus.client.asynchronous.asyncio
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
pymodbus\.client\.asynchronous\.factory package
2+
===============================================
3+
4+
.. automodule:: pymodbus.client.asynchronous.factory
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:
8+
9+
Submodules
10+
----------
11+
12+
pymodbus\.client\.asynchronous\.factory\.serial module
13+
------------------------------------------------------
14+
15+
.. automodule:: pymodbus.client.asynchronous.factory.serial
16+
:members:
17+
:undoc-members:
18+
:show-inheritance:
19+
20+
pymodbus\.client\.asynchronous\.factory\.tcp module
21+
---------------------------------------------------
22+
23+
.. automodule:: pymodbus.client.asynchronous.factory.tcp
24+
:members:
25+
:undoc-members:
26+
:show-inheritance:
27+
28+
pymodbus\.client\.asynchronous\.factory\.udp module
29+
---------------------------------------------------
30+
31+
.. automodule:: pymodbus.client.asynchronous.factory.udp
32+
:members:
33+
:undoc-members:
34+
:show-inheritance:
35+
36+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
pymodbus\.client\.asynchronous package
2+
======================================
3+
4+
.. automodule:: pymodbus.client.asynchronous
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:
8+
9+
Subpackages
10+
-----------
11+
12+
.. toctree::
13+
14+
pymodbus.client.asynchronous.asyncio
15+
pymodbus.client.asynchronous.factory
16+
pymodbus.client.asynchronous.schedulers
17+
pymodbus.client.asynchronous.tornado
18+
pymodbus.client.asynchronous.twisted
19+
20+
Submodules
21+
----------
22+
23+
pymodbus\.client\.asynchronous\.serial module
24+
---------------------------------------------
25+
26+
.. automodule:: pymodbus.client.asynchronous.serial
27+
:members:
28+
:undoc-members:
29+
:show-inheritance:
30+
31+
pymodbus\.client\.asynchronous\.tcp module
32+
------------------------------------------
33+
34+
.. automodule:: pymodbus.client.asynchronous.tcp
35+
:members:
36+
:undoc-members:
37+
:show-inheritance:
38+
39+
pymodbus\.client\.asynchronous\.thread module
40+
---------------------------------------------
41+
42+
.. automodule:: pymodbus.client.asynchronous.thread
43+
:members:
44+
:undoc-members:
45+
:show-inheritance:
46+
47+
pymodbus\.client\.asynchronous\.udp module
48+
------------------------------------------
49+
50+
.. automodule:: pymodbus.client.asynchronous.udp
51+
:members:
52+
:undoc-members:
53+
:show-inheritance:
54+
55+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
pymodbus\.client\.asynchronous\.schedulers package
2+
==================================================
3+
4+
.. automodule:: pymodbus.client.asynchronous.schedulers
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
pymodbus\.client\.asynchronous\.tornado package
2+
===============================================
3+
4+
.. automodule:: pymodbus.client.asynchronous.tornado
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
pymodbus\.client\.asynchronous\.twisted package
2+
===============================================
3+
4+
.. automodule:: pymodbus.client.asynchronous.twisted
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:
8+

doc/source/library/pymodbus.client.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Subpackages
1111

1212
.. toctree::
1313

14-
pymodbus.client.async
14+
pymodbus.client.asynchronous
1515

1616
Submodules
1717
----------

doc/source/library/pymodbus.server.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ pymodbus\.server package
99
Submodules
1010
----------
1111

12-
pymodbus\.server\.async module
13-
------------------------------
12+
pymodbus\.server\.asynchronous module
13+
-------------------------------------
1414

15-
.. automodule:: pymodbus.server.async
15+
.. automodule:: pymodbus.server.asynchronous
1616
:members:
1717
:undoc-members:
1818
:show-inheritance:

examples/common/async_asyncio_client.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
import asyncio
1414
import logging
1515
# ----------------------------------------------------------------------- #
16-
# Import the required async client
16+
# Import the required asynchronous client
1717
# ----------------------------------------------------------------------- #
18-
from pymodbus.client.async.tcp import AsyncModbusTCPClient as ModbusClient
19-
# from pymodbus.client.async.udp import (
18+
from pymodbus.client.asynchronous.tcp import AsyncModbusTCPClient as ModbusClient
19+
# from pymodbus.client.asynchronous.udp import (
2020
# AsyncModbusUDPClient as ModbusClient)
21-
from pymodbus.client.async import schedulers
21+
from pymodbus.client.asynchronous import schedulers
2222

2323
else:
2424
import sys
@@ -68,7 +68,7 @@ async def start_async_test(client):
6868
# are not known to these tests. Furthermore, some use the same memory
6969
# blocks for the two sets, so a change to one is a change to the other.
7070
# Keep both of these cases in mind when testing as the following will
71-
# _only_ pass with the supplied async modbus server (script supplied).
71+
# _only_ pass with the supplied asynchronous modbus server (script supplied).
7272
# ----------------------------------------------------------------------- #
7373
log.debug("Write to a Coil and read back")
7474
rq = await client.write_coil(0, True, unit=UNIT)

0 commit comments

Comments
 (0)