Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.4.0 #253

Merged
merged 24 commits into from Jan 3, 2018
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
91f3f0b
#217 fix modbus tcp read
dhoomakethu Oct 3, 2017
22f1843
Move twisted requirement to extra (#227)
jackjweinstein Oct 18, 2017
4c896d1
#157 Pass remote unit id when using remote slave context
dhoomakethu Oct 26, 2017
f226bcd
#190 fix asynchronous processor example
dhoomakethu Oct 26, 2017
5f0d2ed
#60 Check for slave unit id before processing the request for serial …
dhoomakethu Oct 26, 2017
6030c25
#209 bump version to 1.4.0.rc1
dhoomakethu Oct 26, 2017
634abaf
Update ISSUE_TEMPLATE.md
dhoomakethu Oct 27, 2017
01f5819
Fix failing tests
dhoomakethu Oct 27, 2017
2bbb5e5
Fix example remote_server_context (#236)
dhoomakethu Nov 6, 2017
27a834e
In the start TCP, UDP and Seriel server, we are running a quick check…
rahulraghu94 Nov 24, 2017
b1b9e4f
#84: Stop Asynchronous Server (#243)
rahulraghu94 Nov 25, 2017
c0e489c
Test dev (#240)
dhoomakethu Nov 28, 2017
e852aa2
#221 tcp read complete frame based on length field in the mbap header…
dhoomakethu Dec 19, 2017
b1363d7
Prepare for 1.4.0 (#209), updated changelogs
dhoomakethu Dec 19, 2017
621a90e
Tar ball without docs (#252)
dhoomakethu Dec 21, 2017
4a05c01
#221 Fix read transactions for different framers
dhoomakethu Dec 21, 2017
2e65023
Update requirements for document generation
dhoomakethu Dec 21, 2017
668612e
Fix ModbusSingleRequestHandler
dhoomakethu Dec 22, 2017
1e1af47
Bump version to 1.4.0rc2 #209
dhoomakethu Dec 22, 2017
5a3cceb
Fix make clean command on osx
dhoomakethu Dec 22, 2017
c1e784a
#245 unittest coverage (#249)
rahulraghu94 Dec 22, 2017
64cb66a
#255 Fix BinaryPayloadDecoder
dhoomakethu Dec 26, 2017
d4dcdc0
#255 Fix unit tests
dhoomakethu Dec 26, 2017
b4f3987
1. #138 Add support to manipulate wordorder with BinaryPayloadDecoder…
dhoomakethu Jan 3, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion pymodbus/server/async.py
Expand Up @@ -58,7 +58,9 @@ def dataReceived(self, data):
if _logger.isEnabledFor(logging.DEBUG):
_logger.debug(' '.join([hex(byte2int(x)) for x in data]))
if not self.factory.control.ListenOnly:
self.framer.processIncomingPacket(data, self._execute)
unit_address = byte2int(data[0])
if unit_address in self.factory.store:
self.framer.processIncomingPacket(data, self._execute)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This completely breaks using unit ids with modbusTCP. 0 is only the correct offset for RTU framed packets. You've added a fixed RTU offset into the core server code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why on earth isn't this just being handled in the framer, it seems to be already handled there anyway, and even if the address doesn'tmatch on serial, you still need to swallow all the remaining bytes on the wire.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karlp there is an issue already for that #256 and there is also a branch with the fix https://github.com/riptideio/pymodbus/compare/%23256-Fix-TCP-Server-Transactions

If you think you have a better solution please raise a PR rather than complaining. You could have searched for the issues before commenting here. Also note, it will be part of the upcoming release . I hope this answers you.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If your merging and committing work had been cleaner, it would have been feasible to review your changes at the time. There was no way anyone could sanely attempt to review things like PR #253 so it's not surprising that bugs crept in. Please consider what your patches look like, not just commit and move forward.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, thanks for the feedback. I will keep that in mind. Your are free to fix them and raise a PR or raise an issue so others can take care of it when ever time permits.


def _execute(self, request):
''' Executes the request and returns the result
Expand Down
9 changes: 6 additions & 3 deletions pymodbus/server/sync.py
Expand Up @@ -102,7 +102,9 @@ def handle(self):
if data:
if _logger.isEnabledFor(logging.DEBUG):
_logger.debug(" ".join([hex(byte2int(x)) for x in data]))
self.framer.processIncomingPacket(data, self.execute)
unit_address = byte2int(data[0])
if unit_address in self.server.context:
self.framer.processIncomingPacket(data, self.execute)
except Exception as msg:
# since we only have a single socket, we cannot exit
# Clear frame buffer
Expand Down Expand Up @@ -198,14 +200,15 @@ class ModbusDisconnectedRequestHandler(ModbusBaseRequestHandler):
only difference is that we have to specify who to send the
resulting packet data to.
'''
socket = None

def handle(self):
''' Callback when we receive any data
'''
reset_frame = False
while self.running:
try:
data, self.request = self.request
data, self.socket = self.request
if not data:
self.running = False
if _logger.isEnabledFor(logging.DEBUG):
Expand Down Expand Up @@ -236,7 +239,7 @@ def send(self, message):
pdu = self.framer.buildPacket(message)
if _logger.isEnabledFor(logging.DEBUG):
_logger.debug('send: %s' % b2a_hex(pdu))
return self.request.sendto(pdu, self.client_address)
return self.socket.sendto(pdu, self.client_address)


#---------------------------------------------------------------------------#
Expand Down