Skip to content

Commit

Permalink
Pymodbus v2.2.0 (#406)
Browse files Browse the repository at this point in the history
* 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 <mpf82@users.noreply.github.com>

* 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
  • Loading branch information
dhoomakethu committed Apr 18, 2019
1 parent f0edef3 commit 2ef91e9
Show file tree
Hide file tree
Showing 106 changed files with 1,315 additions and 689 deletions.
3 changes: 2 additions & 1 deletion .coveragerc
@@ -1,3 +1,4 @@
[run]
omit =
pymodbus/repl/*
pymodbus/repl/*
pymodbus/internal/*
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -10,6 +10,8 @@ matrix:
python: "3.5"
- os: linux
python: "3.6"
# - os: linux
# python: "3.7"
- os: osx
osx_image: xcode8.3
language: generic
Expand Down
40 changes: 40 additions & 0 deletions CHANGELOG.rst
@@ -1,3 +1,39 @@
Version 2.2.0
-----------------------------------------------------------
**NOTE: Supports python 3.7, async client is now moved to pymodbus/client/asychronous**
```
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.
* Fix read timeout calculation in ModbusTCP.
* Fix SQLDbcontext always returning InvalidAddress error.
* Fix SQLDbcontext update failure
* Fix Binary payload example for endianess.
* Fix BinaryPayloadDecoder.to_coils and BinaryPayloadBuilder.fromCoils methods.
* Fix tornado async serial client `TypeError` while processing incoming packet.
* Fix erroneous CRC handling in Modbus RTU framer.
* Support broadcasting in Modbus Client and Servers (sync).
* Fix asyncio examples.
* Improved logging in Modbus Server .
* ReportSlaveIdRequest would fetch information from Device identity instead of hardcoded `Pymodbus`.
* Fix regression introduced in 2.2.0rc2 (Modbus sync client transaction failing)
* Minor update in factory.py, now server logs prints received request instead of only function code

```
# Now
DEBUG:pymodbus.factory:Factory Request[ReadInputRegistersRequest: 4]
# Before
DEBUG:pymodbus.factory:Factory Request[4]

```


Version 2.1.0
-----------------------------------------------------------
* Fix Issues with Serial client where in partial data was read when the response size is unknown.
Expand Down Expand Up @@ -49,10 +85,14 @@ Version 1.5.1
res = client.read_holding_registers(...)
if not res.isError():
# proceed
else:
# handle error or raise
"""
* Add examples for MEI read device information request
Version 1.5.0
Expand Down
5 changes: 3 additions & 2 deletions doc/conf.py
Expand Up @@ -45,7 +45,7 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc', 'recommonmark']
extensions = ['sphinx.ext.autodoc', 'm2r', 'recommonmark']

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

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand Down
8 changes: 0 additions & 8 deletions doc/source/library/pymodbus.client.async.asyncio.rst

This file was deleted.

36 changes: 0 additions & 36 deletions doc/source/library/pymodbus.client.async.factory.rst

This file was deleted.

55 changes: 0 additions & 55 deletions doc/source/library/pymodbus.client.async.rst

This file was deleted.

8 changes: 0 additions & 8 deletions doc/source/library/pymodbus.client.async.schedulers.rst

This file was deleted.

8 changes: 0 additions & 8 deletions doc/source/library/pymodbus.client.async.tornado.rst

This file was deleted.

8 changes: 0 additions & 8 deletions doc/source/library/pymodbus.client.async.twisted.rst

This file was deleted.

8 changes: 8 additions & 0 deletions doc/source/library/pymodbus.client.asynchronous.asyncio.rst
@@ -0,0 +1,8 @@
pymodbus\.client\.asynchronous\.asyncio package
===============================================

.. automodule:: pymodbus.client.asynchronous.asyncio
:members:
:undoc-members:
:show-inheritance:

36 changes: 36 additions & 0 deletions doc/source/library/pymodbus.client.asynchronous.factory.rst
@@ -0,0 +1,36 @@
pymodbus\.client\.asynchronous\.factory package
===============================================

.. automodule:: pymodbus.client.asynchronous.factory
:members:
:undoc-members:
:show-inheritance:

Submodules
----------

pymodbus\.client\.asynchronous\.factory\.serial module
------------------------------------------------------

.. automodule:: pymodbus.client.asynchronous.factory.serial
:members:
:undoc-members:
:show-inheritance:

pymodbus\.client\.asynchronous\.factory\.tcp module
---------------------------------------------------

.. automodule:: pymodbus.client.asynchronous.factory.tcp
:members:
:undoc-members:
:show-inheritance:

pymodbus\.client\.asynchronous\.factory\.udp module
---------------------------------------------------

.. automodule:: pymodbus.client.asynchronous.factory.udp
:members:
:undoc-members:
:show-inheritance:


55 changes: 55 additions & 0 deletions doc/source/library/pymodbus.client.asynchronous.rst
@@ -0,0 +1,55 @@
pymodbus\.client\.asynchronous package
======================================

.. automodule:: pymodbus.client.asynchronous
:members:
:undoc-members:
:show-inheritance:

Subpackages
-----------

.. toctree::

pymodbus.client.asynchronous.asyncio
pymodbus.client.asynchronous.factory
pymodbus.client.asynchronous.schedulers
pymodbus.client.asynchronous.tornado
pymodbus.client.asynchronous.twisted

Submodules
----------

pymodbus\.client\.asynchronous\.serial module
---------------------------------------------

.. automodule:: pymodbus.client.asynchronous.serial
:members:
:undoc-members:
:show-inheritance:

pymodbus\.client\.asynchronous\.tcp module
------------------------------------------

.. automodule:: pymodbus.client.asynchronous.tcp
:members:
:undoc-members:
:show-inheritance:

pymodbus\.client\.asynchronous\.thread module
---------------------------------------------

.. automodule:: pymodbus.client.asynchronous.thread
:members:
:undoc-members:
:show-inheritance:

pymodbus\.client\.asynchronous\.udp module
------------------------------------------

.. automodule:: pymodbus.client.asynchronous.udp
:members:
:undoc-members:
:show-inheritance:


@@ -0,0 +1,8 @@
pymodbus\.client\.asynchronous\.schedulers package
==================================================

.. automodule:: pymodbus.client.asynchronous.schedulers
:members:
:undoc-members:
:show-inheritance:

8 changes: 8 additions & 0 deletions doc/source/library/pymodbus.client.asynchronous.tornado.rst
@@ -0,0 +1,8 @@
pymodbus\.client\.asynchronous\.tornado package
===============================================

.. automodule:: pymodbus.client.asynchronous.tornado
:members:
:undoc-members:
:show-inheritance:

8 changes: 8 additions & 0 deletions doc/source/library/pymodbus.client.asynchronous.twisted.rst
@@ -0,0 +1,8 @@
pymodbus\.client\.asynchronous\.twisted package
===============================================

.. automodule:: pymodbus.client.asynchronous.twisted
:members:
:undoc-members:
:show-inheritance:

2 changes: 1 addition & 1 deletion doc/source/library/pymodbus.client.rst
Expand Up @@ -11,7 +11,7 @@ Subpackages

.. toctree::

pymodbus.client.async
pymodbus.client.asynchronous

Submodules
----------
Expand Down
6 changes: 3 additions & 3 deletions doc/source/library/pymodbus.server.rst
Expand Up @@ -9,10 +9,10 @@ pymodbus\.server package
Submodules
----------

pymodbus\.server\.async module
------------------------------
pymodbus\.server\.asynchronous module
-------------------------------------

.. automodule:: pymodbus.server.async
.. automodule:: pymodbus.server.asynchronous
:members:
:undoc-members:
:show-inheritance:
Expand Down
10 changes: 5 additions & 5 deletions examples/common/async_asyncio_client.py
Expand Up @@ -13,12 +13,12 @@
import asyncio
import logging
# ----------------------------------------------------------------------- #
# Import the required async client
# Import the required asynchronous client
# ----------------------------------------------------------------------- #
from pymodbus.client.async.tcp import AsyncModbusTCPClient as ModbusClient
# from pymodbus.client.async.udp import (
from pymodbus.client.asynchronous.tcp import AsyncModbusTCPClient as ModbusClient
# from pymodbus.client.asynchronous.udp import (
# AsyncModbusUDPClient as ModbusClient)
from pymodbus.client.async import schedulers
from pymodbus.client.asynchronous import schedulers

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

0 comments on commit 2ef91e9

Please sign in to comment.