Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Fix #509 Wrong unit ID referenced in framers
  • Loading branch information
dhoomakethu committed Sep 8, 2020
commit 0301b4ada344c91096e86a42e43f2272be0f5c6d
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Version 2.4.0
* Add local echo option
* Add exponential backoffs on retries.
* REPL - Support broadcasts.
* Fix framers using wrong unit address.

Version 2.3.0
-----------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion pymodbus/client/asynchronous/asyncio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def _dataReceived(self, data):
:param data: The data returned from the server
'''
_logger.debug("recv: " + " ".join([hex(byte2int(x)) for x in data]))
unit = self.framer.decode_data(data).get("uid", 0)
unit = self.framer.decode_data(data).get("unit", 0)
self.framer.processIncomingPacket(data, self._handleResponse, unit=unit)

def _handleResponse(self, reply, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion pymodbus/client/asynchronous/tornado/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def on_receive(self, *args):
if not data:
return
LOGGER.debug("recv: " + " ".join([hex(byte2int(x)) for x in data]))
unit = self.framer.decode_data(data).get("uid", 0)
unit = self.framer.decode_data(data).get("unit", 0)
self.framer.processIncomingPacket(data, self._handle_response, unit=unit)

def execute(self, request=None):
Expand Down
2 changes: 1 addition & 1 deletion pymodbus/client/asynchronous/twisted/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def dataReceived(self, data):

:param data: The data returned from the server
"""
unit = self.framer.decode_data(data).get("uid", 0)
unit = self.framer.decode_data(data).get("unit", 0)
self.framer.processIncomingPacket(data, self._handleResponse,
unit=unit)

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, 4, 0)
version = Version('pymodbus', 2, 4, 0, 'rc2')


version.__name__ = 'pymodbus' # fix epydoc error
Expand Down