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

Match Responses by the Request TID #9

Closed
bashwork opened this issue Jun 18, 2012 · 11 comments
Closed

Match Responses by the Request TID #9

bashwork opened this issue Jun 18, 2012 · 11 comments
Assignees

Comments

@bashwork
Copy link
Collaborator

Since the order of the asynchronous responses are not guaranteed to be in order if many requests are sent at the same time, the deferred needs to be matched by its TID. In order to do this, the deferred queue should be changed to a deferred dictionary. If a response doesn't match a TID in the queue, it should be logged and dropped.

The following discussion addresses this issue: https://groups.google.com/forum/?fromgroups#!topic/pymodbus/VdcsmIUtHt0

@douglatornell
Copy link

I'm sorry to report that this issue appears to have come back in v1.1.0.

I'm the person who reported it in the discussion thread linked above.

I just upgraded pymodbus from the build at e921ec0 that I was using to v1.1.0 from PyPI and got the same errors described in the thread. Dropping back to v1.0.0 from PyPI I found all was well, so something between 1.0.0 and 1.1.0 broke the TID ordering.

I can see that client/async.py has change a lot, so it will likely take me a while to figure out the difference that is causing the trouble. I may be able to do some bisecting later in the week.

@bashwork bashwork reopened this Apr 2, 2013
@bashwork
Copy link
Collaborator Author

bashwork commented Apr 2, 2013

Doug,

Sorry I missed this, I am working on this and would be grateful if you could quickly test the latest commit:

996dff2

I will continue trying to resolve the issue regardless.

@douglatornell
Copy link

No worries. I never delivered on my promise to try to narrow down the change that caused the problem, so I can't complain :-) And 1.0.0 works just fine in my application.

I tested 996dff2 and got some strange results. There were lots of AttributeError exceptions like:

exceptions.AttributeError: 'ReadHoldingRegistersResponse' object has no attribute 'getBit'

and

exceptions.AttributeError: 'ReadCoilsResponse' object has no attribute 'getRegister'

which, I think, imply the same kind of response mix-ups that this issue was originally about. However, there were also some successfully returned values from the PLC, but those values were incorrect; e.g. holding registers that I know to contain zero, and that return zero when I run with v1.0.0 were suddenly showing values of 140 with 996dff2,

This is all in the context of a quick test of my data logging application that does about 150 reads per second across 3 PLCs. I will work tomorrow on producing minimal test case code that demonstrates the issue.

@ghost ghost assigned bashwork Apr 3, 2013
@douglatornell
Copy link

This code:

import logging
from twisted.internet import reactor
from twisted.internet.endpoints import TCP4ClientEndpoint
from pymodbus.constants import Defaults
from pymodbus.client.async import ModbusClientFactory

logging.basicConfig()
log = logging.getLogger()
log.setLevel(logging.DEBUG)

def show_bit(response):
    log.debug('65th bit = {0}'.format(response.getBit(65)))

def show_hreg(response):
    log.debug('42nd hreg = {0}'.format(response.getRegister(42)))

def foo(protocol):
    r1 = protocol.read_coils(1400, 400)
    r1.addCallback(show_bit)
    r2 = protocol.read_holding_registers(1400, 100)
    r2.addCallback(show_hreg)
    reactor.callLater(1, protocol.transport.loseConnection)
    reactor.callLater(1.5, reactor.stop)

endpoint = TCP4ClientEndpoint(reactor, '172.20.1.1', Defaults.Port)
protocol = endpoint.connect(ModbusClientFactory())
protocol.addCallback(foo)
reactor.run()

demonstrated the issue and produces this traceback:

DEBUG:pymodbus.client.async:Client connected to modbus server
DEBUG:pymodbus.transaction:adding transaction 1
DEBUG:pymodbus.transaction:adding transaction 2
DEBUG:pymodbus.transaction:0x0 0x2 0x0 0x0 0x0 0xcb 0x0 0x3 0xc8 0x2 0x8b 0x2 0xab 0x2 0x92 0x2 0x26 0x2 0x94 0x2 0x93 0x2 0x92 0x2 0x5e 0x2 0x5f 0x2 0x9f 0x2 0x8 0x14 0x82 0x14 0x79 0x14 0x7c 0x14 0x73 0x14 0x56 0x14 0x90 0x14 0x8c 0x14 0x8d 0x14 0x88 0x14 0x69 0x14 0x8a 0x14 0x89 0x14 0x59 0x3 0x84 0x14 0xe3 0x14 0xc4 0x14 0xde 0x14 0xda 0x1 0x90 0x0 0x0 0x2 0x3c 0x0 0x2 0x0 0x1 0x0 0x0 0x1 0x61 0x0 0x0 0x0 0x0 0x1 0x9 0x1 0x70 0x0 0xc9 0x2 0xd6 0x0 0x1 0x2 0xdb 0x0 0x0 0x0 0x4 0x0 0x46 0x0 0xa4 0x0 0x4 0x0 0x4 0x0 0x0 0x0 0x4 0x0 0x4 0x0 0x0 0x1 0x60 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x2 0x0 0x2 0x0 0x2 0x0 0x2 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x1 0x11 0x2 0xa1 0x2 0x73 0x0 0x0 0x2 0x9d 0x1 0x90 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0xd 0x48 0xc 0xe4 0xd 0x48 0xc 0xe4 0x1e 0x78 0x1d 0x4c 0x1c 0xe8 0x1a 0xc2 0x19 0x64 0x19 0x0 0x15 0x4a 0x14 0x50 0x14 0x28 0x15 0x4a 0x14 0x50 0x14 0x28 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0xd 0x48
DEBUG:pymodbus.factory:Factory Response[3]
DEBUG:pymodbus.transaction:getting transaction 2
Unhandled error in Deferred:
Unhandled Error
Traceback (most recent call last):
  File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/pymodbus/transaction.py", line 346, in processIncomingPacket
    callback(result)  # defer or push to a thread?
  File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/pymodbus/client/async.py", line 113, in _handleResponse
    handler.callback(reply)
  File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/twisted/internet/defer.py", line 381, in callback
    self._startRunCallbacks(result)
  File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/twisted/internet/defer.py", line 489, in _startRunCallbacks
    self._runCallbacks()
--- <exception caught here> ---
  File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/twisted/internet/defer.py", line 576, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/home/doug/pymodbus-test.py", line 12, in show_bit
    log.debug('65th bit = {0}'.format(response.getBit(65)))
exceptions.AttributeError: 'ReadHoldingRegistersResponse' object has no attribute 'getBit'
DEBUG:pymodbus.transaction:0x0 0x1 0x0 0x0 0x0 0x35 0x0 0x1 0x32 0x1 0xff 0xa7 0x11 0x90 0x0 0x4e 0x2d 0x9 0x0 0x80 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x34 0x4c 0x9b 0xd1 0xb6 0xf 0xe0 0x3 0x30 0x0 0x80 0x43 0xc0 0x31 0xe6 0x80 0x3 0x0 0x0 0x80 0xf0 0x7f 0x40 0xfd 0x7
DEBUG:pymodbus.factory:Factory Response[1]
DEBUG:pymodbus.transaction:getting transaction 1
Unhandled error in Deferred:
Unhandled Error
Traceback (most recent call last):
  File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/pymodbus/transaction.py", line 346, in processIncomingPacket
    callback(result)  # defer or push to a thread?
  File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/pymodbus/client/async.py", line 113, in _handleResponse
    handler.callback(reply)
  File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/twisted/internet/defer.py", line 381, in callback
    self._startRunCallbacks(result)
  File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/twisted/internet/defer.py", line 489, in _startRunCallbacks
    self._runCallbacks()
--- <exception caught here> ---
  File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/twisted/internet/defer.py", line 576, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/home/doug/pymodbus-test.py", line 15, in show_hreg
    log.debug('42nd hreg = {0}'.format(response.getRegister(42)))
exceptions.AttributeError: 'ReadCoilsResponse' object has no attribute 'getRegister'
DEBUG:pymodbus.client.async:Client disconnected from modbus server: [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionDone'>: Connection was closed cleanly.
]

python 2.7.3
twisted 12.3.0
pymodbus 996dff2

@bashwork
Copy link
Collaborator Author

bashwork commented Apr 3, 2013

Well that is a little unsettling, however I am going to reproduce your
error when I get home and attempt to track down where the mixup is
happening. Essentially what the client code is doing is::

request.transaction_id = get_next_tid()
defer = defer.Deferred()
transactions[request.transaction_id] = defer
execute(request)
return defer

... some time later ...

defer = transactions[response.transaction_id]
defer.callback(response)

So either the transaction ids are getting confused or it is using the FIFO
transaction manager.

Galen

On Wed, Apr 3, 2013 at 2:59 PM, Doug Latornell [email protected]:

This code:

import loggingfrom twisted.internet import reactorfrom twisted.internet.endpoints import TCP4ClientEndpointfrom pymodbus.constants import Defaultsfrom pymodbus.client.async import ModbusClientFactory
logging.basicConfig()log = logging.getLogger()log.setLevel(logging.DEBUG)
def show_bit(response):
log.debug('65th bit = {0}'.format(response.getBit(65)))
def show_hreg(response):
log.debug('42nd hreg = {0}'.format(response.getRegister(42)))
def foo(protocol):
r1 = protocol.read_coils(1400, 400)
r1.addCallback(show_bit)
r2 = protocol.read_holding_registers(1400, 100)
r2.addCallback(show_hreg)
reactor.callLater(1, protocol.transport.loseConnection)
reactor.callLater(1.5, reactor.stop)
endpoint = TCP4ClientEndpoint(reactor, '172.20.1.1', Defaults.Port)protocol = endpoint.connect(ModbusClientFactory())protocol.addCallback(foo)reactor.run()

demonstrated the issue and produces this traceback:

DEBUG:pymodbus.client.async:Client connected to modbus serverDEBUG:pymodbus.transaction:adding transaction 1DEBUG:pymodbus.transaction:adding transaction 2DEBUG:pymodbus.transaction:0x0 0x2 0x0 0x0 0x0 0xcb 0x0 0x3 0xc8 0x2 0x8b 0x2 0xab 0x2 0x92 0x2 0x26 0x2 0x94 0x2 0x93 0x2 0x92 0x2 0x5e 0x2 0x5f 0x2 0x9f <
span class="mh">0x2 0x8 0x14 0x82 0x14 0x79 0x14 0x7c 0x14 0x73 0x14 0x56 0x14 0x90 0x14 0x8c 0x14 0x8d 0x14 0x88 0x14 0x69 0x14 0x8a 0x14 0x89 0x14 0x59 0x3 0x84 0x14 0xe3 0x14 0xc4 0x14 0xde 0x14 0xda 0x1 0x90 0x0 0x0 0x2 0x3c 0x0 0x2 0x0 0x1 0x0 0x0 0x1 0x61 0x0 0x0 0x0 0x0 0x1 0x9 0x1 0x70 0x0 0xc9 0x2 0xd6 0x0 0x1 0x2 0xdb 0x0 0x0 0x0 0x4 0x0 0x46 0x0 0xa4 0x0 0x4 0x0 0x4 0x0 0x0 0x0 0x4 0x0 0x4 0x0 0x0 0x1 0x60 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x2 0x0 0x2 0x0 0x2 0x0 0x2 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x1 0x11 0x2 0xa1 0x2 0x73 0x0 0x0 0x2 0x9d 0x1 0x90 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0xd 0x48 0xc 0xe4 0xd 0x48 0xc 0xe4 0x1e 0x78 0x1d 0x4c 0x1c 0xe8 0x1a 0xc2 0x19 0x64 0x19 0x0 0x15 0x4a 0x14 0x50 0x14 0x28 0x15 0x4a 0x14 0x50 0x14 0x28 0x0 0x0 0x0 0x0** 0x0 0x0 0x0 0x0 0xd 0x48DEBUG:pymodbus.factory:Factory Response[3]DEBUG:pymodbus.transaction:getting transaction 2Unhandled error in Deferred:Unhandled ErrorTraceback (most recent call last):
File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/pymodbus/transaction.py", line 346, in processIncomingPacket
callback(result) # defer or push to a thread?
File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/pymodbus/client/async.py", line 113, in _handleResponse
handler.callback(reply)
File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/twisted/internet/defer.py", line 381, in callback
self._startRunCallbacks(result)
File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/twisted/internet/defer.py", line 489, in _startRunCallbacks
self._runCallbacks()--- ---
File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/twisted/internet/defer.py", line 576, in _runCallbacks
current.result = callback(current.result, _args, *_kw)
File "/home/doug/pymodbus-test.py", line 12, in show_bit
log.debug('65th bit = {0}'.format(response.getBit(65)))exceptions.AttributeError: 'ReadHoldingRegistersResponse' object has no attribute 'getBit'DEBUG:pymodbus.transaction:0x0 0x1 0x0 0x0 0x0 0x35 0x0 0x1 0x32 0x1 0xff 0xa7 0x11 0x90 0x0 0x4e 0x2d 0x9 0x0 0x80 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 *_0x0 0x0 0x0 0x0 0x0 0x34 0x4c 0x9b 0xd1 0xb6 0xf 0xe0 0x3 0x30 0x0 0x80 0x43 0xc0 0x31 0xe6 0x80 0x3 0x0 0x0 0x80 0xf0 0x7f 0x40 0xfd 0x7DEBUG:pymodbus.factory:Factory Response[1]DEBUG:pymodbus.transaction:getting transaction 1Unhandled error in Deferred:Unhandled ErrorTraceback (most recent call last):
File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/pymodbus/transaction.py", line 346, in processIncomingPacket
callback(result) # defer or push to a thread?
File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/pymodbus/client/async.py", line 113, in _handleResponse
handler.callback(reply)
File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/twisted/internet/defer.py", line 381, in callback
self._startRunCallbacks(result)
File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/twisted/internet/defer.py", line 489, in _startRunCallbacks
self._runCallbacks()--- ---
File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/twisted/internet/defer.py", line 576, in _runCallbacks
current.result = callback(current.result, *args, *_kw)
File "/home/doug/pymodbus-test.py", line 15, in show_hreg
log.debug('42nd hreg = {0}'.format(response.getRegister(42)))exceptions.AttributeError: 'ReadCoilsResponse' object has no attribute 'getRegister'DEBUG:pymodbus.client.async:Client disconnected from modbus server: [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionDone'>: Connection was closed cleanly.]

python 2.7.3
twisted 12.3.0
pymodbus 996dff2 996dff2


Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-15868071
.

@bashwork
Copy link
Collaborator Author

bashwork commented Apr 3, 2013

Is there any chance you could add two lines to your script for me::

def foo(protocol):
print protocol.framer
print protocol.transaction

That will quickly rule out the simple error case.

On Wed, Apr 3, 2013 at 4:05 PM, Galen Collins [email protected] wrote:

Well that is a little unsettling, however I am going to reproduce your
error when I get home and attempt to track down where the mixup is
happening. Essentially what the client code is doing is::

request.transaction_id = get_next_tid()
defer = defer.Deferred()
transactions[request.transaction_id] = defer
execute(request)
return defer

... some time later ...

defer = transactions[response.transaction_id]
defer.callback(response)

So either the transaction ids are getting confused or it is using the FIFO
transaction manager.

Galen

On Wed, Apr 3, 2013 at 2:59 PM, Doug Latornell [email protected]:

This code:

import loggingfrom twisted.internet import reactorfrom twisted.internet.endpoints import TCP4ClientEndpointfrom pymodbus.constants import Defaultsfrom pymodbus.client.async import ModbusClientFactory
logging.basicConfig()log = logging.getLogger()log.setLevel(logging.DEBUG)
def show_bit(response):
log.debug('65th bit = {0}'.format(response.getBit(65)))
def show_hreg(response):
log.debug('42nd hreg = {0}'.format(response.getRegister(42)))
def foo(protocol):
r1 = protocol.read_coils(1400, 400)
r1.addCallback(show_bit)
r2 = protocol.read_holding_registers(1400, 100)
r2.addCallback(show_hreg)
reactor.callLater(1, protocol.transport.loseConnection)
reactor.callLater(1.5, reactor.stop)
endpoint = TCP4ClientEndpoint(reactor, '172.20.1.1', Defaults.Port)protocol = endpoint.connect(ModbusClientFactory())protocol.addCallback(foo)reactor.run()

demonstrated the issue and produces this traceback:

DEBUG:pymodbus.client.async:Client connected to modbus serverDEBUG:pymodbus.transaction:adding transaction 1DEBUG:pymodbus.transaction:adding transaction 2DEBUG:pymodbus.transaction:0x0 0x2 0x0 0x0 0x0 0xcb 0x0 0x3 0xc8 0x2 0x8b 0x2 0xab 0x2 0x92 0x2 0x26 0x2 0x94 0x2 0x93 0x2 0x92 0x2 0x5e 0x2 0x5f 0x2 0x9f <
span class="mh">0x2 0x8 0x14 0x82 0x14 0x79 0x14 0x7c 0x14 0x73 0x14 0x56 0x14 0x90 0x14 0x8c 0x14 0x8d 0x14 0x88 0x14 0x69 0x14 0x8a 0x14 0x89 0x14 0x59 0x3 0x84 0x14 0xe3 0x14 0xc4 0x14 0xde 0x14 0xda 0x1 0x90 0x0 0x0 0x2 0x3c 0x0 0x2 0x0 0x1 0x0 0x0 0x1 0x61 0x0 0x0 0x0 0x0 0x1 0x9 0x1 0x70 0x0 0xc9 0x2 0xd6 0x0 0x1 0x2 0xdb 0x0 0x0 0x0 0x4 0x0 0x46 0x0 0xa4 0x0 0x4 0x0 0x4 0x0 0x0 0x0 0x4 0x0 0x4 0x0 0x0 0x1 0x60 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x2 0x0 0x2 0x0 0x2 0x0 0x2 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x1 0x11 0x2 0xa1 0x2 0x73 0x0 0x0 0x2 0x9d 0x1 0x90 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0xd 0x48 0xc 0xe4 0xd 0x48 0xc 0xe4 0x1e 0x78 0x1d 0x4c 0x1c 0xe8 0x1a 0xc2 0x19 0x64 0x19 0x0 0x15 0x4a 0x14 0x50 0x14 0x28 0x15 0x4a 0x14 0x50 0x14 0x28 0x0 0x0 0x0 0x0** 0x0 0x0 0x0 0x0 0xd 0x48DEBUG:pymodbus.factory:Factory Response[3]DEBUG:pymodbus.transaction:getting transaction 2Unhandled error in Deferred:Unhandled ErrorTraceback (most recent call last):
File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/pymodbus/transaction.py", line 346, in processIncomingPacket
callback(result) # defer or push to a thread?
File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/pymodbus/client/async.py", line 113, in _handleResponse
handler.callback(reply)
File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/twisted/internet/defer.py", line 381, in callback
self._startRunCallbacks(result)
File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/twisted/internet/defer.py", line 489, in _startRunCallbacks
self._runCallbacks()--- ---
File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/twisted/internet/defer.py", line 576, in _runCallbacks
current.result = callback(current.result, _args, *_kw)
File "/home/doug/pymodbus-test.py", line 12, in show_bit
log.debug('65th bit = {0}'.format(response.getBit(65)))exceptions.AttributeError: 'ReadHoldingRegistersResponse' object has no attribute 'getBit'DEBUG:pymodbus.transaction:0x0 0x1 0x0 0x0 0x0 0x35 0x0 0x1 0x32 0x1 0xff 0xa7 0x11 0x90 0x0 0x4e 0x2d 0x9 0x0 0x80 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 *_0x0 0x0 0x0 0x0 0x0 0x34 0x4c 0x9b 0xd1 0xb6 0xf 0xe0 0x3 0x30 0x0 0x80 0x43 0xc0 0x31 0xe6 0x80 0x3 0x0 0x0 0x80 0xf0 0x7f 0x40 0xfd 0x7DEBUG:pymodbus.factory:Factory Response[1]DEBUG:pymodbus.transaction:getting transaction 1Unhandled error in Deferred:Unhandled ErrorTraceback (most recent call last):
File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/pymodbus/transaction.py", line 346, in processIncomingPacket
callback(result) # defer or push to a thread?
File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/pymodbus/client/async.py", line 113, in _handleResponse
handler.callback(reply)
File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/twisted/internet/defer.py", line 381, in callback
self._startRunCallbacks(result)
File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/twisted/internet/defer.py", line 489, in _startRunCallbacks
self._runCallbacks()--- ---
File "/home/doug/.virtualenvs/beaver-test/lib/python2.7/site-packages/twisted/internet/defer.py", line 576, in _runCallbacks
current.result = callback(current.result, *args, *_kw)
File "/home/doug/pymodbus-test.py", line 15, in show_hreg
log.debug('42nd hreg = {0}'.format(response.getRegister(42)))exceptions.AttributeError: 'ReadCoilsResponse' object has no attribute 'getRegister'DEBUG:pymodbus.client.async:Client disconnected from modbus server: [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionDone'>: Connection was closed cleanly.]

python 2.7.3
twisted 12.3.0
pymodbus 996dff2 996dff2


Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-15868071
.

@douglatornell
Copy link

Added those 2 lines, and now the output begins:

DEBUG:pymodbus.client.async:Client connected to modbus server
<pymodbus.transaction.ModbusSocketFramer object at 0x7f2a640c>
<pymodbus.transaction.FifoTransactionManager object at 0x7f2a65ec>
DEBUG:pymodbus.transaction:adding transaction 1
DEBUG:pymodbus.transaction:adding transaction 2

So, yeah, looks like it is using the FIFO transaction manager, if object names are anything to go by...

@bashwork
Copy link
Collaborator Author

bashwork commented Apr 3, 2013

Okay well that is the problem, but now I am curious how that can possibly
happen as the transaction is set as follows:

    if isinstance(framer, ModbusSocketFramer):
        self.transaction = DictTransactionManager(self)
    else: self.transaction = FifoTransactionManager(self)

On Wed, Apr 3, 2013 at 4:19 PM, Doug Latornell [email protected]:

Added those 2 lines, and now the output begins:

DEBUG:pymodbus.client.async:Client connected to modbus server
<pymodbus.transaction.ModbusSocketFramer object at 0x7f2a640c><pymodbus.transaction.FifoTransactionManager object at 0x7f2a65ec>
DEBUG:pymodbus.transaction:adding transaction 1DEBUG:pymodbus.transaction:adding transaction 2

So, yeah, looks like it is using the FIFO transaction manager, if object
names are anything to go by...


Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-15871579
.

@bashwork
Copy link
Collaborator Author

bashwork commented Apr 3, 2013

Oh geez I'm stupid. I'll have a fix momentarily.

On Wed, Apr 3, 2013 at 4:24 PM, Galen Collins [email protected] wrote:

Okay well that is the problem, but now I am curious how that can possibly
happen as the transaction is set as follows:

    if isinstance(framer, ModbusSocketFramer):
        self.transaction = DictTransactionManager(self)
    else: self.transaction = FifoTransactionManager(self)

On Wed, Apr 3, 2013 at 4:19 PM, Doug Latornell [email protected]:

Added those 2 lines, and now the output begins:

DEBUG:pymodbus.client.async:Client connected to modbus server
<pymodbus.transaction.ModbusSocketFramer object at 0x7f2a640c><pymodbus.transaction.FifoTransactionManager object at 0x7f2a65ec>
DEBUG:pymodbus.transaction:adding transaction 1DEBUG:pymodbus.transaction:adding transaction 2

So, yeah, looks like it is using the FIFO transaction manager, if object
names are anything to go by...


Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-15871579
.

@bashwork
Copy link
Collaborator Author

bashwork commented Apr 3, 2013

Please pull latest: 87b1138

Sorry for the spam,

Galen

On Wed, Apr 3, 2013 at 4:25 PM, Galen Collins [email protected] wrote:

Oh geez I'm stupid. I'll have a fix momentarily.

On Wed, Apr 3, 2013 at 4:24 PM, Galen Collins [email protected] wrote:

Okay well that is the problem, but now I am curious how that can possibly
happen as the transaction is set as follows:

    if isinstance(framer, ModbusSocketFramer):

        self.transaction = DictTransactionManager(self)

    else: self.transaction = FifoTransactionManager(self)

On Wed, Apr 3, 2013 at 4:19 PM, Doug Latornell [email protected]:

Added those 2 lines, and now the output begins:

DEBUG:pymodbus.client.async:Client connected to modbus server
<pymodbus.transaction.ModbusSocketFramer object at 0x7f2a640c><pymodbus.transaction.FifoTransactionManager object at 0x7f2a65ec>
DEBUG:pymodbus.transaction:adding transaction 1DEBUG:pymodbus.transaction:adding transaction 2

So, yeah, looks like it is using the FIFO transaction manager, if object
names are anything to go by...


Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-15871579
.

@douglatornell
Copy link

Test case runs cleanly now. I'll have to wait until tomorrow to be able to test the full app in an environment with 87b1138 applied.

Thanks for your help with this, Galen!

@bashwork bashwork closed this as completed Apr 4, 2013
dhoomakethu pushed a commit that referenced this issue May 16, 2017
dhoomakethu added a commit that referenced this issue May 17, 2017
* Refactored and simplified calculation of RTU frames, added missing unit tests

* - fixing a few small issues
- bringing a few areas of coverage back up

* adding installer test script

* enabling the checksum tests in check frame, fixing tests

* * Updating documentation
* Adding code to handle messages that do not respond
* Fixes issue 41

* cleaning up the build tools a bit

* Adding more commands to the setup.py
- pep8, lint, 2to3

Fixed a few pep8/lint bugs to test

* moving files around

* pep8 and cleanup

* more cleanup

* Fixes issue 47

* adding another quick example

* cutting 200 pep8 errors

* working on py3 merge

* updating to python3

* reverting back changes, remember Switch flag next time

* adding some magic methods, just cause

* adding documentation pdf

* Fixes issue 49

* Adds True and False constants for older python versions.

Update issue 50

* adding tests for a few fixes

* Fixes issue 51

* fixing tests broken by interface change

* Updates issue 52

* Fixes issue 53

* Fix to add Python < 2.5 compatibility

This fix simply removes all the ternaries that were added
in Python 2.5.

Fixes issue 50

* adding a mostly complete diagnostic register implementation

* Adding more documentation and helpful factory methods.

The documentation added was to address some questions
with the synchronous and asynchrounous server implementations
as well as the functionality of the data contexts.

The factory methods were added by request to simplify the
creation of a fully populated DataBlock address space.

* adding modbus plus registers

* adding endian ability to payload builder

* Finishing the remaining modbus protocol

* Adding the remaining portions of the protocol (request/response)
* Tieing these into the factory decoder
* Adding tests to cover the new code (need more)
* Fixing a few bugs found along the way

* finished file read/write record requests

* documentation, more tests, fixing extra commands

* adding more tests

* Fixing the client/server async/sync implementations

- asynchronous client/server for tcp working and tested
- synchronous client/server for tcp/udp working and tested
- adding tests to exercise the synchronous client/server
- more documentation

* adding test stubs to get full coverage count

* working on jamod, need to set up more complete project

* adding GetDeviceInformationRequest

* adding read device information to decoder factory

* fixing some example errors

* working on the serial implementations

* fixing the synchronous server implementation

* updating functional tests and documentation for sync-serial

* updating tac files

* Updating the documentation for the serial client/servers

* adding readme to root

* Fixes issue 56

* Fixes issue 1

* adding a requirements file for virtualenv folk

* adding more cohesive code to the payload utilities

* forgot to add the new example to the doc index

* Fixing the rtu size calculation isse #55 on google code

* using the endian flag in register factory

* fixing bad documentation

* fixing issue 58 on google code

* Fix binary framer and add start and end tokens

Fixes a TypeError occuring while escaping token bytes in the message and
adds the start and end tokens to the packet.

* Adding checking in the client for an unconnected socket.

* Fixing issue 60 on google code (including ez_setup)

* fixing github issue #7

* adding tests and two utilities

* adding message parser utility

* Fixing extended message decoding

* Now correctly decoding sub function messages (diagnostic)
* Message parser now finished and documented
* Fixed broken logger unit test

* ModbusSparseDataBlock handled dictionaries incorrectly (they have an __iter__ attribute). Changed 'if' to 'elif'

* Updating the Readme.rst to explain how to install in zero dependency mode.

* Fixing issue #10

* updating the client documentation

* updating the server context documentation

* fixes #9 on github

* fixing the factory decoding and adding examples

* pushing to version 1.0

* Fixing a bug in the asynchronous client that slipped through.

* complete tests for the sync client

* cleaning up some pep8 errors

* finished unit tests for async client

* adding another test to the test-install script

* finished covering sync client

* updating documentation

* adding another example, adding debug checks

* Fixing the serial implementation of everything

* updating lots of reference documentation
* fixing the fifo semantics of serial clients
* using transaction manager in async clients
* fixing references

* fixing incorrect rtu lenght calculation

* Add optional server_address to Sync and Async TCP/UDP Server API

* Improve erver_address defaults to passing None

* adding a few messages

* Adding a message encoding generator for testing.

- fixed messages not passing **kwargs to base
- fixed binary framer off by 1
- fixed mei_message rtu size tests
- added a message generator to use with message parser
- fixed message parser with ascii
- tested message parser with all formats (added to messages)

* adding documentation for message formats

* updating documentation and being pedantic

* Allowing overloading of message encoding

* allow codes like payload builder to encode
* added IPayloadBuilder interface (future)
* renamed builder methods to reflect vision
* added error code decoding to name
* fixed affected tests

* Cleaning up the build tools

- moving custom datastores to examples
- bumping required versions
- making the debug server console optional
- updating documentation

* adding support for pydev

* fixing broken nosetest (/dev/pts) and pydev issues

* adding bcd payload builder

* reworking contrib packages

* adding bcd payload contrib

* moving complex examples to contrib

* syncing version on pypi

* adding server rest api

* moving web -> bottle

* fixing documentation

* adding gui base

* adding initial manager page

* adding data view

* fixing error in example

* adding the ability to override sync client framer

* updating the performance test

* fixing documentation

* fixing memory leak in sync client

* adding modicon encoder/decoder

* Fix bogus calculation in ModbusSocketFramer.checkFrame
(one of the tests also seemed wrong, I had to fix it)

* Adding sunspec client example

* Changing @staticmethod to @classmethod to fix inheritance

* adding method to retrieve all the device blocks

* adding the initial mapper interface

* adding ideas in progress

* adding a modbus datastore saver

* making lrc/crc read stdin

* adding the callback server example

* adding a periodic updating example

* fixing documentation

* adding fix for stuck RTU streams

* fixing documentation error

* Adding an example for changing framers

- new example changing-framers.py
- added documentation link

* Reworking the transaction managers to be explicit

- Serial framers use the FIFO manager (results in order)
- Socket framers use the Dict manager (tid -> result)
- Fixed tests and removed bad global managers
- Managers no longer use global state (now instance)

* Bumping the version and adding a changelog

* Fixing a logic error in client code

- Now correctly choosing transaction manager

* Fixing 2to3 common warnings

* Fixed example typo in readme

* Adding slave context delete ability

- Fixes #20

* Fixing google code issue 69

- custom-message example had bugs
- http://code.google.com/p/pymodbus/issues/detail?id=69

* Fixed docstring in synchronous serial client connect() method

I think there was a copy/paste error in the docstring. It said tcp but I think it is supposed to be serial.

* Fix for issue #21

* Allowing options to be passed through

- This fixes issue #21
- Options now go to the transaction manager

* Adding source_address to TCP client inputs

* Typo

* Typo

* Typo

* Typo

* Adding some new examples

* modbus scraper (and documentation)
* thread safe datastore (and documentation)

* Adding a concurrent client example

* Allow specification of client connection handler in Modbus...Server
o ModbusTcpServer and ModbusUdpServer allows handler class other than
  default Modbus{Connected,Disconnected}RequestHandler
o Add debug logging on request failure, to help diagnose root causes

* Fixes #46

* Fixes #48

* Adds the option to drop into zero mode for slaves

* Fixes #42

* Bumping the version to 1.3.0

* add missing self operator

The parameter values of the constructor within  class WriteMultipleRegistersRequest can specified as single value or list of values. But if a single value is given the missing self operator on line 137 leads to crash in line 138 with error: TypeError("object of type 'int' has no len()",)

* typo: fix spelling of Parameter

Signed-off-by: Karl Palsson <[email protected]>

* async: missing slaves: add missing imports

1e0bcde is missing imports into the
async server, the import was only added to the sync server.

Further fix for #42

Signed-off-by: Karl Palsson <[email protected]>

* Fix zero_mode argument for ModbusSlaveContext

Using "-" in the argument name causes SyntaxError
'non-keyword arg after keyword arg'

* Fix typo in constants

* Adding an example and adding tcp timeout

* fixes #70

* Endianness now used in packing bytes

* Adding a libmodbus wrapper

* adding new contrib example of libmodbus client
* updating example documentation so users can find it

* closes #73

* Execute methods of Requests accept context

There were errors whenever a request that got handles in
other_message.py got it's execute method called, as it was being called
with a context parameter. The functions now accept this parameter,
although they don't do anything with it.

The tests have also been updated.

* Add Modbus RTU syncronous server example

* Signal handlers to stop in shutdown().

* WriteMultipleRegistersRequest: Handle values=None case

Currently, if None is passed in explicitly, or if values is not given,
the 'values' object is correctly identified as *not* having an __iter__
attribute, but is incorrectly identified as being a valid register value.
This breaks testInvalidWriteMultipleRegistersRequest.

Solution: if we see None, replace this with [] and skip the check for
__iter__.

* Fix payload tests.

Looking at the "encoded" string, it looks identical to that of the big
endian encoding string, and my understanding is that the data shown in
"encoded" *IS* big-endian, not little-endian.

I have no idea how this passed before, but it passes now.

* sync.ModbusUdpClient: Correct reference to settimeout.

I could not find a 'settimeout' (case-insensitive) anywhere in the
codebase other than on this line, but I *did* see it was a method of
socket.socket.

So I'll assume that this was *supposed* to be calling
socket.socket.settimeout.

* test-client-sync: Fix UDP connection test.

Rather than passing in a vanilla object, we should pass in something
that implements the settimeout method.

* Lazily initialize InstallManagementConsole

Simply importing the management console takes ~0.3 sec on an 1GHz Atom.
Since it is (I suspect) often not used, lazily importing it should help
startup for many programs.

* Fixes the UDP client socket timeout bug

fixes #51

* Implement mask_write_register method in client mixin

* Workaround for bug 101 #101

* Workaround for bug 101 #101

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Document Riptide specific instructions.

* Include Workaround for bug 101 bashwork#101

* Include Workaround for bug 101 bashwork#101

* Better tag names.

* pymodbus fix for modes RTU error cases.

* version bumped to c93103

* version bumped to c93103

* fixed issue with pymodbus timing over serial

* fixed issue with pymodbus timing over serial

* Add RIPTIDE.md  to .gitignore

* bump version to rc93105

*  fix merge conflicts

* fix version file

*  fix unit test failures

* cleanup

* #121 changelog updated

* Misc update Add __maintainer__ field in setup.py

* 1. #162, creating universal distribution for py2 and py3
2. Merge PR #152 , create compatible versions

* fix test failures

* fix ReadDeviceInformationRequest  encoding probelm
dhoomakethu added a commit that referenced this issue May 20, 2017
* Refactored and simplified calculation of RTU frames, added missing unit tests

* - fixing a few small issues
- bringing a few areas of coverage back up

* adding installer test script

* enabling the checksum tests in check frame, fixing tests

* * Updating documentation
* Adding code to handle messages that do not respond
* Fixes issue 41

* cleaning up the build tools a bit

* Adding more commands to the setup.py
- pep8, lint, 2to3

Fixed a few pep8/lint bugs to test

* moving files around

* pep8 and cleanup

* more cleanup

* Fixes issue 47

* adding another quick example

* cutting 200 pep8 errors

* working on py3 merge

* updating to python3

* reverting back changes, remember Switch flag next time

* adding some magic methods, just cause

* adding documentation pdf

* Fixes issue 49

* Adds True and False constants for older python versions.

Update issue 50

* adding tests for a few fixes

* Fixes issue 51

* fixing tests broken by interface change

* Updates issue 52

* Fixes issue 53

* Fix to add Python < 2.5 compatibility

This fix simply removes all the ternaries that were added
in Python 2.5.

Fixes issue 50

* adding a mostly complete diagnostic register implementation

* Adding more documentation and helpful factory methods.

The documentation added was to address some questions
with the synchronous and asynchrounous server implementations
as well as the functionality of the data contexts.

The factory methods were added by request to simplify the
creation of a fully populated DataBlock address space.

* adding modbus plus registers

* adding endian ability to payload builder

* Finishing the remaining modbus protocol

* Adding the remaining portions of the protocol (request/response)
* Tieing these into the factory decoder
* Adding tests to cover the new code (need more)
* Fixing a few bugs found along the way

* finished file read/write record requests

* documentation, more tests, fixing extra commands

* adding more tests

* Fixing the client/server async/sync implementations

- asynchronous client/server for tcp working and tested
- synchronous client/server for tcp/udp working and tested
- adding tests to exercise the synchronous client/server
- more documentation

* adding test stubs to get full coverage count

* working on jamod, need to set up more complete project

* adding GetDeviceInformationRequest

* adding read device information to decoder factory

* fixing some example errors

* working on the serial implementations

* fixing the synchronous server implementation

* updating functional tests and documentation for sync-serial

* updating tac files

* Updating the documentation for the serial client/servers

* adding readme to root

* Fixes issue 56

* Fixes issue 1

* adding a requirements file for virtualenv folk

* adding more cohesive code to the payload utilities

* forgot to add the new example to the doc index

* Fixing the rtu size calculation isse #55 on google code

* using the endian flag in register factory

* fixing bad documentation

* fixing issue 58 on google code

* Fix binary framer and add start and end tokens

Fixes a TypeError occuring while escaping token bytes in the message and
adds the start and end tokens to the packet.

* Adding checking in the client for an unconnected socket.

* Fixing issue 60 on google code (including ez_setup)

* fixing github issue #7

* adding tests and two utilities

* adding message parser utility

* Fixing extended message decoding

* Now correctly decoding sub function messages (diagnostic)
* Message parser now finished and documented
* Fixed broken logger unit test

* ModbusSparseDataBlock handled dictionaries incorrectly (they have an __iter__ attribute). Changed 'if' to 'elif'

* Updating the Readme.rst to explain how to install in zero dependency mode.

* Fixing issue #10

* updating the client documentation

* updating the server context documentation

* fixes #9 on github

* fixing the factory decoding and adding examples

* pushing to version 1.0

* Fixing a bug in the asynchronous client that slipped through.

* complete tests for the sync client

* cleaning up some pep8 errors

* finished unit tests for async client

* adding another test to the test-install script

* finished covering sync client

* updating documentation

* adding another example, adding debug checks

* Fixing the serial implementation of everything

* updating lots of reference documentation
* fixing the fifo semantics of serial clients
* using transaction manager in async clients
* fixing references

* fixing incorrect rtu lenght calculation

* Add optional server_address to Sync and Async TCP/UDP Server API

* Improve erver_address defaults to passing None

* adding a few messages

* Adding a message encoding generator for testing.

- fixed messages not passing **kwargs to base
- fixed binary framer off by 1
- fixed mei_message rtu size tests
- added a message generator to use with message parser
- fixed message parser with ascii
- tested message parser with all formats (added to messages)

* adding documentation for message formats

* updating documentation and being pedantic

* Allowing overloading of message encoding

* allow codes like payload builder to encode
* added IPayloadBuilder interface (future)
* renamed builder methods to reflect vision
* added error code decoding to name
* fixed affected tests

* Cleaning up the build tools

- moving custom datastores to examples
- bumping required versions
- making the debug server console optional
- updating documentation

* adding support for pydev

* fixing broken nosetest (/dev/pts) and pydev issues

* adding bcd payload builder

* reworking contrib packages

* adding bcd payload contrib

* moving complex examples to contrib

* syncing version on pypi

* adding server rest api

* moving web -> bottle

* fixing documentation

* adding gui base

* adding initial manager page

* adding data view

* fixing error in example

* adding the ability to override sync client framer

* updating the performance test

* fixing documentation

* fixing memory leak in sync client

* adding modicon encoder/decoder

* Fix bogus calculation in ModbusSocketFramer.checkFrame
(one of the tests also seemed wrong, I had to fix it)

* Adding sunspec client example

* Changing @staticmethod to @classmethod to fix inheritance

* adding method to retrieve all the device blocks

* adding the initial mapper interface

* adding ideas in progress

* adding a modbus datastore saver

* making lrc/crc read stdin

* adding the callback server example

* adding a periodic updating example

* fixing documentation

* adding fix for stuck RTU streams

* fixing documentation error

* Adding an example for changing framers

- new example changing-framers.py
- added documentation link

* Reworking the transaction managers to be explicit

- Serial framers use the FIFO manager (results in order)
- Socket framers use the Dict manager (tid -> result)
- Fixed tests and removed bad global managers
- Managers no longer use global state (now instance)

* Bumping the version and adding a changelog

* Fixing a logic error in client code

- Now correctly choosing transaction manager

* Fixing 2to3 common warnings

* Fixed example typo in readme

* Adding slave context delete ability

- Fixes #20

* Fixing google code issue 69

- custom-message example had bugs
- http://code.google.com/p/pymodbus/issues/detail?id=69

* Fixed docstring in synchronous serial client connect() method

I think there was a copy/paste error in the docstring. It said tcp but I think it is supposed to be serial.

* Fix for issue #21

* Allowing options to be passed through

- This fixes issue #21
- Options now go to the transaction manager

* Adding source_address to TCP client inputs

* Typo

* Typo

* Typo

* Typo

* Adding some new examples

* modbus scraper (and documentation)
* thread safe datastore (and documentation)

* Adding a concurrent client example

* Allow specification of client connection handler in Modbus...Server
o ModbusTcpServer and ModbusUdpServer allows handler class other than
  default Modbus{Connected,Disconnected}RequestHandler
o Add debug logging on request failure, to help diagnose root causes

* Fixes #46

* Fixes #48

* Adds the option to drop into zero mode for slaves

* Fixes #42

* Bumping the version to 1.3.0

* add missing self operator

The parameter values of the constructor within  class WriteMultipleRegistersRequest can specified as single value or list of values. But if a single value is given the missing self operator on line 137 leads to crash in line 138 with error: TypeError("object of type 'int' has no len()",)

* typo: fix spelling of Parameter

Signed-off-by: Karl Palsson <[email protected]>

* async: missing slaves: add missing imports

1e0bcde is missing imports into the
async server, the import was only added to the sync server.

Further fix for #42

Signed-off-by: Karl Palsson <[email protected]>

* Fix zero_mode argument for ModbusSlaveContext

Using "-" in the argument name causes SyntaxError
'non-keyword arg after keyword arg'

* Fix typo in constants

* Adding an example and adding tcp timeout

* fixes #70

* Endianness now used in packing bytes

* Adding a libmodbus wrapper

* adding new contrib example of libmodbus client
* updating example documentation so users can find it

* closes #73

* Execute methods of Requests accept context

There were errors whenever a request that got handles in
other_message.py got it's execute method called, as it was being called
with a context parameter. The functions now accept this parameter,
although they don't do anything with it.

The tests have also been updated.

* Add Modbus RTU syncronous server example

* Signal handlers to stop in shutdown().

* WriteMultipleRegistersRequest: Handle values=None case

Currently, if None is passed in explicitly, or if values is not given,
the 'values' object is correctly identified as *not* having an __iter__
attribute, but is incorrectly identified as being a valid register value.
This breaks testInvalidWriteMultipleRegistersRequest.

Solution: if we see None, replace this with [] and skip the check for
__iter__.

* Fix payload tests.

Looking at the "encoded" string, it looks identical to that of the big
endian encoding string, and my understanding is that the data shown in
"encoded" *IS* big-endian, not little-endian.

I have no idea how this passed before, but it passes now.

* sync.ModbusUdpClient: Correct reference to settimeout.

I could not find a 'settimeout' (case-insensitive) anywhere in the
codebase other than on this line, but I *did* see it was a method of
socket.socket.

So I'll assume that this was *supposed* to be calling
socket.socket.settimeout.

* test-client-sync: Fix UDP connection test.

Rather than passing in a vanilla object, we should pass in something
that implements the settimeout method.

* Lazily initialize InstallManagementConsole

Simply importing the management console takes ~0.3 sec on an 1GHz Atom.
Since it is (I suspect) often not used, lazily importing it should help
startup for many programs.

* Fixes the UDP client socket timeout bug

fixes #51

* Implement mask_write_register method in client mixin

* Workaround for bug 101 #101

* Workaround for bug 101 #101

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Document Riptide specific instructions.

* Include Workaround for bug 101 bashwork#101

* Include Workaround for bug 101 bashwork#101

* Better tag names.

* pymodbus fix for modes RTU error cases.

* version bumped to c93103

* version bumped to c93103

* fixed issue with pymodbus timing over serial

* fixed issue with pymodbus timing over serial

* Add RIPTIDE.md  to .gitignore

* bump version to rc93105

*  fix merge conflicts

* fix version file

*  fix unit test failures

* cleanup

* #121 changelog updated

* Misc update Add __maintainer__ field in setup.py

* 1. #162, creating universal distribution for py2 and py3
2. Merge PR #152 , create compatible versions

* fix test failures

* fix ReadDeviceInformationRequest  encoding problem

*  #166 fix failing tests on python 3.5

* mis - Updated documentation

* #167 updated documentation for CI

* #167 disable pep8/flake checks for the time being

* #167, fix install dependencies osx, remove pypy from supported python versions

* #167, fix install dependencies osx, remove pypy from supported python versions

* #167 , fix minior error in travis.yml
*  Bump version to 1.3.0rc2, update README
dhoomakethu added a commit that referenced this issue May 27, 2017
* Refactored and simplified calculation of RTU frames, added missing unit tests

* - fixing a few small issues
- bringing a few areas of coverage back up

* adding installer test script

* enabling the checksum tests in check frame, fixing tests

* * Updating documentation
* Adding code to handle messages that do not respond
* Fixes issue 41

* cleaning up the build tools a bit

* Adding more commands to the setup.py
- pep8, lint, 2to3

Fixed a few pep8/lint bugs to test

* moving files around

* pep8 and cleanup

* more cleanup

* Fixes issue 47

* adding another quick example

* cutting 200 pep8 errors

* working on py3 merge

* updating to python3

* reverting back changes, remember Switch flag next time

* adding some magic methods, just cause

* adding documentation pdf

* Fixes issue 49

* Adds True and False constants for older python versions.

Update issue 50

* adding tests for a few fixes

* Fixes issue 51

* fixing tests broken by interface change

* Updates issue 52

* Fixes issue 53

* Fix to add Python < 2.5 compatibility

This fix simply removes all the ternaries that were added
in Python 2.5.

Fixes issue 50

* adding a mostly complete diagnostic register implementation

* Adding more documentation and helpful factory methods.

The documentation added was to address some questions
with the synchronous and asynchrounous server implementations
as well as the functionality of the data contexts.

The factory methods were added by request to simplify the
creation of a fully populated DataBlock address space.

* adding modbus plus registers

* adding endian ability to payload builder

* Finishing the remaining modbus protocol

* Adding the remaining portions of the protocol (request/response)
* Tieing these into the factory decoder
* Adding tests to cover the new code (need more)
* Fixing a few bugs found along the way

* finished file read/write record requests

* documentation, more tests, fixing extra commands

* adding more tests

* Fixing the client/server async/sync implementations

- asynchronous client/server for tcp working and tested
- synchronous client/server for tcp/udp working and tested
- adding tests to exercise the synchronous client/server
- more documentation

* adding test stubs to get full coverage count

* working on jamod, need to set up more complete project

* adding GetDeviceInformationRequest

* adding read device information to decoder factory

* fixing some example errors

* working on the serial implementations

* fixing the synchronous server implementation

* updating functional tests and documentation for sync-serial

* updating tac files

* Updating the documentation for the serial client/servers

* adding readme to root

* Fixes issue 56

* Fixes issue 1

* adding a requirements file for virtualenv folk

* adding more cohesive code to the payload utilities

* forgot to add the new example to the doc index

* Fixing the rtu size calculation isse #55 on google code

* using the endian flag in register factory

* fixing bad documentation

* fixing issue 58 on google code

* Fix binary framer and add start and end tokens

Fixes a TypeError occuring while escaping token bytes in the message and
adds the start and end tokens to the packet.

* Adding checking in the client for an unconnected socket.

* Fixing issue 60 on google code (including ez_setup)

* fixing github issue #7

* adding tests and two utilities

* adding message parser utility

* Fixing extended message decoding

* Now correctly decoding sub function messages (diagnostic)
* Message parser now finished and documented
* Fixed broken logger unit test

* ModbusSparseDataBlock handled dictionaries incorrectly (they have an __iter__ attribute). Changed 'if' to 'elif'

* Updating the Readme.rst to explain how to install in zero dependency mode.

* Fixing issue #10

* updating the client documentation

* updating the server context documentation

* fixes #9 on github

* fixing the factory decoding and adding examples

* pushing to version 1.0

* Fixing a bug in the asynchronous client that slipped through.

* complete tests for the sync client

* cleaning up some pep8 errors

* finished unit tests for async client

* adding another test to the test-install script

* finished covering sync client

* updating documentation

* adding another example, adding debug checks

* Fixing the serial implementation of everything

* updating lots of reference documentation
* fixing the fifo semantics of serial clients
* using transaction manager in async clients
* fixing references

* fixing incorrect rtu lenght calculation

* Add optional server_address to Sync and Async TCP/UDP Server API

* Improve erver_address defaults to passing None

* adding a few messages

* Adding a message encoding generator for testing.

- fixed messages not passing **kwargs to base
- fixed binary framer off by 1
- fixed mei_message rtu size tests
- added a message generator to use with message parser
- fixed message parser with ascii
- tested message parser with all formats (added to messages)

* adding documentation for message formats

* updating documentation and being pedantic

* Allowing overloading of message encoding

* allow codes like payload builder to encode
* added IPayloadBuilder interface (future)
* renamed builder methods to reflect vision
* added error code decoding to name
* fixed affected tests

* Cleaning up the build tools

- moving custom datastores to examples
- bumping required versions
- making the debug server console optional
- updating documentation

* adding support for pydev

* fixing broken nosetest (/dev/pts) and pydev issues

* adding bcd payload builder

* reworking contrib packages

* adding bcd payload contrib

* moving complex examples to contrib

* syncing version on pypi

* adding server rest api

* moving web -> bottle

* fixing documentation

* adding gui base

* adding initial manager page

* adding data view

* fixing error in example

* adding the ability to override sync client framer

* updating the performance test

* fixing documentation

* fixing memory leak in sync client

* adding modicon encoder/decoder

* Fix bogus calculation in ModbusSocketFramer.checkFrame
(one of the tests also seemed wrong, I had to fix it)

* Adding sunspec client example

* Changing @staticmethod to @classmethod to fix inheritance

* adding method to retrieve all the device blocks

* adding the initial mapper interface

* adding ideas in progress

* adding a modbus datastore saver

* making lrc/crc read stdin

* adding the callback server example

* adding a periodic updating example

* fixing documentation

* adding fix for stuck RTU streams

* fixing documentation error

* Adding an example for changing framers

- new example changing-framers.py
- added documentation link

* Reworking the transaction managers to be explicit

- Serial framers use the FIFO manager (results in order)
- Socket framers use the Dict manager (tid -> result)
- Fixed tests and removed bad global managers
- Managers no longer use global state (now instance)

* Bumping the version and adding a changelog

* Fixing a logic error in client code

- Now correctly choosing transaction manager

* Fixing 2to3 common warnings

* Fixed example typo in readme

* Adding slave context delete ability

- Fixes #20

* Fixing google code issue 69

- custom-message example had bugs
- http://code.google.com/p/pymodbus/issues/detail?id=69

* Fixed docstring in synchronous serial client connect() method

I think there was a copy/paste error in the docstring. It said tcp but I think it is supposed to be serial.

* Fix for issue #21

* Allowing options to be passed through

- This fixes issue #21
- Options now go to the transaction manager

* Adding source_address to TCP client inputs

* Typo

* Typo

* Typo

* Typo

* Adding some new examples

* modbus scraper (and documentation)
* thread safe datastore (and documentation)

* Adding a concurrent client example

* Allow specification of client connection handler in Modbus...Server
o ModbusTcpServer and ModbusUdpServer allows handler class other than
  default Modbus{Connected,Disconnected}RequestHandler
o Add debug logging on request failure, to help diagnose root causes

* Fixes #46

* Fixes #48

* Adds the option to drop into zero mode for slaves

* Fixes #42

* Bumping the version to 1.3.0

* add missing self operator

The parameter values of the constructor within  class WriteMultipleRegistersRequest can specified as single value or list of values. But if a single value is given the missing self operator on line 137 leads to crash in line 138 with error: TypeError("object of type 'int' has no len()",)

* typo: fix spelling of Parameter

Signed-off-by: Karl Palsson <[email protected]>

* async: missing slaves: add missing imports

1e0bcde is missing imports into the
async server, the import was only added to the sync server.

Further fix for #42

Signed-off-by: Karl Palsson <[email protected]>

* Fix zero_mode argument for ModbusSlaveContext

Using "-" in the argument name causes SyntaxError
'non-keyword arg after keyword arg'

* Fix typo in constants

* Adding an example and adding tcp timeout

* fixes #70

* Endianness now used in packing bytes

* Adding a libmodbus wrapper

* adding new contrib example of libmodbus client
* updating example documentation so users can find it

* closes #73

* Execute methods of Requests accept context

There were errors whenever a request that got handles in
other_message.py got it's execute method called, as it was being called
with a context parameter. The functions now accept this parameter,
although they don't do anything with it.

The tests have also been updated.

* Add Modbus RTU syncronous server example

* Signal handlers to stop in shutdown().

* WriteMultipleRegistersRequest: Handle values=None case

Currently, if None is passed in explicitly, or if values is not given,
the 'values' object is correctly identified as *not* having an __iter__
attribute, but is incorrectly identified as being a valid register value.
This breaks testInvalidWriteMultipleRegistersRequest.

Solution: if we see None, replace this with [] and skip the check for
__iter__.

* Fix payload tests.

Looking at the "encoded" string, it looks identical to that of the big
endian encoding string, and my understanding is that the data shown in
"encoded" *IS* big-endian, not little-endian.

I have no idea how this passed before, but it passes now.

* sync.ModbusUdpClient: Correct reference to settimeout.

I could not find a 'settimeout' (case-insensitive) anywhere in the
codebase other than on this line, but I *did* see it was a method of
socket.socket.

So I'll assume that this was *supposed* to be calling
socket.socket.settimeout.

* test-client-sync: Fix UDP connection test.

Rather than passing in a vanilla object, we should pass in something
that implements the settimeout method.

* Lazily initialize InstallManagementConsole

Simply importing the management console takes ~0.3 sec on an 1GHz Atom.
Since it is (I suspect) often not used, lazily importing it should help
startup for many programs.

* Fixes the UDP client socket timeout bug

fixes #51

* Implement mask_write_register method in client mixin

* Workaround for bug 101 #101

* Workaround for bug 101 #101

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Document Riptide specific instructions.

* Include Workaround for bug 101 bashwork#101

* Include Workaround for bug 101 bashwork#101

* Better tag names.

* pymodbus fix for modes RTU error cases.

* version bumped to c93103

* version bumped to c93103

* fixed issue with pymodbus timing over serial

* fixed issue with pymodbus timing over serial

* Add RIPTIDE.md  to .gitignore

* bump version to rc93105

*  fix merge conflicts

* fix version file

*  fix unit test failures

* cleanup

* #121 changelog updated

* Misc update Add __maintainer__ field in setup.py

* 1. #162, creating universal distribution for py2 and py3
2. Merge PR #152 , create compatible versions

* fix test failures

* fix ReadDeviceInformationRequest  encoding probelm

*  #166 fix failing tests on python 3.5

* mis - Updated documentation

* #167 updated documentation for CI

* #167 disable pep8/flake checks for the time being

* #167, fix install dependencies osx, remove pypy from supported python versions

* #167, fix install dependencies osx, remove pypy from supported python versions

* #167 , fix minior error in travis.yml

* Bump version to 1.3.0rc2

* Fix #170 and other misc updates

* Updated Documents

* Add coverage.rc to show missing lines with coverage >4.0

* new documentation

* #171 Minor bug fix in BinaryPayloadBuilder.add_string method for python3
dhoomakethu added a commit that referenced this issue Jun 8, 2017
…t requests (#183)

* Refactored and simplified calculation of RTU frames, added missing unit tests

* - fixing a few small issues
- bringing a few areas of coverage back up

* adding installer test script

* enabling the checksum tests in check frame, fixing tests

* * Updating documentation
* Adding code to handle messages that do not respond
* Fixes issue 41

* cleaning up the build tools a bit

* Adding more commands to the setup.py
- pep8, lint, 2to3

Fixed a few pep8/lint bugs to test

* moving files around

* pep8 and cleanup

* more cleanup

* Fixes issue 47

* adding another quick example

* cutting 200 pep8 errors

* working on py3 merge

* updating to python3

* reverting back changes, remember Switch flag next time

* adding some magic methods, just cause

* adding documentation pdf

* Fixes issue 49

* Adds True and False constants for older python versions.

Update issue 50

* adding tests for a few fixes

* Fixes issue 51

* fixing tests broken by interface change

* Updates issue 52

* Fixes issue 53

* Fix to add Python < 2.5 compatibility

This fix simply removes all the ternaries that were added
in Python 2.5.

Fixes issue 50

* adding a mostly complete diagnostic register implementation

* Adding more documentation and helpful factory methods.

The documentation added was to address some questions
with the synchronous and asynchrounous server implementations
as well as the functionality of the data contexts.

The factory methods were added by request to simplify the
creation of a fully populated DataBlock address space.

* adding modbus plus registers

* adding endian ability to payload builder

* Finishing the remaining modbus protocol

* Adding the remaining portions of the protocol (request/response)
* Tieing these into the factory decoder
* Adding tests to cover the new code (need more)
* Fixing a few bugs found along the way

* finished file read/write record requests

* documentation, more tests, fixing extra commands

* adding more tests

* Fixing the client/server async/sync implementations

- asynchronous client/server for tcp working and tested
- synchronous client/server for tcp/udp working and tested
- adding tests to exercise the synchronous client/server
- more documentation

* adding test stubs to get full coverage count

* working on jamod, need to set up more complete project

* adding GetDeviceInformationRequest

* adding read device information to decoder factory

* fixing some example errors

* working on the serial implementations

* fixing the synchronous server implementation

* updating functional tests and documentation for sync-serial

* updating tac files

* Updating the documentation for the serial client/servers

* adding readme to root

* Fixes issue 56

* Fixes issue 1

* adding a requirements file for virtualenv folk

* adding more cohesive code to the payload utilities

* forgot to add the new example to the doc index

* Fixing the rtu size calculation isse #55 on google code

* using the endian flag in register factory

* fixing bad documentation

* fixing issue 58 on google code

* Fix binary framer and add start and end tokens

Fixes a TypeError occuring while escaping token bytes in the message and
adds the start and end tokens to the packet.

* Adding checking in the client for an unconnected socket.

* Fixing issue 60 on google code (including ez_setup)

* fixing github issue #7

* adding tests and two utilities

* adding message parser utility

* Fixing extended message decoding

* Now correctly decoding sub function messages (diagnostic)
* Message parser now finished and documented
* Fixed broken logger unit test

* ModbusSparseDataBlock handled dictionaries incorrectly (they have an __iter__ attribute). Changed 'if' to 'elif'

* Updating the Readme.rst to explain how to install in zero dependency mode.

* Fixing issue #10

* updating the client documentation

* updating the server context documentation

* fixes #9 on github

* fixing the factory decoding and adding examples

* pushing to version 1.0

* Fixing a bug in the asynchronous client that slipped through.

* complete tests for the sync client

* cleaning up some pep8 errors

* finished unit tests for async client

* adding another test to the test-install script

* finished covering sync client

* updating documentation

* adding another example, adding debug checks

* Fixing the serial implementation of everything

* updating lots of reference documentation
* fixing the fifo semantics of serial clients
* using transaction manager in async clients
* fixing references

* fixing incorrect rtu lenght calculation

* Add optional server_address to Sync and Async TCP/UDP Server API

* Improve erver_address defaults to passing None

* adding a few messages

* Adding a message encoding generator for testing.

- fixed messages not passing **kwargs to base
- fixed binary framer off by 1
- fixed mei_message rtu size tests
- added a message generator to use with message parser
- fixed message parser with ascii
- tested message parser with all formats (added to messages)

* adding documentation for message formats

* updating documentation and being pedantic

* Allowing overloading of message encoding

* allow codes like payload builder to encode
* added IPayloadBuilder interface (future)
* renamed builder methods to reflect vision
* added error code decoding to name
* fixed affected tests

* Cleaning up the build tools

- moving custom datastores to examples
- bumping required versions
- making the debug server console optional
- updating documentation

* adding support for pydev

* fixing broken nosetest (/dev/pts) and pydev issues

* adding bcd payload builder

* reworking contrib packages

* adding bcd payload contrib

* moving complex examples to contrib

* syncing version on pypi

* adding server rest api

* moving web -> bottle

* fixing documentation

* adding gui base

* adding initial manager page

* adding data view

* fixing error in example

* adding the ability to override sync client framer

* updating the performance test

* fixing documentation

* fixing memory leak in sync client

* adding modicon encoder/decoder

* Fix bogus calculation in ModbusSocketFramer.checkFrame
(one of the tests also seemed wrong, I had to fix it)

* Adding sunspec client example

* Changing @staticmethod to @classmethod to fix inheritance

* adding method to retrieve all the device blocks

* adding the initial mapper interface

* adding ideas in progress

* adding a modbus datastore saver

* making lrc/crc read stdin

* adding the callback server example

* adding a periodic updating example

* fixing documentation

* adding fix for stuck RTU streams

* fixing documentation error

* Adding an example for changing framers

- new example changing-framers.py
- added documentation link

* Reworking the transaction managers to be explicit

- Serial framers use the FIFO manager (results in order)
- Socket framers use the Dict manager (tid -> result)
- Fixed tests and removed bad global managers
- Managers no longer use global state (now instance)

* Bumping the version and adding a changelog

* Fixing a logic error in client code

- Now correctly choosing transaction manager

* Fixing 2to3 common warnings

* Fixed example typo in readme

* Adding slave context delete ability

- Fixes #20

* Fixing google code issue 69

- custom-message example had bugs
- http://code.google.com/p/pymodbus/issues/detail?id=69

* Fixed docstring in synchronous serial client connect() method

I think there was a copy/paste error in the docstring. It said tcp but I think it is supposed to be serial.

* Fix for issue #21

* Allowing options to be passed through

- This fixes issue #21
- Options now go to the transaction manager

* Adding source_address to TCP client inputs

* Typo

* Typo

* Typo

* Typo

* Adding some new examples

* modbus scraper (and documentation)
* thread safe datastore (and documentation)

* Adding a concurrent client example

* Allow specification of client connection handler in Modbus...Server
o ModbusTcpServer and ModbusUdpServer allows handler class other than
  default Modbus{Connected,Disconnected}RequestHandler
o Add debug logging on request failure, to help diagnose root causes

* Fixes #46

* Fixes #48

* Adds the option to drop into zero mode for slaves

* Fixes #42

* Bumping the version to 1.3.0

* add missing self operator

The parameter values of the constructor within  class WriteMultipleRegistersRequest can specified as single value or list of values. But if a single value is given the missing self operator on line 137 leads to crash in line 138 with error: TypeError("object of type 'int' has no len()",)

* typo: fix spelling of Parameter

Signed-off-by: Karl Palsson <[email protected]>

* async: missing slaves: add missing imports

1e0bcde is missing imports into the
async server, the import was only added to the sync server.

Further fix for #42

Signed-off-by: Karl Palsson <[email protected]>

* Fix zero_mode argument for ModbusSlaveContext

Using "-" in the argument name causes SyntaxError
'non-keyword arg after keyword arg'

* Fix typo in constants

* Adding an example and adding tcp timeout

* fixes #70

* Endianness now used in packing bytes

* Adding a libmodbus wrapper

* adding new contrib example of libmodbus client
* updating example documentation so users can find it

* closes #73

* Execute methods of Requests accept context

There were errors whenever a request that got handles in
other_message.py got it's execute method called, as it was being called
with a context parameter. The functions now accept this parameter,
although they don't do anything with it.

The tests have also been updated.

* Add Modbus RTU syncronous server example

* Signal handlers to stop in shutdown().

* WriteMultipleRegistersRequest: Handle values=None case

Currently, if None is passed in explicitly, or if values is not given,
the 'values' object is correctly identified as *not* having an __iter__
attribute, but is incorrectly identified as being a valid register value.
This breaks testInvalidWriteMultipleRegistersRequest.

Solution: if we see None, replace this with [] and skip the check for
__iter__.

* Fix payload tests.

Looking at the "encoded" string, it looks identical to that of the big
endian encoding string, and my understanding is that the data shown in
"encoded" *IS* big-endian, not little-endian.

I have no idea how this passed before, but it passes now.

* sync.ModbusUdpClient: Correct reference to settimeout.

I could not find a 'settimeout' (case-insensitive) anywhere in the
codebase other than on this line, but I *did* see it was a method of
socket.socket.

So I'll assume that this was *supposed* to be calling
socket.socket.settimeout.

* test-client-sync: Fix UDP connection test.

Rather than passing in a vanilla object, we should pass in something
that implements the settimeout method.

* Lazily initialize InstallManagementConsole

Simply importing the management console takes ~0.3 sec on an 1GHz Atom.
Since it is (I suspect) often not used, lazily importing it should help
startup for many programs.

* Fixes the UDP client socket timeout bug

fixes #51

* Implement mask_write_register method in client mixin

* Workaround for bug 101 #101

* Workaround for bug 101 #101

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Document Riptide specific instructions.

* Include Workaround for bug 101 bashwork#101

* Include Workaround for bug 101 bashwork#101

* Better tag names.

* pymodbus fix for modes RTU error cases.

* version bumped to c93103

* version bumped to c93103

* fixed issue with pymodbus timing over serial

* fixed issue with pymodbus timing over serial

* Add RIPTIDE.md  to .gitignore

* bump version to rc93105

*  fix merge conflicts

* fix version file

*  fix unit test failures

* cleanup

* #121 changelog updated

* Misc update Add __maintainer__ field in setup.py

* 1. #162, creating universal distribution for py2 and py3
2. Merge PR #152 , create compatible versions

* fix test failures

* fix ReadDeviceInformationRequest  encoding probelm

*  #166 fix failing tests on python 3.5

* mis - Updated documentation

* #167 updated documentation for CI

* #167 disable pep8/flake checks for the time being

* #167, fix install dependencies osx, remove pypy from supported python versions

* #167, fix install dependencies osx, remove pypy from supported python versions

* #167 , fix minior error in travis.yml

* Bump version to 1.3.0rc2

* Fix #170 and other misc updates

* Updated Documents

* Add coverage.rc to show missing lines with coverage >4.0

* new documentation

* #171 Minor bug fix in BinaryPayloadBuilder.add_string method for python3

* 1. #179 fix error calculating response pdu length for read coil/discrete input requests
2. #179 add tests

* Enable debug logging for send packets
dhoomakethu added a commit that referenced this issue Aug 23, 2017
* adding another quick example

* cutting 200 pep8 errors

* working on py3 merge

* updating to python3

* reverting back changes, remember Switch flag next time

* adding some magic methods, just cause

* adding documentation pdf

* Fixes issue 49

* Adds True and False constants for older python versions.

Update issue 50

* adding tests for a few fixes

* Fixes issue 51

* fixing tests broken by interface change

* Updates issue 52

* Fixes issue 53

* Fix to add Python < 2.5 compatibility

This fix simply removes all the ternaries that were added
in Python 2.5.

Fixes issue 50

* adding a mostly complete diagnostic register implementation

* Adding more documentation and helpful factory methods.

The documentation added was to address some questions
with the synchronous and asynchrounous server implementations
as well as the functionality of the data contexts.

The factory methods were added by request to simplify the
creation of a fully populated DataBlock address space.

* adding modbus plus registers

* adding endian ability to payload builder

* Finishing the remaining modbus protocol

* Adding the remaining portions of the protocol (request/response)
* Tieing these into the factory decoder
* Adding tests to cover the new code (need more)
* Fixing a few bugs found along the way

* finished file read/write record requests

* documentation, more tests, fixing extra commands

* adding more tests

* Fixing the client/server async/sync implementations

- asynchronous client/server for tcp working and tested
- synchronous client/server for tcp/udp working and tested
- adding tests to exercise the synchronous client/server
- more documentation

* adding test stubs to get full coverage count

* working on jamod, need to set up more complete project

* adding GetDeviceInformationRequest

* adding read device information to decoder factory

* fixing some example errors

* working on the serial implementations

* fixing the synchronous server implementation

* updating functional tests and documentation for sync-serial

* updating tac files

* Updating the documentation for the serial client/servers

* adding readme to root

* Fixes issue 56

* Fixes issue 1

* adding a requirements file for virtualenv folk

* adding more cohesive code to the payload utilities

* forgot to add the new example to the doc index

* Fixing the rtu size calculation isse #55 on google code

* using the endian flag in register factory

* fixing bad documentation

* fixing issue 58 on google code

* Fix binary framer and add start and end tokens

Fixes a TypeError occuring while escaping token bytes in the message and
adds the start and end tokens to the packet.

* Adding checking in the client for an unconnected socket.

* Fixing issue 60 on google code (including ez_setup)

* fixing github issue #7

* adding tests and two utilities

* adding message parser utility

* Fixing extended message decoding

* Now correctly decoding sub function messages (diagnostic)
* Message parser now finished and documented
* Fixed broken logger unit test

* ModbusSparseDataBlock handled dictionaries incorrectly (they have an __iter__ attribute). Changed 'if' to 'elif'

* Updating the Readme.rst to explain how to install in zero dependency mode.

* Fixing issue #10

* updating the client documentation

* updating the server context documentation

* fixes #9 on github

* fixing the factory decoding and adding examples

* pushing to version 1.0

* Fixing a bug in the asynchronous client that slipped through.

* complete tests for the sync client

* cleaning up some pep8 errors

* finished unit tests for async client

* adding another test to the test-install script

* finished covering sync client

* updating documentation

* adding another example, adding debug checks

* Fixing the serial implementation of everything

* updating lots of reference documentation
* fixing the fifo semantics of serial clients
* using transaction manager in async clients
* fixing references

* fixing incorrect rtu lenght calculation

* Add optional server_address to Sync and Async TCP/UDP Server API

* Improve erver_address defaults to passing None

* adding a few messages

* Adding a message encoding generator for testing.

- fixed messages not passing **kwargs to base
- fixed binary framer off by 1
- fixed mei_message rtu size tests
- added a message generator to use with message parser
- fixed message parser with ascii
- tested message parser with all formats (added to messages)

* adding documentation for message formats

* updating documentation and being pedantic

* Allowing overloading of message encoding

* allow codes like payload builder to encode
* added IPayloadBuilder interface (future)
* renamed builder methods to reflect vision
* added error code decoding to name
* fixed affected tests

* Cleaning up the build tools

- moving custom datastores to examples
- bumping required versions
- making the debug server console optional
- updating documentation

* adding support for pydev

* fixing broken nosetest (/dev/pts) and pydev issues

* adding bcd payload builder

* reworking contrib packages

* adding bcd payload contrib

* moving complex examples to contrib

* syncing version on pypi

* adding server rest api

* moving web -> bottle

* fixing documentation

* adding gui base

* adding initial manager page

* adding data view

* fixing error in example

* adding the ability to override sync client framer

* updating the performance test

* fixing documentation

* fixing memory leak in sync client

* adding modicon encoder/decoder

* Fix bogus calculation in ModbusSocketFramer.checkFrame
(one of the tests also seemed wrong, I had to fix it)

* Adding sunspec client example

* Changing @staticmethod to @classmethod to fix inheritance

* adding method to retrieve all the device blocks

* adding the initial mapper interface

* adding ideas in progress

* adding a modbus datastore saver

* making lrc/crc read stdin

* adding the callback server example

* adding a periodic updating example

* fixing documentation

* adding fix for stuck RTU streams

* fixing documentation error

* Adding an example for changing framers

- new example changing-framers.py
- added documentation link

* Reworking the transaction managers to be explicit

- Serial framers use the FIFO manager (results in order)
- Socket framers use the Dict manager (tid -> result)
- Fixed tests and removed bad global managers
- Managers no longer use global state (now instance)

* Bumping the version and adding a changelog

* Fixing a logic error in client code

- Now correctly choosing transaction manager

* Fixing 2to3 common warnings

* Fixed example typo in readme

* Adding slave context delete ability

- Fixes #20

* Fixing google code issue 69

- custom-message example had bugs
- http://code.google.com/p/pymodbus/issues/detail?id=69

* Fixed docstring in synchronous serial client connect() method

I think there was a copy/paste error in the docstring. It said tcp but I think it is supposed to be serial.

* Fix for issue #21

* Allowing options to be passed through

- This fixes issue #21
- Options now go to the transaction manager

* Adding source_address to TCP client inputs

* Typo

* Typo

* Typo

* Typo

* Adding some new examples

* modbus scraper (and documentation)
* thread safe datastore (and documentation)

* Adding a concurrent client example

* Allow specification of client connection handler in Modbus...Server
o ModbusTcpServer and ModbusUdpServer allows handler class other than
  default Modbus{Connected,Disconnected}RequestHandler
o Add debug logging on request failure, to help diagnose root causes

* Fixes #46

* Fixes #48

* Adds the option to drop into zero mode for slaves

* Fixes #42

* Bumping the version to 1.3.0

* add missing self operator

The parameter values of the constructor within  class WriteMultipleRegistersRequest can specified as single value or list of values. But if a single value is given the missing self operator on line 137 leads to crash in line 138 with error: TypeError("object of type 'int' has no len()",)

* typo: fix spelling of Parameter

Signed-off-by: Karl Palsson <[email protected]>

* async: missing slaves: add missing imports

1e0bcde is missing imports into the
async server, the import was only added to the sync server.

Further fix for #42

Signed-off-by: Karl Palsson <[email protected]>

* Fix zero_mode argument for ModbusSlaveContext

Using "-" in the argument name causes SyntaxError
'non-keyword arg after keyword arg'

* Fix typo in constants

* Adding an example and adding tcp timeout

* fixes #70

* Endianness now used in packing bytes

* Adding a libmodbus wrapper

* adding new contrib example of libmodbus client
* updating example documentation so users can find it

* closes #73

* Execute methods of Requests accept context

There were errors whenever a request that got handles in
other_message.py got it's execute method called, as it was being called
with a context parameter. The functions now accept this parameter,
although they don't do anything with it.

The tests have also been updated.

* Add Modbus RTU syncronous server example

* Signal handlers to stop in shutdown().

* WriteMultipleRegistersRequest: Handle values=None case

Currently, if None is passed in explicitly, or if values is not given,
the 'values' object is correctly identified as *not* having an __iter__
attribute, but is incorrectly identified as being a valid register value.
This breaks testInvalidWriteMultipleRegistersRequest.

Solution: if we see None, replace this with [] and skip the check for
__iter__.

* Fix payload tests.

Looking at the "encoded" string, it looks identical to that of the big
endian encoding string, and my understanding is that the data shown in
"encoded" *IS* big-endian, not little-endian.

I have no idea how this passed before, but it passes now.

* sync.ModbusUdpClient: Correct reference to settimeout.

I could not find a 'settimeout' (case-insensitive) anywhere in the
codebase other than on this line, but I *did* see it was a method of
socket.socket.

So I'll assume that this was *supposed* to be calling
socket.socket.settimeout.

* test-client-sync: Fix UDP connection test.

Rather than passing in a vanilla object, we should pass in something
that implements the settimeout method.

* Lazily initialize InstallManagementConsole

Simply importing the management console takes ~0.3 sec on an 1GHz Atom.
Since it is (I suspect) often not used, lazily importing it should help
startup for many programs.

* Fixes the UDP client socket timeout bug

fixes #51

* Implement mask_write_register method in client mixin

* Workaround for bug 101 #101

* Workaround for bug 101 #101

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Document Riptide specific instructions.

* Include Workaround for bug 101 bashwork#101

* Include Workaround for bug 101 bashwork#101

* Better tag names.

* pymodbus fix for modes RTU error cases.

* version bumped to c93103

* version bumped to c93103

* fixed issue with pymodbus timing over serial

* fixed issue with pymodbus timing over serial

* Add RIPTIDE.md  to .gitignore

* bump version to rc93105

*  fix merge conflicts

* fix version file

*  fix unit test failures

* cleanup

* #121 changelog updated

* Misc update Add __maintainer__ field in setup.py

* 1. #162, creating universal distribution for py2 and py3
2. Merge PR #152 , create compatible versions

* fix test failures

* fix ReadDeviceInformationRequest  encoding probelm

*  #166 fix failing tests on python 3.5

* mis - Updated documentation

* #167 updated documentation for CI

* #167 disable pep8/flake checks for the time being

* #167, fix install dependencies osx, remove pypy from supported python versions

* #167, fix install dependencies osx, remove pypy from supported python versions

* #167 , fix minior error in travis.yml

* Bump version to 1.3.0rc2

* Fix #170 and other misc updates

* Updated Documents

* Add coverage.rc to show missing lines with coverage >4.0

* new documentation

* #171 Minor bug fix in BinaryPayloadBuilder.add_string method for python3

* 1. #179 fix error calculating response pdu length for read coil/discrete input requests
2. #179 add tests

* Enable debug logging for send packets

* #184 prepare for v1.3.1

* Make examples compatible withg python3

* fix #165, #174, #169, #175, #147, #146

* #184 updated changelog

* #142 move
MaskWriteRegisterRequest/MaskWriteRegisterResponse  to register_write_message.py from file_message.py

* fix #186 +misc updates

* Fixed obvious indentation error in InvalidResponseRecievedException class definition (#193)

Signed-off-by: Tomas Hozza <[email protected]>

* #190 fix examples - callback-server, modbus-payload

* #191 handle interframe timeout  for baudrate >19200 on Modbus RTU

* #201 Recover modbus server and client from previous errors

* Update changelog

* #149 SerialServer could be stopped when running on a thread

* #149 update changelogs

* unit tests for #191, #149 , fix obvious server_start errors

* Add new skip_bytes method to BinaryPayloadDecoder to skip over bytes (#205)

* Add new skip_bytes method to BinaryPayloadDecoder to skip over bytes
in the payload we are not interested in.

* Add an example of skip_bytes usage to the modbus-payload.py example.

* update readme
dhoomakethu added a commit to bhagn/pymodbus that referenced this issue Oct 10, 2017
* adding another quick example

* cutting 200 pep8 errors

* working on py3 merge

* updating to python3

* reverting back changes, remember Switch flag next time

* adding some magic methods, just cause

* adding documentation pdf

* Fixes issue 49

* Adds True and False constants for older python versions.

Update issue 50

* adding tests for a few fixes

* Fixes issue 51

* fixing tests broken by interface change

* Updates issue 52

* Fixes issue 53

* Fix to add Python < 2.5 compatibility

This fix simply removes all the ternaries that were added
in Python 2.5.

Fixes issue 50

* adding a mostly complete diagnostic register implementation

* Adding more documentation and helpful factory methods.

The documentation added was to address some questions
with the synchronous and asynchrounous server implementations
as well as the functionality of the data contexts.

The factory methods were added by request to simplify the
creation of a fully populated DataBlock address space.

* adding modbus plus registers

* adding endian ability to payload builder

* Finishing the remaining modbus protocol

* Adding the remaining portions of the protocol (request/response)
* Tieing these into the factory decoder
* Adding tests to cover the new code (need more)
* Fixing a few bugs found along the way

* finished file read/write record requests

* documentation, more tests, fixing extra commands

* adding more tests

* Fixing the client/server async/sync implementations

- asynchronous client/server for tcp working and tested
- synchronous client/server for tcp/udp working and tested
- adding tests to exercise the synchronous client/server
- more documentation

* adding test stubs to get full coverage count

* working on jamod, need to set up more complete project

* adding GetDeviceInformationRequest

* adding read device information to decoder factory

* fixing some example errors

* working on the serial implementations

* fixing the synchronous server implementation

* updating functional tests and documentation for sync-serial

* updating tac files

* Updating the documentation for the serial client/servers

* adding readme to root

* Fixes issue 56

* Fixes issue 1

* adding a requirements file for virtualenv folk

* adding more cohesive code to the payload utilities

* forgot to add the new example to the doc index

* Fixing the rtu size calculation isse pymodbus-dev#55 on google code

* using the endian flag in register factory

* fixing bad documentation

* fixing issue 58 on google code

* Fix binary framer and add start and end tokens

Fixes a TypeError occuring while escaping token bytes in the message and
adds the start and end tokens to the packet.

* Adding checking in the client for an unconnected socket.

* Fixing issue 60 on google code (including ez_setup)

* fixing github issue pymodbus-dev#7

* adding tests and two utilities

* adding message parser utility

* Fixing extended message decoding

* Now correctly decoding sub function messages (diagnostic)
* Message parser now finished and documented
* Fixed broken logger unit test

* ModbusSparseDataBlock handled dictionaries incorrectly (they have an __iter__ attribute). Changed 'if' to 'elif'

* Updating the Readme.rst to explain how to install in zero dependency mode.

* Fixing issue pymodbus-dev#10

* updating the client documentation

* updating the server context documentation

* fixes pymodbus-dev#9 on github

* fixing the factory decoding and adding examples

* pushing to version 1.0

* Fixing a bug in the asynchronous client that slipped through.

* complete tests for the sync client

* cleaning up some pep8 errors

* finished unit tests for async client

* adding another test to the test-install script

* finished covering sync client

* updating documentation

* adding another example, adding debug checks

* Fixing the serial implementation of everything

* updating lots of reference documentation
* fixing the fifo semantics of serial clients
* using transaction manager in async clients
* fixing references

* fixing incorrect rtu lenght calculation

* Add optional server_address to Sync and Async TCP/UDP Server API

* Improve erver_address defaults to passing None

* adding a few messages

* Adding a message encoding generator for testing.

- fixed messages not passing **kwargs to base
- fixed binary framer off by 1
- fixed mei_message rtu size tests
- added a message generator to use with message parser
- fixed message parser with ascii
- tested message parser with all formats (added to messages)

* adding documentation for message formats

* updating documentation and being pedantic

* Allowing overloading of message encoding

* allow codes like payload builder to encode
* added IPayloadBuilder interface (future)
* renamed builder methods to reflect vision
* added error code decoding to name
* fixed affected tests

* Cleaning up the build tools

- moving custom datastores to examples
- bumping required versions
- making the debug server console optional
- updating documentation

* adding support for pydev

* fixing broken nosetest (/dev/pts) and pydev issues

* adding bcd payload builder

* reworking contrib packages

* adding bcd payload contrib

* moving complex examples to contrib

* syncing version on pypi

* adding server rest api

* moving web -> bottle

* fixing documentation

* adding gui base

* adding initial manager page

* adding data view

* fixing error in example

* adding the ability to override sync client framer

* updating the performance test

* fixing documentation

* fixing memory leak in sync client

* adding modicon encoder/decoder

* Fix bogus calculation in ModbusSocketFramer.checkFrame
(one of the tests also seemed wrong, I had to fix it)

* Adding sunspec client example

* Changing @staticmethod to @classmethod to fix inheritance

* adding method to retrieve all the device blocks

* adding the initial mapper interface

* adding ideas in progress

* adding a modbus datastore saver

* making lrc/crc read stdin

* adding the callback server example

* adding a periodic updating example

* fixing documentation

* adding fix for stuck RTU streams

* fixing documentation error

* Adding an example for changing framers

- new example changing-framers.py
- added documentation link

* Reworking the transaction managers to be explicit

- Serial framers use the FIFO manager (results in order)
- Socket framers use the Dict manager (tid -> result)
- Fixed tests and removed bad global managers
- Managers no longer use global state (now instance)

* Bumping the version and adding a changelog

* Fixing a logic error in client code

- Now correctly choosing transaction manager

* Fixing 2to3 common warnings

* Fixed example typo in readme

* Adding slave context delete ability

- Fixes pymodbus-dev#20

* Fixing google code issue 69

- custom-message example had bugs
- http://code.google.com/p/pymodbus/issues/detail?id=69

* Fixed docstring in synchronous serial client connect() method

I think there was a copy/paste error in the docstring. It said tcp but I think it is supposed to be serial.

* Fix for issue pymodbus-dev#21

* Allowing options to be passed through

- This fixes issue pymodbus-dev#21
- Options now go to the transaction manager

* Adding source_address to TCP client inputs

* Typo

* Typo

* Typo

* Typo

* Adding some new examples

* modbus scraper (and documentation)
* thread safe datastore (and documentation)

* Adding a concurrent client example

* Allow specification of client connection handler in Modbus...Server
o ModbusTcpServer and ModbusUdpServer allows handler class other than
  default Modbus{Connected,Disconnected}RequestHandler
o Add debug logging on request failure, to help diagnose root causes

* Fixes pymodbus-dev#46

* Fixes pymodbus-dev#48

* Adds the option to drop into zero mode for slaves

* Fixes pymodbus-dev#42

* Bumping the version to 1.3.0

* add missing self operator

The parameter values of the constructor within  class WriteMultipleRegistersRequest can specified as single value or list of values. But if a single value is given the missing self operator on line 137 leads to crash in line 138 with error: TypeError("object of type 'int' has no len()",)

* typo: fix spelling of Parameter

Signed-off-by: Karl Palsson <[email protected]>

* async: missing slaves: add missing imports

1e0bcde is missing imports into the
async server, the import was only added to the sync server.

Further fix for pymodbus-dev#42

Signed-off-by: Karl Palsson <[email protected]>

* Fix zero_mode argument for ModbusSlaveContext

Using "-" in the argument name causes SyntaxError
'non-keyword arg after keyword arg'

* Fix typo in constants

* Adding an example and adding tcp timeout

* fixes pymodbus-dev#70

* Endianness now used in packing bytes

* Adding a libmodbus wrapper

* adding new contrib example of libmodbus client
* updating example documentation so users can find it

* closes pymodbus-dev#73

* Execute methods of Requests accept context

There were errors whenever a request that got handles in
other_message.py got it's execute method called, as it was being called
with a context parameter. The functions now accept this parameter,
although they don't do anything with it.

The tests have also been updated.

* Add Modbus RTU syncronous server example

* Signal handlers to stop in shutdown().

* WriteMultipleRegistersRequest: Handle values=None case

Currently, if None is passed in explicitly, or if values is not given,
the 'values' object is correctly identified as *not* having an __iter__
attribute, but is incorrectly identified as being a valid register value.
This breaks testInvalidWriteMultipleRegistersRequest.

Solution: if we see None, replace this with [] and skip the check for
__iter__.

* Fix payload tests.

Looking at the "encoded" string, it looks identical to that of the big
endian encoding string, and my understanding is that the data shown in
"encoded" *IS* big-endian, not little-endian.

I have no idea how this passed before, but it passes now.

* sync.ModbusUdpClient: Correct reference to settimeout.

I could not find a 'settimeout' (case-insensitive) anywhere in the
codebase other than on this line, but I *did* see it was a method of
socket.socket.

So I'll assume that this was *supposed* to be calling
socket.socket.settimeout.

* test-client-sync: Fix UDP connection test.

Rather than passing in a vanilla object, we should pass in something
that implements the settimeout method.

* Lazily initialize InstallManagementConsole

Simply importing the management console takes ~0.3 sec on an 1GHz Atom.
Since it is (I suspect) often not used, lazily importing it should help
startup for many programs.

* Fixes the UDP client socket timeout bug

fixes pymodbus-dev#51

* Implement mask_write_register method in client mixin

* Workaround for bug 101 pymodbus-dev#101

* Workaround for bug 101 pymodbus-dev#101

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Document Riptide specific instructions.

* Include Workaround for bug 101 bashwork#101

* Include Workaround for bug 101 bashwork#101

* Better tag names.

* pymodbus fix for modes RTU error cases.

* version bumped to c93103

* version bumped to c93103

* fixed issue with pymodbus timing over serial

* fixed issue with pymodbus timing over serial

* Add RIPTIDE.md  to .gitignore

* bump version to rc93105

*  fix merge conflicts

* fix version file

*  fix unit test failures

* cleanup

* pymodbus-dev#121 changelog updated

* Misc update Add __maintainer__ field in setup.py

* 1. pymodbus-dev#162, creating universal distribution for py2 and py3
2. Merge PR pymodbus-dev#152 , create compatible versions

* fix test failures

* fix ReadDeviceInformationRequest  encoding probelm

*  pymodbus-dev#166 fix failing tests on python 3.5

* mis - Updated documentation

* pymodbus-dev#167 updated documentation for CI

* pymodbus-dev#167 disable pep8/flake checks for the time being

* pymodbus-dev#167, fix install dependencies osx, remove pypy from supported python versions

* pymodbus-dev#167, fix install dependencies osx, remove pypy from supported python versions

* pymodbus-dev#167 , fix minior error in travis.yml

* Bump version to 1.3.0rc2

* Fix pymodbus-dev#170 and other misc updates

* Updated Documents

* Add coverage.rc to show missing lines with coverage >4.0

* new documentation

* pymodbus-dev#171 Minor bug fix in BinaryPayloadBuilder.add_string method for python3

* 1. pymodbus-dev#179 fix error calculating response pdu length for read coil/discrete input requests
2. pymodbus-dev#179 add tests

* Enable debug logging for send packets

* pymodbus-dev#184 prepare for v1.3.1

* Make examples compatible withg python3

* fix pymodbus-dev#165, pymodbus-dev#174, pymodbus-dev#169, pymodbus-dev#175, pymodbus-dev#147, pymodbus-dev#146

* pymodbus-dev#184 updated changelog

* pymodbus-dev#142 move
MaskWriteRegisterRequest/MaskWriteRegisterResponse  to register_write_message.py from file_message.py

* fix pymodbus-dev#186 +misc updates

* Fixed obvious indentation error in InvalidResponseRecievedException class definition (pymodbus-dev#193)

Signed-off-by: Tomas Hozza <[email protected]>

* pymodbus-dev#190 fix examples - callback-server, modbus-payload

* pymodbus-dev#191 handle interframe timeout  for baudrate >19200 on Modbus RTU

* pymodbus-dev#201 Recover modbus server and client from previous errors

* Update changelog

* pymodbus-dev#149 SerialServer could be stopped when running on a thread

* pymodbus-dev#149 update changelogs

* unit tests for pymodbus-dev#191, pymodbus-dev#149 , fix obvious server_start errors

* Add new skip_bytes method to BinaryPayloadDecoder to skip over bytes (pymodbus-dev#205)

* Add new skip_bytes method to BinaryPayloadDecoder to skip over bytes
in the payload we are not interested in.

* Add an example of skip_bytes usage to the modbus-payload.py example.

* update readme
dhoomakethu added a commit that referenced this issue Oct 26, 2017
* adding another quick example

* cutting 200 pep8 errors

* working on py3 merge

* updating to python3

* reverting back changes, remember Switch flag next time

* adding some magic methods, just cause

* adding documentation pdf

* Fixes issue 49

* Adds True and False constants for older python versions.

Update issue 50

* adding tests for a few fixes

* Fixes issue 51

* fixing tests broken by interface change

* Updates issue 52

* Fixes issue 53

* Fix to add Python < 2.5 compatibility

This fix simply removes all the ternaries that were added
in Python 2.5.

Fixes issue 50

* adding a mostly complete diagnostic register implementation

* Adding more documentation and helpful factory methods.

The documentation added was to address some questions
with the synchronous and asynchrounous server implementations
as well as the functionality of the data contexts.

The factory methods were added by request to simplify the
creation of a fully populated DataBlock address space.

* adding modbus plus registers

* adding endian ability to payload builder

* Finishing the remaining modbus protocol

* Adding the remaining portions of the protocol (request/response)
* Tieing these into the factory decoder
* Adding tests to cover the new code (need more)
* Fixing a few bugs found along the way

* finished file read/write record requests

* documentation, more tests, fixing extra commands

* adding more tests

* Fixing the client/server async/sync implementations

- asynchronous client/server for tcp working and tested
- synchronous client/server for tcp/udp working and tested
- adding tests to exercise the synchronous client/server
- more documentation

* adding test stubs to get full coverage count

* working on jamod, need to set up more complete project

* adding GetDeviceInformationRequest

* adding read device information to decoder factory

* fixing some example errors

* working on the serial implementations

* fixing the synchronous server implementation

* updating functional tests and documentation for sync-serial

* updating tac files

* Updating the documentation for the serial client/servers

* adding readme to root

* Fixes issue 56

* Fixes issue 1

* adding a requirements file for virtualenv folk

* adding more cohesive code to the payload utilities

* forgot to add the new example to the doc index

* Fixing the rtu size calculation isse #55 on google code

* using the endian flag in register factory

* fixing bad documentation

* fixing issue 58 on google code

* Fix binary framer and add start and end tokens

Fixes a TypeError occuring while escaping token bytes in the message and
adds the start and end tokens to the packet.

* Adding checking in the client for an unconnected socket.

* Fixing issue 60 on google code (including ez_setup)

* fixing github issue #7

* adding tests and two utilities

* adding message parser utility

* Fixing extended message decoding

* Now correctly decoding sub function messages (diagnostic)
* Message parser now finished and documented
* Fixed broken logger unit test

* ModbusSparseDataBlock handled dictionaries incorrectly (they have an __iter__ attribute). Changed 'if' to 'elif'

* Updating the Readme.rst to explain how to install in zero dependency mode.

* Fixing issue #10

* updating the client documentation

* updating the server context documentation

* fixes #9 on github

* fixing the factory decoding and adding examples

* pushing to version 1.0

* Fixing a bug in the asynchronous client that slipped through.

* complete tests for the sync client

* cleaning up some pep8 errors

* finished unit tests for async client

* adding another test to the test-install script

* finished covering sync client

* updating documentation

* adding another example, adding debug checks

* Fixing the serial implementation of everything

* updating lots of reference documentation
* fixing the fifo semantics of serial clients
* using transaction manager in async clients
* fixing references

* fixing incorrect rtu lenght calculation

* Add optional server_address to Sync and Async TCP/UDP Server API

* Improve erver_address defaults to passing None

* adding a few messages

* Adding a message encoding generator for testing.

- fixed messages not passing **kwargs to base
- fixed binary framer off by 1
- fixed mei_message rtu size tests
- added a message generator to use with message parser
- fixed message parser with ascii
- tested message parser with all formats (added to messages)

* adding documentation for message formats

* updating documentation and being pedantic

* Allowing overloading of message encoding

* allow codes like payload builder to encode
* added IPayloadBuilder interface (future)
* renamed builder methods to reflect vision
* added error code decoding to name
* fixed affected tests

* Cleaning up the build tools

- moving custom datastores to examples
- bumping required versions
- making the debug server console optional
- updating documentation

* adding support for pydev

* fixing broken nosetest (/dev/pts) and pydev issues

* adding bcd payload builder

* reworking contrib packages

* adding bcd payload contrib

* moving complex examples to contrib

* syncing version on pypi

* adding server rest api

* moving web -> bottle

* fixing documentation

* adding gui base

* adding initial manager page

* adding data view

* fixing error in example

* adding the ability to override sync client framer

* updating the performance test

* fixing documentation

* fixing memory leak in sync client

* adding modicon encoder/decoder

* Fix bogus calculation in ModbusSocketFramer.checkFrame
(one of the tests also seemed wrong, I had to fix it)

* Adding sunspec client example

* Changing @staticmethod to @classmethod to fix inheritance

* adding method to retrieve all the device blocks

* adding the initial mapper interface

* adding ideas in progress

* adding a modbus datastore saver

* making lrc/crc read stdin

* adding the callback server example

* adding a periodic updating example

* fixing documentation

* adding fix for stuck RTU streams

* fixing documentation error

* Adding an example for changing framers

- new example changing-framers.py
- added documentation link

* Reworking the transaction managers to be explicit

- Serial framers use the FIFO manager (results in order)
- Socket framers use the Dict manager (tid -> result)
- Fixed tests and removed bad global managers
- Managers no longer use global state (now instance)

* Bumping the version and adding a changelog

* Fixing a logic error in client code

- Now correctly choosing transaction manager

* Fixing 2to3 common warnings

* Fixed example typo in readme

* Adding slave context delete ability

- Fixes #20

* Fixing google code issue 69

- custom-message example had bugs
- http://code.google.com/p/pymodbus/issues/detail?id=69

* Fixed docstring in synchronous serial client connect() method

I think there was a copy/paste error in the docstring. It said tcp but I think it is supposed to be serial.

* Fix for issue #21

* Allowing options to be passed through

- This fixes issue #21
- Options now go to the transaction manager

* Adding source_address to TCP client inputs

* Typo

* Typo

* Typo

* Typo

* Adding some new examples

* modbus scraper (and documentation)
* thread safe datastore (and documentation)

* Adding a concurrent client example

* Allow specification of client connection handler in Modbus...Server
o ModbusTcpServer and ModbusUdpServer allows handler class other than
  default Modbus{Connected,Disconnected}RequestHandler
o Add debug logging on request failure, to help diagnose root causes

* Fixes #46

* Fixes #48

* Adds the option to drop into zero mode for slaves

* Fixes #42

* Bumping the version to 1.3.0

* add missing self operator

The parameter values of the constructor within  class WriteMultipleRegistersRequest can specified as single value or list of values. But if a single value is given the missing self operator on line 137 leads to crash in line 138 with error: TypeError("object of type 'int' has no len()",)

* typo: fix spelling of Parameter

Signed-off-by: Karl Palsson <[email protected]>

* async: missing slaves: add missing imports

1e0bcde is missing imports into the
async server, the import was only added to the sync server.

Further fix for #42

Signed-off-by: Karl Palsson <[email protected]>

* Fix zero_mode argument for ModbusSlaveContext

Using "-" in the argument name causes SyntaxError
'non-keyword arg after keyword arg'

* Fix typo in constants

* Adding an example and adding tcp timeout

* fixes #70

* Endianness now used in packing bytes

* Adding a libmodbus wrapper

* adding new contrib example of libmodbus client
* updating example documentation so users can find it

* closes #73

* Execute methods of Requests accept context

There were errors whenever a request that got handles in
other_message.py got it's execute method called, as it was being called
with a context parameter. The functions now accept this parameter,
although they don't do anything with it.

The tests have also been updated.

* Add Modbus RTU syncronous server example

* Signal handlers to stop in shutdown().

* WriteMultipleRegistersRequest: Handle values=None case

Currently, if None is passed in explicitly, or if values is not given,
the 'values' object is correctly identified as *not* having an __iter__
attribute, but is incorrectly identified as being a valid register value.
This breaks testInvalidWriteMultipleRegistersRequest.

Solution: if we see None, replace this with [] and skip the check for
__iter__.

* Fix payload tests.

Looking at the "encoded" string, it looks identical to that of the big
endian encoding string, and my understanding is that the data shown in
"encoded" *IS* big-endian, not little-endian.

I have no idea how this passed before, but it passes now.

* sync.ModbusUdpClient: Correct reference to settimeout.

I could not find a 'settimeout' (case-insensitive) anywhere in the
codebase other than on this line, but I *did* see it was a method of
socket.socket.

So I'll assume that this was *supposed* to be calling
socket.socket.settimeout.

* test-client-sync: Fix UDP connection test.

Rather than passing in a vanilla object, we should pass in something
that implements the settimeout method.

* Lazily initialize InstallManagementConsole

Simply importing the management console takes ~0.3 sec on an 1GHz Atom.
Since it is (I suspect) often not used, lazily importing it should help
startup for many programs.

* Fixes the UDP client socket timeout bug

fixes #51

* Implement mask_write_register method in client mixin

* Workaround for bug 101 #101

* Workaround for bug 101 #101

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Document Riptide specific instructions.

* Include Workaround for bug 101 bashwork#101

* Include Workaround for bug 101 bashwork#101

* Better tag names.

* pymodbus fix for modes RTU error cases.

* version bumped to c93103

* version bumped to c93103

* fixed issue with pymodbus timing over serial

* fixed issue with pymodbus timing over serial

* Add RIPTIDE.md  to .gitignore

* bump version to rc93105

*  fix merge conflicts

* fix version file

*  fix unit test failures

* cleanup

* #121 changelog updated

* Misc update Add __maintainer__ field in setup.py

* 1. #162, creating universal distribution for py2 and py3
2. Merge PR #152 , create compatible versions

* fix test failures

* fix ReadDeviceInformationRequest  encoding probelm

*  #166 fix failing tests on python 3.5

* mis - Updated documentation

* #167 updated documentation for CI

* #167 disable pep8/flake checks for the time being

* #167, fix install dependencies osx, remove pypy from supported python versions

* #167, fix install dependencies osx, remove pypy from supported python versions

* #167 , fix minior error in travis.yml

* Bump version to 1.3.0rc2

* Fix #170 and other misc updates

* Updated Documents

* Add coverage.rc to show missing lines with coverage >4.0

* new documentation

* #171 Minor bug fix in BinaryPayloadBuilder.add_string method for python3

* 1. #179 fix error calculating response pdu length for read coil/discrete input requests
2. #179 add tests

* Enable debug logging for send packets

* #184 prepare for v1.3.1

* Make examples compatible withg python3

* fix #165, #174, #169, #175, #147, #146

* #184 updated changelog

* #142 move
MaskWriteRegisterRequest/MaskWriteRegisterResponse  to register_write_message.py from file_message.py

* fix #186 +misc updates

* Fixed obvious indentation error in InvalidResponseRecievedException class definition (#193)

Signed-off-by: Tomas Hozza <[email protected]>

* #190 fix examples - callback-server, modbus-payload

* #191 handle interframe timeout  for baudrate >19200 on Modbus RTU

* #201 Recover modbus server and client from previous errors

* Update changelog

* #149 SerialServer could be stopped when running on a thread

* #149 update changelogs

* unit tests for #191, #149 , fix obvious server_start errors

* Add new skip_bytes method to BinaryPayloadDecoder to skip over bytes (#205)

* Add new skip_bytes method to BinaryPayloadDecoder to skip over bytes
in the payload we are not interested in.

* Add an example of skip_bytes usage to the modbus-payload.py example.

* update readme
dhoomakethu added a commit that referenced this issue Nov 28, 2017
* Refactored and simplified calculation of RTU frames, added missing unit tests

* - fixing a few small issues
- bringing a few areas of coverage back up

* adding installer test script

* enabling the checksum tests in check frame, fixing tests

* * Updating documentation
* Adding code to handle messages that do not respond
* Fixes issue 41

* cleaning up the build tools a bit

* Adding more commands to the setup.py
- pep8, lint, 2to3

Fixed a few pep8/lint bugs to test

* moving files around

* pep8 and cleanup

* more cleanup

* Fixes issue 47

* adding another quick example

* cutting 200 pep8 errors

* working on py3 merge

* updating to python3

* reverting back changes, remember Switch flag next time

* adding some magic methods, just cause

* adding documentation pdf

* Fixes issue 49

* Adds True and False constants for older python versions.

Update issue 50

* adding tests for a few fixes

* Fixes issue 51

* fixing tests broken by interface change

* Updates issue 52

* Fixes issue 53

* Fix to add Python < 2.5 compatibility

This fix simply removes all the ternaries that were added
in Python 2.5.

Fixes issue 50

* adding a mostly complete diagnostic register implementation

* Adding more documentation and helpful factory methods.

The documentation added was to address some questions
with the synchronous and asynchrounous server implementations
as well as the functionality of the data contexts.

The factory methods were added by request to simplify the
creation of a fully populated DataBlock address space.

* adding modbus plus registers

* adding endian ability to payload builder

* Finishing the remaining modbus protocol

* Adding the remaining portions of the protocol (request/response)
* Tieing these into the factory decoder
* Adding tests to cover the new code (need more)
* Fixing a few bugs found along the way

* finished file read/write record requests

* documentation, more tests, fixing extra commands

* adding more tests

* Fixing the client/server async/sync implementations

- asynchronous client/server for tcp working and tested
- synchronous client/server for tcp/udp working and tested
- adding tests to exercise the synchronous client/server
- more documentation

* adding test stubs to get full coverage count

* working on jamod, need to set up more complete project

* adding GetDeviceInformationRequest

* adding read device information to decoder factory

* fixing some example errors

* working on the serial implementations

* fixing the synchronous server implementation

* updating functional tests and documentation for sync-serial

* updating tac files

* Updating the documentation for the serial client/servers

* adding readme to root

* Fixes issue 56

* Fixes issue 1

* adding a requirements file for virtualenv folk

* adding more cohesive code to the payload utilities

* forgot to add the new example to the doc index

* Fixing the rtu size calculation isse #55 on google code

* using the endian flag in register factory

* fixing bad documentation

* fixing issue 58 on google code

* Fix binary framer and add start and end tokens

Fixes a TypeError occuring while escaping token bytes in the message and
adds the start and end tokens to the packet.

* Adding checking in the client for an unconnected socket.

* Fixing issue 60 on google code (including ez_setup)

* fixing github issue #7

* adding tests and two utilities

* adding message parser utility

* Fixing extended message decoding

* Now correctly decoding sub function messages (diagnostic)
* Message parser now finished and documented
* Fixed broken logger unit test

* ModbusSparseDataBlock handled dictionaries incorrectly (they have an __iter__ attribute). Changed 'if' to 'elif'

* Updating the Readme.rst to explain how to install in zero dependency mode.

* Fixing issue #10

* updating the client documentation

* updating the server context documentation

* fixes #9 on github

* fixing the factory decoding and adding examples

* pushing to version 1.0

* Fixing a bug in the asynchronous client that slipped through.

* complete tests for the sync client

* cleaning up some pep8 errors

* finished unit tests for async client

* adding another test to the test-install script

* finished covering sync client

* updating documentation

* adding another example, adding debug checks

* Fixing the serial implementation of everything

* updating lots of reference documentation
* fixing the fifo semantics of serial clients
* using transaction manager in async clients
* fixing references

* fixing incorrect rtu lenght calculation

* Add optional server_address to Sync and Async TCP/UDP Server API

* Improve erver_address defaults to passing None

* adding a few messages

* Adding a message encoding generator for testing.

- fixed messages not passing **kwargs to base
- fixed binary framer off by 1
- fixed mei_message rtu size tests
- added a message generator to use with message parser
- fixed message parser with ascii
- tested message parser with all formats (added to messages)

* adding documentation for message formats

* updating documentation and being pedantic

* Allowing overloading of message encoding

* allow codes like payload builder to encode
* added IPayloadBuilder interface (future)
* renamed builder methods to reflect vision
* added error code decoding to name
* fixed affected tests

* Cleaning up the build tools

- moving custom datastores to examples
- bumping required versions
- making the debug server console optional
- updating documentation

* adding support for pydev

* fixing broken nosetest (/dev/pts) and pydev issues

* adding bcd payload builder

* reworking contrib packages

* adding bcd payload contrib

* moving complex examples to contrib

* syncing version on pypi

* adding server rest api

* moving web -> bottle

* fixing documentation

* adding gui base

* adding initial manager page

* adding data view

* fixing error in example

* adding the ability to override sync client framer

* updating the performance test

* fixing documentation

* fixing memory leak in sync client

* adding modicon encoder/decoder

* Fix bogus calculation in ModbusSocketFramer.checkFrame
(one of the tests also seemed wrong, I had to fix it)

* Adding sunspec client example

* Changing @staticmethod to @classmethod to fix inheritance

* adding method to retrieve all the device blocks

* adding the initial mapper interface

* adding ideas in progress

* adding a modbus datastore saver

* making lrc/crc read stdin

* adding the callback server example

* adding a periodic updating example

* fixing documentation

* adding fix for stuck RTU streams

* fixing documentation error

* Adding an example for changing framers

- new example changing-framers.py
- added documentation link

* Reworking the transaction managers to be explicit

- Serial framers use the FIFO manager (results in order)
- Socket framers use the Dict manager (tid -> result)
- Fixed tests and removed bad global managers
- Managers no longer use global state (now instance)

* Bumping the version and adding a changelog

* Fixing a logic error in client code

- Now correctly choosing transaction manager

* Fixing 2to3 common warnings

* Fixed example typo in readme

* Adding slave context delete ability

- Fixes #20

* Fixing google code issue 69

- custom-message example had bugs
- http://code.google.com/p/pymodbus/issues/detail?id=69

* Fixed docstring in synchronous serial client connect() method

I think there was a copy/paste error in the docstring. It said tcp but I think it is supposed to be serial.

* Fix for issue #21

* Allowing options to be passed through

- This fixes issue #21
- Options now go to the transaction manager

* Adding source_address to TCP client inputs

* Typo

* Typo

* Typo

* Typo

* Adding some new examples

* modbus scraper (and documentation)
* thread safe datastore (and documentation)

* Adding a concurrent client example

* Allow specification of client connection handler in Modbus...Server
o ModbusTcpServer and ModbusUdpServer allows handler class other than
  default Modbus{Connected,Disconnected}RequestHandler
o Add debug logging on request failure, to help diagnose root causes

* Fixes #46

* Fixes #48

* Adds the option to drop into zero mode for slaves

* Fixes #42

* Bumping the version to 1.3.0

* add missing self operator

The parameter values of the constructor within  class WriteMultipleRegistersRequest can specified as single value or list of values. But if a single value is given the missing self operator on line 137 leads to crash in line 138 with error: TypeError("object of type 'int' has no len()",)

* typo: fix spelling of Parameter

Signed-off-by: Karl Palsson <[email protected]>

* async: missing slaves: add missing imports

1e0bcde is missing imports into the
async server, the import was only added to the sync server.

Further fix for #42

Signed-off-by: Karl Palsson <[email protected]>

* Fix zero_mode argument for ModbusSlaveContext

Using "-" in the argument name causes SyntaxError
'non-keyword arg after keyword arg'

* Fix typo in constants

* Adding an example and adding tcp timeout

* fixes #70

* Endianness now used in packing bytes

* Adding a libmodbus wrapper

* adding new contrib example of libmodbus client
* updating example documentation so users can find it

* closes #73

* Execute methods of Requests accept context

There were errors whenever a request that got handles in
other_message.py got it's execute method called, as it was being called
with a context parameter. The functions now accept this parameter,
although they don't do anything with it.

The tests have also been updated.

* Add Modbus RTU syncronous server example

* Signal handlers to stop in shutdown().

* WriteMultipleRegistersRequest: Handle values=None case

Currently, if None is passed in explicitly, or if values is not given,
the 'values' object is correctly identified as *not* having an __iter__
attribute, but is incorrectly identified as being a valid register value.
This breaks testInvalidWriteMultipleRegistersRequest.

Solution: if we see None, replace this with [] and skip the check for
__iter__.

* Fix payload tests.

Looking at the "encoded" string, it looks identical to that of the big
endian encoding string, and my understanding is that the data shown in
"encoded" *IS* big-endian, not little-endian.

I have no idea how this passed before, but it passes now.

* sync.ModbusUdpClient: Correct reference to settimeout.

I could not find a 'settimeout' (case-insensitive) anywhere in the
codebase other than on this line, but I *did* see it was a method of
socket.socket.

So I'll assume that this was *supposed* to be calling
socket.socket.settimeout.

* test-client-sync: Fix UDP connection test.

Rather than passing in a vanilla object, we should pass in something
that implements the settimeout method.

* Lazily initialize InstallManagementConsole

Simply importing the management console takes ~0.3 sec on an 1GHz Atom.
Since it is (I suspect) often not used, lazily importing it should help
startup for many programs.

* Fixes the UDP client socket timeout bug

fixes #51

* Implement mask_write_register method in client mixin

* Workaround for bug 101 #101

* Workaround for bug 101 #101

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Document Riptide specific instructions.

* Include Workaround for bug 101 bashwork#101

* Include Workaround for bug 101 bashwork#101

* Better tag names.

* pymodbus fix for modes RTU error cases.

* version bumped to c93103

* version bumped to c93103

* fixed issue with pymodbus timing over serial

* fixed issue with pymodbus timing over serial

* Add RIPTIDE.md  to .gitignore

* bump version to rc93105

*  fix merge conflicts

* fix version file

*  fix unit test failures

* cleanup

* #121 changelog updated

* Misc update Add __maintainer__ field in setup.py

* 1. #162, creating universal distribution for py2 and py3
2. Merge PR #152 , create compatible versions

* fix test failures

* fix ReadDeviceInformationRequest  encoding probelm
dhoomakethu added a commit that referenced this issue Nov 28, 2017
* Refactored and simplified calculation of RTU frames, added missing unit tests

* - fixing a few small issues
- bringing a few areas of coverage back up

* adding installer test script

* enabling the checksum tests in check frame, fixing tests

* * Updating documentation
* Adding code to handle messages that do not respond
* Fixes issue 41

* cleaning up the build tools a bit

* Adding more commands to the setup.py
- pep8, lint, 2to3

Fixed a few pep8/lint bugs to test

* moving files around

* pep8 and cleanup

* more cleanup

* Fixes issue 47

* adding another quick example

* cutting 200 pep8 errors

* working on py3 merge

* updating to python3

* reverting back changes, remember Switch flag next time

* adding some magic methods, just cause

* adding documentation pdf

* Fixes issue 49

* Adds True and False constants for older python versions.

Update issue 50

* adding tests for a few fixes

* Fixes issue 51

* fixing tests broken by interface change

* Updates issue 52

* Fixes issue 53

* Fix to add Python < 2.5 compatibility

This fix simply removes all the ternaries that were added
in Python 2.5.

Fixes issue 50

* adding a mostly complete diagnostic register implementation

* Adding more documentation and helpful factory methods.

The documentation added was to address some questions
with the synchronous and asynchrounous server implementations
as well as the functionality of the data contexts.

The factory methods were added by request to simplify the
creation of a fully populated DataBlock address space.

* adding modbus plus registers

* adding endian ability to payload builder

* Finishing the remaining modbus protocol

* Adding the remaining portions of the protocol (request/response)
* Tieing these into the factory decoder
* Adding tests to cover the new code (need more)
* Fixing a few bugs found along the way

* finished file read/write record requests

* documentation, more tests, fixing extra commands

* adding more tests

* Fixing the client/server async/sync implementations

- asynchronous client/server for tcp working and tested
- synchronous client/server for tcp/udp working and tested
- adding tests to exercise the synchronous client/server
- more documentation

* adding test stubs to get full coverage count

* working on jamod, need to set up more complete project

* adding GetDeviceInformationRequest

* adding read device information to decoder factory

* fixing some example errors

* working on the serial implementations

* fixing the synchronous server implementation

* updating functional tests and documentation for sync-serial

* updating tac files

* Updating the documentation for the serial client/servers

* adding readme to root

* Fixes issue 56

* Fixes issue 1

* adding a requirements file for virtualenv folk

* adding more cohesive code to the payload utilities

* forgot to add the new example to the doc index

* Fixing the rtu size calculation isse #55 on google code

* using the endian flag in register factory

* fixing bad documentation

* fixing issue 58 on google code

* Fix binary framer and add start and end tokens

Fixes a TypeError occuring while escaping token bytes in the message and
adds the start and end tokens to the packet.

* Adding checking in the client for an unconnected socket.

* Fixing issue 60 on google code (including ez_setup)

* fixing github issue #7

* adding tests and two utilities

* adding message parser utility

* Fixing extended message decoding

* Now correctly decoding sub function messages (diagnostic)
* Message parser now finished and documented
* Fixed broken logger unit test

* ModbusSparseDataBlock handled dictionaries incorrectly (they have an __iter__ attribute). Changed 'if' to 'elif'

* Updating the Readme.rst to explain how to install in zero dependency mode.

* Fixing issue #10

* updating the client documentation

* updating the server context documentation

* fixes #9 on github

* fixing the factory decoding and adding examples

* pushing to version 1.0

* Fixing a bug in the asynchronous client that slipped through.

* complete tests for the sync client

* cleaning up some pep8 errors

* finished unit tests for async client

* adding another test to the test-install script

* finished covering sync client

* updating documentation

* adding another example, adding debug checks

* Fixing the serial implementation of everything

* updating lots of reference documentation
* fixing the fifo semantics of serial clients
* using transaction manager in async clients
* fixing references

* fixing incorrect rtu lenght calculation

* Add optional server_address to Sync and Async TCP/UDP Server API

* Improve erver_address defaults to passing None

* adding a few messages

* Adding a message encoding generator for testing.

- fixed messages not passing **kwargs to base
- fixed binary framer off by 1
- fixed mei_message rtu size tests
- added a message generator to use with message parser
- fixed message parser with ascii
- tested message parser with all formats (added to messages)

* adding documentation for message formats

* updating documentation and being pedantic

* Allowing overloading of message encoding

* allow codes like payload builder to encode
* added IPayloadBuilder interface (future)
* renamed builder methods to reflect vision
* added error code decoding to name
* fixed affected tests

* Cleaning up the build tools

- moving custom datastores to examples
- bumping required versions
- making the debug server console optional
- updating documentation

* adding support for pydev

* fixing broken nosetest (/dev/pts) and pydev issues

* adding bcd payload builder

* reworking contrib packages

* adding bcd payload contrib

* moving complex examples to contrib

* syncing version on pypi

* adding server rest api

* moving web -> bottle

* fixing documentation

* adding gui base

* adding initial manager page

* adding data view

* fixing error in example

* adding the ability to override sync client framer

* updating the performance test

* fixing documentation

* fixing memory leak in sync client

* adding modicon encoder/decoder

* Fix bogus calculation in ModbusSocketFramer.checkFrame
(one of the tests also seemed wrong, I had to fix it)

* Adding sunspec client example

* Changing @staticmethod to @classmethod to fix inheritance

* adding method to retrieve all the device blocks

* adding the initial mapper interface

* adding ideas in progress

* adding a modbus datastore saver

* making lrc/crc read stdin

* adding the callback server example

* adding a periodic updating example

* fixing documentation

* adding fix for stuck RTU streams

* fixing documentation error

* Adding an example for changing framers

- new example changing-framers.py
- added documentation link

* Reworking the transaction managers to be explicit

- Serial framers use the FIFO manager (results in order)
- Socket framers use the Dict manager (tid -> result)
- Fixed tests and removed bad global managers
- Managers no longer use global state (now instance)

* Bumping the version and adding a changelog

* Fixing a logic error in client code

- Now correctly choosing transaction manager

* Fixing 2to3 common warnings

* Fixed example typo in readme

* Adding slave context delete ability

- Fixes #20

* Fixing google code issue 69

- custom-message example had bugs
- http://code.google.com/p/pymodbus/issues/detail?id=69

* Fixed docstring in synchronous serial client connect() method

I think there was a copy/paste error in the docstring. It said tcp but I think it is supposed to be serial.

* Fix for issue #21

* Allowing options to be passed through

- This fixes issue #21
- Options now go to the transaction manager

* Adding source_address to TCP client inputs

* Typo

* Typo

* Typo

* Typo

* Adding some new examples

* modbus scraper (and documentation)
* thread safe datastore (and documentation)

* Adding a concurrent client example

* Allow specification of client connection handler in Modbus...Server
o ModbusTcpServer and ModbusUdpServer allows handler class other than
  default Modbus{Connected,Disconnected}RequestHandler
o Add debug logging on request failure, to help diagnose root causes

* Fixes #46

* Fixes #48

* Adds the option to drop into zero mode for slaves

* Fixes #42

* Bumping the version to 1.3.0

* add missing self operator

The parameter values of the constructor within  class WriteMultipleRegistersRequest can specified as single value or list of values. But if a single value is given the missing self operator on line 137 leads to crash in line 138 with error: TypeError("object of type 'int' has no len()",)

* typo: fix spelling of Parameter

Signed-off-by: Karl Palsson <[email protected]>

* async: missing slaves: add missing imports

1e0bcde is missing imports into the
async server, the import was only added to the sync server.

Further fix for #42

Signed-off-by: Karl Palsson <[email protected]>

* Fix zero_mode argument for ModbusSlaveContext

Using "-" in the argument name causes SyntaxError
'non-keyword arg after keyword arg'

* Fix typo in constants

* Adding an example and adding tcp timeout

* fixes #70

* Endianness now used in packing bytes

* Adding a libmodbus wrapper

* adding new contrib example of libmodbus client
* updating example documentation so users can find it

* closes #73

* Execute methods of Requests accept context

There were errors whenever a request that got handles in
other_message.py got it's execute method called, as it was being called
with a context parameter. The functions now accept this parameter,
although they don't do anything with it.

The tests have also been updated.

* Add Modbus RTU syncronous server example

* Signal handlers to stop in shutdown().

* WriteMultipleRegistersRequest: Handle values=None case

Currently, if None is passed in explicitly, or if values is not given,
the 'values' object is correctly identified as *not* having an __iter__
attribute, but is incorrectly identified as being a valid register value.
This breaks testInvalidWriteMultipleRegistersRequest.

Solution: if we see None, replace this with [] and skip the check for
__iter__.

* Fix payload tests.

Looking at the "encoded" string, it looks identical to that of the big
endian encoding string, and my understanding is that the data shown in
"encoded" *IS* big-endian, not little-endian.

I have no idea how this passed before, but it passes now.

* sync.ModbusUdpClient: Correct reference to settimeout.

I could not find a 'settimeout' (case-insensitive) anywhere in the
codebase other than on this line, but I *did* see it was a method of
socket.socket.

So I'll assume that this was *supposed* to be calling
socket.socket.settimeout.

* test-client-sync: Fix UDP connection test.

Rather than passing in a vanilla object, we should pass in something
that implements the settimeout method.

* Lazily initialize InstallManagementConsole

Simply importing the management console takes ~0.3 sec on an 1GHz Atom.
Since it is (I suspect) often not used, lazily importing it should help
startup for many programs.

* Fixes the UDP client socket timeout bug

fixes #51

* Implement mask_write_register method in client mixin

* Workaround for bug 101 #101

* Workaround for bug 101 #101

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Document Riptide specific instructions.

* Include Workaround for bug 101 bashwork#101

* Include Workaround for bug 101 bashwork#101

* Better tag names.

* pymodbus fix for modes RTU error cases.

* version bumped to c93103

* version bumped to c93103

* fixed issue with pymodbus timing over serial

* fixed issue with pymodbus timing over serial

* Add RIPTIDE.md  to .gitignore

* bump version to rc93105

*  fix merge conflicts

* fix version file

*  fix unit test failures

* cleanup

* #121 changelog updated

* Misc update Add __maintainer__ field in setup.py

* 1. #162, creating universal distribution for py2 and py3
2. Merge PR #152 , create compatible versions

* fix test failures

* fix ReadDeviceInformationRequest  encoding problem

*  #166 fix failing tests on python 3.5

* mis - Updated documentation

* #167 updated documentation for CI

* #167 disable pep8/flake checks for the time being

* #167, fix install dependencies osx, remove pypy from supported python versions

* #167, fix install dependencies osx, remove pypy from supported python versions

* #167 , fix minior error in travis.yml
*  Bump version to 1.3.0rc2, update README
dhoomakethu added a commit that referenced this issue Nov 28, 2017
* Refactored and simplified calculation of RTU frames, added missing unit tests

* - fixing a few small issues
- bringing a few areas of coverage back up

* adding installer test script

* enabling the checksum tests in check frame, fixing tests

* * Updating documentation
* Adding code to handle messages that do not respond
* Fixes issue 41

* cleaning up the build tools a bit

* Adding more commands to the setup.py
- pep8, lint, 2to3

Fixed a few pep8/lint bugs to test

* moving files around

* pep8 and cleanup

* more cleanup

* Fixes issue 47

* adding another quick example

* cutting 200 pep8 errors

* working on py3 merge

* updating to python3

* reverting back changes, remember Switch flag next time

* adding some magic methods, just cause

* adding documentation pdf

* Fixes issue 49

* Adds True and False constants for older python versions.

Update issue 50

* adding tests for a few fixes

* Fixes issue 51

* fixing tests broken by interface change

* Updates issue 52

* Fixes issue 53

* Fix to add Python < 2.5 compatibility

This fix simply removes all the ternaries that were added
in Python 2.5.

Fixes issue 50

* adding a mostly complete diagnostic register implementation

* Adding more documentation and helpful factory methods.

The documentation added was to address some questions
with the synchronous and asynchrounous server implementations
as well as the functionality of the data contexts.

The factory methods were added by request to simplify the
creation of a fully populated DataBlock address space.

* adding modbus plus registers

* adding endian ability to payload builder

* Finishing the remaining modbus protocol

* Adding the remaining portions of the protocol (request/response)
* Tieing these into the factory decoder
* Adding tests to cover the new code (need more)
* Fixing a few bugs found along the way

* finished file read/write record requests

* documentation, more tests, fixing extra commands

* adding more tests

* Fixing the client/server async/sync implementations

- asynchronous client/server for tcp working and tested
- synchronous client/server for tcp/udp working and tested
- adding tests to exercise the synchronous client/server
- more documentation

* adding test stubs to get full coverage count

* working on jamod, need to set up more complete project

* adding GetDeviceInformationRequest

* adding read device information to decoder factory

* fixing some example errors

* working on the serial implementations

* fixing the synchronous server implementation

* updating functional tests and documentation for sync-serial

* updating tac files

* Updating the documentation for the serial client/servers

* adding readme to root

* Fixes issue 56

* Fixes issue 1

* adding a requirements file for virtualenv folk

* adding more cohesive code to the payload utilities

* forgot to add the new example to the doc index

* Fixing the rtu size calculation isse #55 on google code

* using the endian flag in register factory

* fixing bad documentation

* fixing issue 58 on google code

* Fix binary framer and add start and end tokens

Fixes a TypeError occuring while escaping token bytes in the message and
adds the start and end tokens to the packet.

* Adding checking in the client for an unconnected socket.

* Fixing issue 60 on google code (including ez_setup)

* fixing github issue #7

* adding tests and two utilities

* adding message parser utility

* Fixing extended message decoding

* Now correctly decoding sub function messages (diagnostic)
* Message parser now finished and documented
* Fixed broken logger unit test

* ModbusSparseDataBlock handled dictionaries incorrectly (they have an __iter__ attribute). Changed 'if' to 'elif'

* Updating the Readme.rst to explain how to install in zero dependency mode.

* Fixing issue #10

* updating the client documentation

* updating the server context documentation

* fixes #9 on github

* fixing the factory decoding and adding examples

* pushing to version 1.0

* Fixing a bug in the asynchronous client that slipped through.

* complete tests for the sync client

* cleaning up some pep8 errors

* finished unit tests for async client

* adding another test to the test-install script

* finished covering sync client

* updating documentation

* adding another example, adding debug checks

* Fixing the serial implementation of everything

* updating lots of reference documentation
* fixing the fifo semantics of serial clients
* using transaction manager in async clients
* fixing references

* fixing incorrect rtu lenght calculation

* Add optional server_address to Sync and Async TCP/UDP Server API

* Improve erver_address defaults to passing None

* adding a few messages

* Adding a message encoding generator for testing.

- fixed messages not passing **kwargs to base
- fixed binary framer off by 1
- fixed mei_message rtu size tests
- added a message generator to use with message parser
- fixed message parser with ascii
- tested message parser with all formats (added to messages)

* adding documentation for message formats

* updating documentation and being pedantic

* Allowing overloading of message encoding

* allow codes like payload builder to encode
* added IPayloadBuilder interface (future)
* renamed builder methods to reflect vision
* added error code decoding to name
* fixed affected tests

* Cleaning up the build tools

- moving custom datastores to examples
- bumping required versions
- making the debug server console optional
- updating documentation

* adding support for pydev

* fixing broken nosetest (/dev/pts) and pydev issues

* adding bcd payload builder

* reworking contrib packages

* adding bcd payload contrib

* moving complex examples to contrib

* syncing version on pypi

* adding server rest api

* moving web -> bottle

* fixing documentation

* adding gui base

* adding initial manager page

* adding data view

* fixing error in example

* adding the ability to override sync client framer

* updating the performance test

* fixing documentation

* fixing memory leak in sync client

* adding modicon encoder/decoder

* Fix bogus calculation in ModbusSocketFramer.checkFrame
(one of the tests also seemed wrong, I had to fix it)

* Adding sunspec client example

* Changing @staticmethod to @classmethod to fix inheritance

* adding method to retrieve all the device blocks

* adding the initial mapper interface

* adding ideas in progress

* adding a modbus datastore saver

* making lrc/crc read stdin

* adding the callback server example

* adding a periodic updating example

* fixing documentation

* adding fix for stuck RTU streams

* fixing documentation error

* Adding an example for changing framers

- new example changing-framers.py
- added documentation link

* Reworking the transaction managers to be explicit

- Serial framers use the FIFO manager (results in order)
- Socket framers use the Dict manager (tid -> result)
- Fixed tests and removed bad global managers
- Managers no longer use global state (now instance)

* Bumping the version and adding a changelog

* Fixing a logic error in client code

- Now correctly choosing transaction manager

* Fixing 2to3 common warnings

* Fixed example typo in readme

* Adding slave context delete ability

- Fixes #20

* Fixing google code issue 69

- custom-message example had bugs
- http://code.google.com/p/pymodbus/issues/detail?id=69

* Fixed docstring in synchronous serial client connect() method

I think there was a copy/paste error in the docstring. It said tcp but I think it is supposed to be serial.

* Fix for issue #21

* Allowing options to be passed through

- This fixes issue #21
- Options now go to the transaction manager

* Adding source_address to TCP client inputs

* Typo

* Typo

* Typo

* Typo

* Adding some new examples

* modbus scraper (and documentation)
* thread safe datastore (and documentation)

* Adding a concurrent client example

* Allow specification of client connection handler in Modbus...Server
o ModbusTcpServer and ModbusUdpServer allows handler class other than
  default Modbus{Connected,Disconnected}RequestHandler
o Add debug logging on request failure, to help diagnose root causes

* Fixes #46

* Fixes #48

* Adds the option to drop into zero mode for slaves

* Fixes #42

* Bumping the version to 1.3.0

* add missing self operator

The parameter values of the constructor within  class WriteMultipleRegistersRequest can specified as single value or list of values. But if a single value is given the missing self operator on line 137 leads to crash in line 138 with error: TypeError("object of type 'int' has no len()",)

* typo: fix spelling of Parameter

Signed-off-by: Karl Palsson <[email protected]>

* async: missing slaves: add missing imports

1e0bcde is missing imports into the
async server, the import was only added to the sync server.

Further fix for #42

Signed-off-by: Karl Palsson <[email protected]>

* Fix zero_mode argument for ModbusSlaveContext

Using "-" in the argument name causes SyntaxError
'non-keyword arg after keyword arg'

* Fix typo in constants

* Adding an example and adding tcp timeout

* fixes #70

* Endianness now used in packing bytes

* Adding a libmodbus wrapper

* adding new contrib example of libmodbus client
* updating example documentation so users can find it

* closes #73

* Execute methods of Requests accept context

There were errors whenever a request that got handles in
other_message.py got it's execute method called, as it was being called
with a context parameter. The functions now accept this parameter,
although they don't do anything with it.

The tests have also been updated.

* Add Modbus RTU syncronous server example

* Signal handlers to stop in shutdown().

* WriteMultipleRegistersRequest: Handle values=None case

Currently, if None is passed in explicitly, or if values is not given,
the 'values' object is correctly identified as *not* having an __iter__
attribute, but is incorrectly identified as being a valid register value.
This breaks testInvalidWriteMultipleRegistersRequest.

Solution: if we see None, replace this with [] and skip the check for
__iter__.

* Fix payload tests.

Looking at the "encoded" string, it looks identical to that of the big
endian encoding string, and my understanding is that the data shown in
"encoded" *IS* big-endian, not little-endian.

I have no idea how this passed before, but it passes now.

* sync.ModbusUdpClient: Correct reference to settimeout.

I could not find a 'settimeout' (case-insensitive) anywhere in the
codebase other than on this line, but I *did* see it was a method of
socket.socket.

So I'll assume that this was *supposed* to be calling
socket.socket.settimeout.

* test-client-sync: Fix UDP connection test.

Rather than passing in a vanilla object, we should pass in something
that implements the settimeout method.

* Lazily initialize InstallManagementConsole

Simply importing the management console takes ~0.3 sec on an 1GHz Atom.
Since it is (I suspect) often not used, lazily importing it should help
startup for many programs.

* Fixes the UDP client socket timeout bug

fixes #51

* Implement mask_write_register method in client mixin

* Workaround for bug 101 #101

* Workaround for bug 101 #101

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Document Riptide specific instructions.

* Include Workaround for bug 101 bashwork#101

* Include Workaround for bug 101 bashwork#101

* Better tag names.

* pymodbus fix for modes RTU error cases.

* version bumped to c93103

* version bumped to c93103

* fixed issue with pymodbus timing over serial

* fixed issue with pymodbus timing over serial

* Add RIPTIDE.md  to .gitignore

* bump version to rc93105

*  fix merge conflicts

* fix version file

*  fix unit test failures

* cleanup

* #121 changelog updated

* Misc update Add __maintainer__ field in setup.py

* 1. #162, creating universal distribution for py2 and py3
2. Merge PR #152 , create compatible versions

* fix test failures

* fix ReadDeviceInformationRequest  encoding probelm

*  #166 fix failing tests on python 3.5

* mis - Updated documentation

* #167 updated documentation for CI

* #167 disable pep8/flake checks for the time being

* #167, fix install dependencies osx, remove pypy from supported python versions

* #167, fix install dependencies osx, remove pypy from supported python versions

* #167 , fix minior error in travis.yml

* Bump version to 1.3.0rc2

* Fix #170 and other misc updates

* Updated Documents

* Add coverage.rc to show missing lines with coverage >4.0

* new documentation

* #171 Minor bug fix in BinaryPayloadBuilder.add_string method for python3
dhoomakethu added a commit that referenced this issue Nov 28, 2017
…t requests (#183)

* Refactored and simplified calculation of RTU frames, added missing unit tests

* - fixing a few small issues
- bringing a few areas of coverage back up

* adding installer test script

* enabling the checksum tests in check frame, fixing tests

* * Updating documentation
* Adding code to handle messages that do not respond
* Fixes issue 41

* cleaning up the build tools a bit

* Adding more commands to the setup.py
- pep8, lint, 2to3

Fixed a few pep8/lint bugs to test

* moving files around

* pep8 and cleanup

* more cleanup

* Fixes issue 47

* adding another quick example

* cutting 200 pep8 errors

* working on py3 merge

* updating to python3

* reverting back changes, remember Switch flag next time

* adding some magic methods, just cause

* adding documentation pdf

* Fixes issue 49

* Adds True and False constants for older python versions.

Update issue 50

* adding tests for a few fixes

* Fixes issue 51

* fixing tests broken by interface change

* Updates issue 52

* Fixes issue 53

* Fix to add Python < 2.5 compatibility

This fix simply removes all the ternaries that were added
in Python 2.5.

Fixes issue 50

* adding a mostly complete diagnostic register implementation

* Adding more documentation and helpful factory methods.

The documentation added was to address some questions
with the synchronous and asynchrounous server implementations
as well as the functionality of the data contexts.

The factory methods were added by request to simplify the
creation of a fully populated DataBlock address space.

* adding modbus plus registers

* adding endian ability to payload builder

* Finishing the remaining modbus protocol

* Adding the remaining portions of the protocol (request/response)
* Tieing these into the factory decoder
* Adding tests to cover the new code (need more)
* Fixing a few bugs found along the way

* finished file read/write record requests

* documentation, more tests, fixing extra commands

* adding more tests

* Fixing the client/server async/sync implementations

- asynchronous client/server for tcp working and tested
- synchronous client/server for tcp/udp working and tested
- adding tests to exercise the synchronous client/server
- more documentation

* adding test stubs to get full coverage count

* working on jamod, need to set up more complete project

* adding GetDeviceInformationRequest

* adding read device information to decoder factory

* fixing some example errors

* working on the serial implementations

* fixing the synchronous server implementation

* updating functional tests and documentation for sync-serial

* updating tac files

* Updating the documentation for the serial client/servers

* adding readme to root

* Fixes issue 56

* Fixes issue 1

* adding a requirements file for virtualenv folk

* adding more cohesive code to the payload utilities

* forgot to add the new example to the doc index

* Fixing the rtu size calculation isse #55 on google code

* using the endian flag in register factory

* fixing bad documentation

* fixing issue 58 on google code

* Fix binary framer and add start and end tokens

Fixes a TypeError occuring while escaping token bytes in the message and
adds the start and end tokens to the packet.

* Adding checking in the client for an unconnected socket.

* Fixing issue 60 on google code (including ez_setup)

* fixing github issue #7

* adding tests and two utilities

* adding message parser utility

* Fixing extended message decoding

* Now correctly decoding sub function messages (diagnostic)
* Message parser now finished and documented
* Fixed broken logger unit test

* ModbusSparseDataBlock handled dictionaries incorrectly (they have an __iter__ attribute). Changed 'if' to 'elif'

* Updating the Readme.rst to explain how to install in zero dependency mode.

* Fixing issue #10

* updating the client documentation

* updating the server context documentation

* fixes #9 on github

* fixing the factory decoding and adding examples

* pushing to version 1.0

* Fixing a bug in the asynchronous client that slipped through.

* complete tests for the sync client

* cleaning up some pep8 errors

* finished unit tests for async client

* adding another test to the test-install script

* finished covering sync client

* updating documentation

* adding another example, adding debug checks

* Fixing the serial implementation of everything

* updating lots of reference documentation
* fixing the fifo semantics of serial clients
* using transaction manager in async clients
* fixing references

* fixing incorrect rtu lenght calculation

* Add optional server_address to Sync and Async TCP/UDP Server API

* Improve erver_address defaults to passing None

* adding a few messages

* Adding a message encoding generator for testing.

- fixed messages not passing **kwargs to base
- fixed binary framer off by 1
- fixed mei_message rtu size tests
- added a message generator to use with message parser
- fixed message parser with ascii
- tested message parser with all formats (added to messages)

* adding documentation for message formats

* updating documentation and being pedantic

* Allowing overloading of message encoding

* allow codes like payload builder to encode
* added IPayloadBuilder interface (future)
* renamed builder methods to reflect vision
* added error code decoding to name
* fixed affected tests

* Cleaning up the build tools

- moving custom datastores to examples
- bumping required versions
- making the debug server console optional
- updating documentation

* adding support for pydev

* fixing broken nosetest (/dev/pts) and pydev issues

* adding bcd payload builder

* reworking contrib packages

* adding bcd payload contrib

* moving complex examples to contrib

* syncing version on pypi

* adding server rest api

* moving web -> bottle

* fixing documentation

* adding gui base

* adding initial manager page

* adding data view

* fixing error in example

* adding the ability to override sync client framer

* updating the performance test

* fixing documentation

* fixing memory leak in sync client

* adding modicon encoder/decoder

* Fix bogus calculation in ModbusSocketFramer.checkFrame
(one of the tests also seemed wrong, I had to fix it)

* Adding sunspec client example

* Changing @staticmethod to @classmethod to fix inheritance

* adding method to retrieve all the device blocks

* adding the initial mapper interface

* adding ideas in progress

* adding a modbus datastore saver

* making lrc/crc read stdin

* adding the callback server example

* adding a periodic updating example

* fixing documentation

* adding fix for stuck RTU streams

* fixing documentation error

* Adding an example for changing framers

- new example changing-framers.py
- added documentation link

* Reworking the transaction managers to be explicit

- Serial framers use the FIFO manager (results in order)
- Socket framers use the Dict manager (tid -> result)
- Fixed tests and removed bad global managers
- Managers no longer use global state (now instance)

* Bumping the version and adding a changelog

* Fixing a logic error in client code

- Now correctly choosing transaction manager

* Fixing 2to3 common warnings

* Fixed example typo in readme

* Adding slave context delete ability

- Fixes #20

* Fixing google code issue 69

- custom-message example had bugs
- http://code.google.com/p/pymodbus/issues/detail?id=69

* Fixed docstring in synchronous serial client connect() method

I think there was a copy/paste error in the docstring. It said tcp but I think it is supposed to be serial.

* Fix for issue #21

* Allowing options to be passed through

- This fixes issue #21
- Options now go to the transaction manager

* Adding source_address to TCP client inputs

* Typo

* Typo

* Typo

* Typo

* Adding some new examples

* modbus scraper (and documentation)
* thread safe datastore (and documentation)

* Adding a concurrent client example

* Allow specification of client connection handler in Modbus...Server
o ModbusTcpServer and ModbusUdpServer allows handler class other than
  default Modbus{Connected,Disconnected}RequestHandler
o Add debug logging on request failure, to help diagnose root causes

* Fixes #46

* Fixes #48

* Adds the option to drop into zero mode for slaves

* Fixes #42

* Bumping the version to 1.3.0

* add missing self operator

The parameter values of the constructor within  class WriteMultipleRegistersRequest can specified as single value or list of values. But if a single value is given the missing self operator on line 137 leads to crash in line 138 with error: TypeError("object of type 'int' has no len()",)

* typo: fix spelling of Parameter

Signed-off-by: Karl Palsson <[email protected]>

* async: missing slaves: add missing imports

1e0bcde is missing imports into the
async server, the import was only added to the sync server.

Further fix for #42

Signed-off-by: Karl Palsson <[email protected]>

* Fix zero_mode argument for ModbusSlaveContext

Using "-" in the argument name causes SyntaxError
'non-keyword arg after keyword arg'

* Fix typo in constants

* Adding an example and adding tcp timeout

* fixes #70

* Endianness now used in packing bytes

* Adding a libmodbus wrapper

* adding new contrib example of libmodbus client
* updating example documentation so users can find it

* closes #73

* Execute methods of Requests accept context

There were errors whenever a request that got handles in
other_message.py got it's execute method called, as it was being called
with a context parameter. The functions now accept this parameter,
although they don't do anything with it.

The tests have also been updated.

* Add Modbus RTU syncronous server example

* Signal handlers to stop in shutdown().

* WriteMultipleRegistersRequest: Handle values=None case

Currently, if None is passed in explicitly, or if values is not given,
the 'values' object is correctly identified as *not* having an __iter__
attribute, but is incorrectly identified as being a valid register value.
This breaks testInvalidWriteMultipleRegistersRequest.

Solution: if we see None, replace this with [] and skip the check for
__iter__.

* Fix payload tests.

Looking at the "encoded" string, it looks identical to that of the big
endian encoding string, and my understanding is that the data shown in
"encoded" *IS* big-endian, not little-endian.

I have no idea how this passed before, but it passes now.

* sync.ModbusUdpClient: Correct reference to settimeout.

I could not find a 'settimeout' (case-insensitive) anywhere in the
codebase other than on this line, but I *did* see it was a method of
socket.socket.

So I'll assume that this was *supposed* to be calling
socket.socket.settimeout.

* test-client-sync: Fix UDP connection test.

Rather than passing in a vanilla object, we should pass in something
that implements the settimeout method.

* Lazily initialize InstallManagementConsole

Simply importing the management console takes ~0.3 sec on an 1GHz Atom.
Since it is (I suspect) often not used, lazily importing it should help
startup for many programs.

* Fixes the UDP client socket timeout bug

fixes #51

* Implement mask_write_register method in client mixin

* Workaround for bug 101 #101

* Workaround for bug 101 #101

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Document Riptide specific instructions.

* Include Workaround for bug 101 bashwork#101

* Include Workaround for bug 101 bashwork#101

* Better tag names.

* pymodbus fix for modes RTU error cases.

* version bumped to c93103

* version bumped to c93103

* fixed issue with pymodbus timing over serial

* fixed issue with pymodbus timing over serial

* Add RIPTIDE.md  to .gitignore

* bump version to rc93105

*  fix merge conflicts

* fix version file

*  fix unit test failures

* cleanup

* #121 changelog updated

* Misc update Add __maintainer__ field in setup.py

* 1. #162, creating universal distribution for py2 and py3
2. Merge PR #152 , create compatible versions

* fix test failures

* fix ReadDeviceInformationRequest  encoding probelm

*  #166 fix failing tests on python 3.5

* mis - Updated documentation

* #167 updated documentation for CI

* #167 disable pep8/flake checks for the time being

* #167, fix install dependencies osx, remove pypy from supported python versions

* #167, fix install dependencies osx, remove pypy from supported python versions

* #167 , fix minior error in travis.yml

* Bump version to 1.3.0rc2

* Fix #170 and other misc updates

* Updated Documents

* Add coverage.rc to show missing lines with coverage >4.0

* new documentation

* #171 Minor bug fix in BinaryPayloadBuilder.add_string method for python3

* 1. #179 fix error calculating response pdu length for read coil/discrete input requests
2. #179 add tests

* Enable debug logging for send packets
ccatterina pushed a commit to ccatterina/pymodbus that referenced this issue Apr 17, 2018
* Refactored and simplified calculation of RTU frames, added missing unit tests

* - fixing a few small issues
- bringing a few areas of coverage back up

* adding installer test script

* enabling the checksum tests in check frame, fixing tests

* * Updating documentation
* Adding code to handle messages that do not respond
* Fixes issue 41

* cleaning up the build tools a bit

* Adding more commands to the setup.py
- pep8, lint, 2to3

Fixed a few pep8/lint bugs to test

* moving files around

* pep8 and cleanup

* more cleanup

* Fixes issue 47

* adding another quick example

* cutting 200 pep8 errors

* working on py3 merge

* updating to python3

* reverting back changes, remember Switch flag next time

* adding some magic methods, just cause

* adding documentation pdf

* Fixes issue 49

* Adds True and False constants for older python versions.

Update issue 50

* adding tests for a few fixes

* Fixes issue 51

* fixing tests broken by interface change

* Updates issue 52

* Fixes issue 53

* Fix to add Python < 2.5 compatibility

This fix simply removes all the ternaries that were added
in Python 2.5.

Fixes issue 50

* adding a mostly complete diagnostic register implementation

* Adding more documentation and helpful factory methods.

The documentation added was to address some questions
with the synchronous and asynchrounous server implementations
as well as the functionality of the data contexts.

The factory methods were added by request to simplify the
creation of a fully populated DataBlock address space.

* adding modbus plus registers

* adding endian ability to payload builder

* Finishing the remaining modbus protocol

* Adding the remaining portions of the protocol (request/response)
* Tieing these into the factory decoder
* Adding tests to cover the new code (need more)
* Fixing a few bugs found along the way

* finished file read/write record requests

* documentation, more tests, fixing extra commands

* adding more tests

* Fixing the client/server async/sync implementations

- asynchronous client/server for tcp working and tested
- synchronous client/server for tcp/udp working and tested
- adding tests to exercise the synchronous client/server
- more documentation

* adding test stubs to get full coverage count

* working on jamod, need to set up more complete project

* adding GetDeviceInformationRequest

* adding read device information to decoder factory

* fixing some example errors

* working on the serial implementations

* fixing the synchronous server implementation

* updating functional tests and documentation for sync-serial

* updating tac files

* Updating the documentation for the serial client/servers

* adding readme to root

* Fixes issue 56

* Fixes issue 1

* adding a requirements file for virtualenv folk

* adding more cohesive code to the payload utilities

* forgot to add the new example to the doc index

* Fixing the rtu size calculation isse pymodbus-dev#55 on google code

* using the endian flag in register factory

* fixing bad documentation

* fixing issue 58 on google code

* Fix binary framer and add start and end tokens

Fixes a TypeError occuring while escaping token bytes in the message and
adds the start and end tokens to the packet.

* Adding checking in the client for an unconnected socket.

* Fixing issue 60 on google code (including ez_setup)

* fixing github issue pymodbus-dev#7

* adding tests and two utilities

* adding message parser utility

* Fixing extended message decoding

* Now correctly decoding sub function messages (diagnostic)
* Message parser now finished and documented
* Fixed broken logger unit test

* ModbusSparseDataBlock handled dictionaries incorrectly (they have an __iter__ attribute). Changed 'if' to 'elif'

* Updating the Readme.rst to explain how to install in zero dependency mode.

* Fixing issue pymodbus-dev#10

* updating the client documentation

* updating the server context documentation

* fixes pymodbus-dev#9 on github

* fixing the factory decoding and adding examples

* pushing to version 1.0

* Fixing a bug in the asynchronous client that slipped through.

* complete tests for the sync client

* cleaning up some pep8 errors

* finished unit tests for async client

* adding another test to the test-install script

* finished covering sync client

* updating documentation

* adding another example, adding debug checks

* Fixing the serial implementation of everything

* updating lots of reference documentation
* fixing the fifo semantics of serial clients
* using transaction manager in async clients
* fixing references

* fixing incorrect rtu lenght calculation

* Add optional server_address to Sync and Async TCP/UDP Server API

* Improve erver_address defaults to passing None

* adding a few messages

* Adding a message encoding generator for testing.

- fixed messages not passing **kwargs to base
- fixed binary framer off by 1
- fixed mei_message rtu size tests
- added a message generator to use with message parser
- fixed message parser with ascii
- tested message parser with all formats (added to messages)

* adding documentation for message formats

* updating documentation and being pedantic

* Allowing overloading of message encoding

* allow codes like payload builder to encode
* added IPayloadBuilder interface (future)
* renamed builder methods to reflect vision
* added error code decoding to name
* fixed affected tests

* Cleaning up the build tools

- moving custom datastores to examples
- bumping required versions
- making the debug server console optional
- updating documentation

* adding support for pydev

* fixing broken nosetest (/dev/pts) and pydev issues

* adding bcd payload builder

* reworking contrib packages

* adding bcd payload contrib

* moving complex examples to contrib

* syncing version on pypi

* adding server rest api

* moving web -> bottle

* fixing documentation

* adding gui base

* adding initial manager page

* adding data view

* fixing error in example

* adding the ability to override sync client framer

* updating the performance test

* fixing documentation

* fixing memory leak in sync client

* adding modicon encoder/decoder

* Fix bogus calculation in ModbusSocketFramer.checkFrame
(one of the tests also seemed wrong, I had to fix it)

* Adding sunspec client example

* Changing @staticmethod to @classmethod to fix inheritance

* adding method to retrieve all the device blocks

* adding the initial mapper interface

* adding ideas in progress

* adding a modbus datastore saver

* making lrc/crc read stdin

* adding the callback server example

* adding a periodic updating example

* fixing documentation

* adding fix for stuck RTU streams

* fixing documentation error

* Adding an example for changing framers

- new example changing-framers.py
- added documentation link

* Reworking the transaction managers to be explicit

- Serial framers use the FIFO manager (results in order)
- Socket framers use the Dict manager (tid -> result)
- Fixed tests and removed bad global managers
- Managers no longer use global state (now instance)

* Bumping the version and adding a changelog

* Fixing a logic error in client code

- Now correctly choosing transaction manager

* Fixing 2to3 common warnings

* Fixed example typo in readme

* Adding slave context delete ability

- Fixes pymodbus-dev#20

* Fixing google code issue 69

- custom-message example had bugs
- http://code.google.com/p/pymodbus/issues/detail?id=69

* Fixed docstring in synchronous serial client connect() method

I think there was a copy/paste error in the docstring. It said tcp but I think it is supposed to be serial.

* Fix for issue pymodbus-dev#21

* Allowing options to be passed through

- This fixes issue pymodbus-dev#21
- Options now go to the transaction manager

* Adding source_address to TCP client inputs

* Typo

* Typo

* Typo

* Typo

* Adding some new examples

* modbus scraper (and documentation)
* thread safe datastore (and documentation)

* Adding a concurrent client example

* Allow specification of client connection handler in Modbus...Server
o ModbusTcpServer and ModbusUdpServer allows handler class other than
  default Modbus{Connected,Disconnected}RequestHandler
o Add debug logging on request failure, to help diagnose root causes

* Fixes pymodbus-dev#46

* Fixes pymodbus-dev#48

* Adds the option to drop into zero mode for slaves

* Fixes pymodbus-dev#42

* Bumping the version to 1.3.0

* add missing self operator

The parameter values of the constructor within  class WriteMultipleRegistersRequest can specified as single value or list of values. But if a single value is given the missing self operator on line 137 leads to crash in line 138 with error: TypeError("object of type 'int' has no len()",)

* typo: fix spelling of Parameter

Signed-off-by: Karl Palsson <[email protected]>

* async: missing slaves: add missing imports

1e0bcde is missing imports into the
async server, the import was only added to the sync server.

Further fix for pymodbus-dev#42

Signed-off-by: Karl Palsson <[email protected]>

* Fix zero_mode argument for ModbusSlaveContext

Using "-" in the argument name causes SyntaxError
'non-keyword arg after keyword arg'

* Fix typo in constants

* Adding an example and adding tcp timeout

* fixes pymodbus-dev#70

* Endianness now used in packing bytes

* Adding a libmodbus wrapper

* adding new contrib example of libmodbus client
* updating example documentation so users can find it

* closes pymodbus-dev#73

* Execute methods of Requests accept context

There were errors whenever a request that got handles in
other_message.py got it's execute method called, as it was being called
with a context parameter. The functions now accept this parameter,
although they don't do anything with it.

The tests have also been updated.

* Add Modbus RTU syncronous server example

* Signal handlers to stop in shutdown().

* WriteMultipleRegistersRequest: Handle values=None case

Currently, if None is passed in explicitly, or if values is not given,
the 'values' object is correctly identified as *not* having an __iter__
attribute, but is incorrectly identified as being a valid register value.
This breaks testInvalidWriteMultipleRegistersRequest.

Solution: if we see None, replace this with [] and skip the check for
__iter__.

* Fix payload tests.

Looking at the "encoded" string, it looks identical to that of the big
endian encoding string, and my understanding is that the data shown in
"encoded" *IS* big-endian, not little-endian.

I have no idea how this passed before, but it passes now.

* sync.ModbusUdpClient: Correct reference to settimeout.

I could not find a 'settimeout' (case-insensitive) anywhere in the
codebase other than on this line, but I *did* see it was a method of
socket.socket.

So I'll assume that this was *supposed* to be calling
socket.socket.settimeout.

* test-client-sync: Fix UDP connection test.

Rather than passing in a vanilla object, we should pass in something
that implements the settimeout method.

* Lazily initialize InstallManagementConsole

Simply importing the management console takes ~0.3 sec on an 1GHz Atom.
Since it is (I suspect) often not used, lazily importing it should help
startup for many programs.

* Fixes the UDP client socket timeout bug

fixes pymodbus-dev#51

* Implement mask_write_register method in client mixin

* Workaround for bug 101 pymodbus-dev#101

* Workaround for bug 101 pymodbus-dev#101

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Document Riptide specific instructions.

* Include Workaround for bug 101 bashwork#101

* Include Workaround for bug 101 bashwork#101

* Better tag names.

* pymodbus fix for modes RTU error cases.

* version bumped to c93103

* version bumped to c93103

* fixed issue with pymodbus timing over serial

* fixed issue with pymodbus timing over serial

* Add RIPTIDE.md  to .gitignore

* bump version to rc93105

*  fix merge conflicts

* fix version file

*  fix unit test failures

* cleanup

* pymodbus-dev#121 changelog updated

* Misc update Add __maintainer__ field in setup.py

* 1. pymodbus-dev#162, creating universal distribution for py2 and py3
2. Merge PR pymodbus-dev#152 , create compatible versions

* fix test failures

* fix ReadDeviceInformationRequest  encoding probelm
ccatterina pushed a commit to ccatterina/pymodbus that referenced this issue Apr 17, 2018
* Refactored and simplified calculation of RTU frames, added missing unit tests

* - fixing a few small issues
- bringing a few areas of coverage back up

* adding installer test script

* enabling the checksum tests in check frame, fixing tests

* * Updating documentation
* Adding code to handle messages that do not respond
* Fixes issue 41

* cleaning up the build tools a bit

* Adding more commands to the setup.py
- pep8, lint, 2to3

Fixed a few pep8/lint bugs to test

* moving files around

* pep8 and cleanup

* more cleanup

* Fixes issue 47

* adding another quick example

* cutting 200 pep8 errors

* working on py3 merge

* updating to python3

* reverting back changes, remember Switch flag next time

* adding some magic methods, just cause

* adding documentation pdf

* Fixes issue 49

* Adds True and False constants for older python versions.

Update issue 50

* adding tests for a few fixes

* Fixes issue 51

* fixing tests broken by interface change

* Updates issue 52

* Fixes issue 53

* Fix to add Python < 2.5 compatibility

This fix simply removes all the ternaries that were added
in Python 2.5.

Fixes issue 50

* adding a mostly complete diagnostic register implementation

* Adding more documentation and helpful factory methods.

The documentation added was to address some questions
with the synchronous and asynchrounous server implementations
as well as the functionality of the data contexts.

The factory methods were added by request to simplify the
creation of a fully populated DataBlock address space.

* adding modbus plus registers

* adding endian ability to payload builder

* Finishing the remaining modbus protocol

* Adding the remaining portions of the protocol (request/response)
* Tieing these into the factory decoder
* Adding tests to cover the new code (need more)
* Fixing a few bugs found along the way

* finished file read/write record requests

* documentation, more tests, fixing extra commands

* adding more tests

* Fixing the client/server async/sync implementations

- asynchronous client/server for tcp working and tested
- synchronous client/server for tcp/udp working and tested
- adding tests to exercise the synchronous client/server
- more documentation

* adding test stubs to get full coverage count

* working on jamod, need to set up more complete project

* adding GetDeviceInformationRequest

* adding read device information to decoder factory

* fixing some example errors

* working on the serial implementations

* fixing the synchronous server implementation

* updating functional tests and documentation for sync-serial

* updating tac files

* Updating the documentation for the serial client/servers

* adding readme to root

* Fixes issue 56

* Fixes issue 1

* adding a requirements file for virtualenv folk

* adding more cohesive code to the payload utilities

* forgot to add the new example to the doc index

* Fixing the rtu size calculation isse pymodbus-dev#55 on google code

* using the endian flag in register factory

* fixing bad documentation

* fixing issue 58 on google code

* Fix binary framer and add start and end tokens

Fixes a TypeError occuring while escaping token bytes in the message and
adds the start and end tokens to the packet.

* Adding checking in the client for an unconnected socket.

* Fixing issue 60 on google code (including ez_setup)

* fixing github issue pymodbus-dev#7

* adding tests and two utilities

* adding message parser utility

* Fixing extended message decoding

* Now correctly decoding sub function messages (diagnostic)
* Message parser now finished and documented
* Fixed broken logger unit test

* ModbusSparseDataBlock handled dictionaries incorrectly (they have an __iter__ attribute). Changed 'if' to 'elif'

* Updating the Readme.rst to explain how to install in zero dependency mode.

* Fixing issue pymodbus-dev#10

* updating the client documentation

* updating the server context documentation

* fixes pymodbus-dev#9 on github

* fixing the factory decoding and adding examples

* pushing to version 1.0

* Fixing a bug in the asynchronous client that slipped through.

* complete tests for the sync client

* cleaning up some pep8 errors

* finished unit tests for async client

* adding another test to the test-install script

* finished covering sync client

* updating documentation

* adding another example, adding debug checks

* Fixing the serial implementation of everything

* updating lots of reference documentation
* fixing the fifo semantics of serial clients
* using transaction manager in async clients
* fixing references

* fixing incorrect rtu lenght calculation

* Add optional server_address to Sync and Async TCP/UDP Server API

* Improve erver_address defaults to passing None

* adding a few messages

* Adding a message encoding generator for testing.

- fixed messages not passing **kwargs to base
- fixed binary framer off by 1
- fixed mei_message rtu size tests
- added a message generator to use with message parser
- fixed message parser with ascii
- tested message parser with all formats (added to messages)

* adding documentation for message formats

* updating documentation and being pedantic

* Allowing overloading of message encoding

* allow codes like payload builder to encode
* added IPayloadBuilder interface (future)
* renamed builder methods to reflect vision
* added error code decoding to name
* fixed affected tests

* Cleaning up the build tools

- moving custom datastores to examples
- bumping required versions
- making the debug server console optional
- updating documentation

* adding support for pydev

* fixing broken nosetest (/dev/pts) and pydev issues

* adding bcd payload builder

* reworking contrib packages

* adding bcd payload contrib

* moving complex examples to contrib

* syncing version on pypi

* adding server rest api

* moving web -> bottle

* fixing documentation

* adding gui base

* adding initial manager page

* adding data view

* fixing error in example

* adding the ability to override sync client framer

* updating the performance test

* fixing documentation

* fixing memory leak in sync client

* adding modicon encoder/decoder

* Fix bogus calculation in ModbusSocketFramer.checkFrame
(one of the tests also seemed wrong, I had to fix it)

* Adding sunspec client example

* Changing @staticmethod to @classmethod to fix inheritance

* adding method to retrieve all the device blocks

* adding the initial mapper interface

* adding ideas in progress

* adding a modbus datastore saver

* making lrc/crc read stdin

* adding the callback server example

* adding a periodic updating example

* fixing documentation

* adding fix for stuck RTU streams

* fixing documentation error

* Adding an example for changing framers

- new example changing-framers.py
- added documentation link

* Reworking the transaction managers to be explicit

- Serial framers use the FIFO manager (results in order)
- Socket framers use the Dict manager (tid -> result)
- Fixed tests and removed bad global managers
- Managers no longer use global state (now instance)

* Bumping the version and adding a changelog

* Fixing a logic error in client code

- Now correctly choosing transaction manager

* Fixing 2to3 common warnings

* Fixed example typo in readme

* Adding slave context delete ability

- Fixes pymodbus-dev#20

* Fixing google code issue 69

- custom-message example had bugs
- http://code.google.com/p/pymodbus/issues/detail?id=69

* Fixed docstring in synchronous serial client connect() method

I think there was a copy/paste error in the docstring. It said tcp but I think it is supposed to be serial.

* Fix for issue pymodbus-dev#21

* Allowing options to be passed through

- This fixes issue pymodbus-dev#21
- Options now go to the transaction manager

* Adding source_address to TCP client inputs

* Typo

* Typo

* Typo

* Typo

* Adding some new examples

* modbus scraper (and documentation)
* thread safe datastore (and documentation)

* Adding a concurrent client example

* Allow specification of client connection handler in Modbus...Server
o ModbusTcpServer and ModbusUdpServer allows handler class other than
  default Modbus{Connected,Disconnected}RequestHandler
o Add debug logging on request failure, to help diagnose root causes

* Fixes pymodbus-dev#46

* Fixes pymodbus-dev#48

* Adds the option to drop into zero mode for slaves

* Fixes pymodbus-dev#42

* Bumping the version to 1.3.0

* add missing self operator

The parameter values of the constructor within  class WriteMultipleRegistersRequest can specified as single value or list of values. But if a single value is given the missing self operator on line 137 leads to crash in line 138 with error: TypeError("object of type 'int' has no len()",)

* typo: fix spelling of Parameter

Signed-off-by: Karl Palsson <[email protected]>

* async: missing slaves: add missing imports

1e0bcde is missing imports into the
async server, the import was only added to the sync server.

Further fix for pymodbus-dev#42

Signed-off-by: Karl Palsson <[email protected]>

* Fix zero_mode argument for ModbusSlaveContext

Using "-" in the argument name causes SyntaxError
'non-keyword arg after keyword arg'

* Fix typo in constants

* Adding an example and adding tcp timeout

* fixes pymodbus-dev#70

* Endianness now used in packing bytes

* Adding a libmodbus wrapper

* adding new contrib example of libmodbus client
* updating example documentation so users can find it

* closes pymodbus-dev#73

* Execute methods of Requests accept context

There were errors whenever a request that got handles in
other_message.py got it's execute method called, as it was being called
with a context parameter. The functions now accept this parameter,
although they don't do anything with it.

The tests have also been updated.

* Add Modbus RTU syncronous server example

* Signal handlers to stop in shutdown().

* WriteMultipleRegistersRequest: Handle values=None case

Currently, if None is passed in explicitly, or if values is not given,
the 'values' object is correctly identified as *not* having an __iter__
attribute, but is incorrectly identified as being a valid register value.
This breaks testInvalidWriteMultipleRegistersRequest.

Solution: if we see None, replace this with [] and skip the check for
__iter__.

* Fix payload tests.

Looking at the "encoded" string, it looks identical to that of the big
endian encoding string, and my understanding is that the data shown in
"encoded" *IS* big-endian, not little-endian.

I have no idea how this passed before, but it passes now.

* sync.ModbusUdpClient: Correct reference to settimeout.

I could not find a 'settimeout' (case-insensitive) anywhere in the
codebase other than on this line, but I *did* see it was a method of
socket.socket.

So I'll assume that this was *supposed* to be calling
socket.socket.settimeout.

* test-client-sync: Fix UDP connection test.

Rather than passing in a vanilla object, we should pass in something
that implements the settimeout method.

* Lazily initialize InstallManagementConsole

Simply importing the management console takes ~0.3 sec on an 1GHz Atom.
Since it is (I suspect) often not used, lazily importing it should help
startup for many programs.

* Fixes the UDP client socket timeout bug

fixes pymodbus-dev#51

* Implement mask_write_register method in client mixin

* Workaround for bug 101 pymodbus-dev#101

* Workaround for bug 101 pymodbus-dev#101

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Document Riptide specific instructions.

* Include Workaround for bug 101 bashwork#101

* Include Workaround for bug 101 bashwork#101

* Better tag names.

* pymodbus fix for modes RTU error cases.

* version bumped to c93103

* version bumped to c93103

* fixed issue with pymodbus timing over serial

* fixed issue with pymodbus timing over serial

* Add RIPTIDE.md  to .gitignore

* bump version to rc93105

*  fix merge conflicts

* fix version file

*  fix unit test failures

* cleanup

* pymodbus-dev#121 changelog updated

* Misc update Add __maintainer__ field in setup.py

* 1. pymodbus-dev#162, creating universal distribution for py2 and py3
2. Merge PR pymodbus-dev#152 , create compatible versions

* fix test failures

* fix ReadDeviceInformationRequest  encoding problem

*  pymodbus-dev#166 fix failing tests on python 3.5

* mis - Updated documentation

* pymodbus-dev#167 updated documentation for CI

* pymodbus-dev#167 disable pep8/flake checks for the time being

* pymodbus-dev#167, fix install dependencies osx, remove pypy from supported python versions

* pymodbus-dev#167, fix install dependencies osx, remove pypy from supported python versions

* pymodbus-dev#167 , fix minior error in travis.yml
*  Bump version to 1.3.0rc2, update README
ccatterina pushed a commit to ccatterina/pymodbus that referenced this issue Apr 17, 2018
* Refactored and simplified calculation of RTU frames, added missing unit tests

* - fixing a few small issues
- bringing a few areas of coverage back up

* adding installer test script

* enabling the checksum tests in check frame, fixing tests

* * Updating documentation
* Adding code to handle messages that do not respond
* Fixes issue 41

* cleaning up the build tools a bit

* Adding more commands to the setup.py
- pep8, lint, 2to3

Fixed a few pep8/lint bugs to test

* moving files around

* pep8 and cleanup

* more cleanup

* Fixes issue 47

* adding another quick example

* cutting 200 pep8 errors

* working on py3 merge

* updating to python3

* reverting back changes, remember Switch flag next time

* adding some magic methods, just cause

* adding documentation pdf

* Fixes issue 49

* Adds True and False constants for older python versions.

Update issue 50

* adding tests for a few fixes

* Fixes issue 51

* fixing tests broken by interface change

* Updates issue 52

* Fixes issue 53

* Fix to add Python < 2.5 compatibility

This fix simply removes all the ternaries that were added
in Python 2.5.

Fixes issue 50

* adding a mostly complete diagnostic register implementation

* Adding more documentation and helpful factory methods.

The documentation added was to address some questions
with the synchronous and asynchrounous server implementations
as well as the functionality of the data contexts.

The factory methods were added by request to simplify the
creation of a fully populated DataBlock address space.

* adding modbus plus registers

* adding endian ability to payload builder

* Finishing the remaining modbus protocol

* Adding the remaining portions of the protocol (request/response)
* Tieing these into the factory decoder
* Adding tests to cover the new code (need more)
* Fixing a few bugs found along the way

* finished file read/write record requests

* documentation, more tests, fixing extra commands

* adding more tests

* Fixing the client/server async/sync implementations

- asynchronous client/server for tcp working and tested
- synchronous client/server for tcp/udp working and tested
- adding tests to exercise the synchronous client/server
- more documentation

* adding test stubs to get full coverage count

* working on jamod, need to set up more complete project

* adding GetDeviceInformationRequest

* adding read device information to decoder factory

* fixing some example errors

* working on the serial implementations

* fixing the synchronous server implementation

* updating functional tests and documentation for sync-serial

* updating tac files

* Updating the documentation for the serial client/servers

* adding readme to root

* Fixes issue 56

* Fixes issue 1

* adding a requirements file for virtualenv folk

* adding more cohesive code to the payload utilities

* forgot to add the new example to the doc index

* Fixing the rtu size calculation isse pymodbus-dev#55 on google code

* using the endian flag in register factory

* fixing bad documentation

* fixing issue 58 on google code

* Fix binary framer and add start and end tokens

Fixes a TypeError occuring while escaping token bytes in the message and
adds the start and end tokens to the packet.

* Adding checking in the client for an unconnected socket.

* Fixing issue 60 on google code (including ez_setup)

* fixing github issue pymodbus-dev#7

* adding tests and two utilities

* adding message parser utility

* Fixing extended message decoding

* Now correctly decoding sub function messages (diagnostic)
* Message parser now finished and documented
* Fixed broken logger unit test

* ModbusSparseDataBlock handled dictionaries incorrectly (they have an __iter__ attribute). Changed 'if' to 'elif'

* Updating the Readme.rst to explain how to install in zero dependency mode.

* Fixing issue pymodbus-dev#10

* updating the client documentation

* updating the server context documentation

* fixes pymodbus-dev#9 on github

* fixing the factory decoding and adding examples

* pushing to version 1.0

* Fixing a bug in the asynchronous client that slipped through.

* complete tests for the sync client

* cleaning up some pep8 errors

* finished unit tests for async client

* adding another test to the test-install script

* finished covering sync client

* updating documentation

* adding another example, adding debug checks

* Fixing the serial implementation of everything

* updating lots of reference documentation
* fixing the fifo semantics of serial clients
* using transaction manager in async clients
* fixing references

* fixing incorrect rtu lenght calculation

* Add optional server_address to Sync and Async TCP/UDP Server API

* Improve erver_address defaults to passing None

* adding a few messages

* Adding a message encoding generator for testing.

- fixed messages not passing **kwargs to base
- fixed binary framer off by 1
- fixed mei_message rtu size tests
- added a message generator to use with message parser
- fixed message parser with ascii
- tested message parser with all formats (added to messages)

* adding documentation for message formats

* updating documentation and being pedantic

* Allowing overloading of message encoding

* allow codes like payload builder to encode
* added IPayloadBuilder interface (future)
* renamed builder methods to reflect vision
* added error code decoding to name
* fixed affected tests

* Cleaning up the build tools

- moving custom datastores to examples
- bumping required versions
- making the debug server console optional
- updating documentation

* adding support for pydev

* fixing broken nosetest (/dev/pts) and pydev issues

* adding bcd payload builder

* reworking contrib packages

* adding bcd payload contrib

* moving complex examples to contrib

* syncing version on pypi

* adding server rest api

* moving web -> bottle

* fixing documentation

* adding gui base

* adding initial manager page

* adding data view

* fixing error in example

* adding the ability to override sync client framer

* updating the performance test

* fixing documentation

* fixing memory leak in sync client

* adding modicon encoder/decoder

* Fix bogus calculation in ModbusSocketFramer.checkFrame
(one of the tests also seemed wrong, I had to fix it)

* Adding sunspec client example

* Changing @staticmethod to @classmethod to fix inheritance

* adding method to retrieve all the device blocks

* adding the initial mapper interface

* adding ideas in progress

* adding a modbus datastore saver

* making lrc/crc read stdin

* adding the callback server example

* adding a periodic updating example

* fixing documentation

* adding fix for stuck RTU streams

* fixing documentation error

* Adding an example for changing framers

- new example changing-framers.py
- added documentation link

* Reworking the transaction managers to be explicit

- Serial framers use the FIFO manager (results in order)
- Socket framers use the Dict manager (tid -> result)
- Fixed tests and removed bad global managers
- Managers no longer use global state (now instance)

* Bumping the version and adding a changelog

* Fixing a logic error in client code

- Now correctly choosing transaction manager

* Fixing 2to3 common warnings

* Fixed example typo in readme

* Adding slave context delete ability

- Fixes pymodbus-dev#20

* Fixing google code issue 69

- custom-message example had bugs
- http://code.google.com/p/pymodbus/issues/detail?id=69

* Fixed docstring in synchronous serial client connect() method

I think there was a copy/paste error in the docstring. It said tcp but I think it is supposed to be serial.

* Fix for issue pymodbus-dev#21

* Allowing options to be passed through

- This fixes issue pymodbus-dev#21
- Options now go to the transaction manager

* Adding source_address to TCP client inputs

* Typo

* Typo

* Typo

* Typo

* Adding some new examples

* modbus scraper (and documentation)
* thread safe datastore (and documentation)

* Adding a concurrent client example

* Allow specification of client connection handler in Modbus...Server
o ModbusTcpServer and ModbusUdpServer allows handler class other than
  default Modbus{Connected,Disconnected}RequestHandler
o Add debug logging on request failure, to help diagnose root causes

* Fixes pymodbus-dev#46

* Fixes pymodbus-dev#48

* Adds the option to drop into zero mode for slaves

* Fixes pymodbus-dev#42

* Bumping the version to 1.3.0

* add missing self operator

The parameter values of the constructor within  class WriteMultipleRegistersRequest can specified as single value or list of values. But if a single value is given the missing self operator on line 137 leads to crash in line 138 with error: TypeError("object of type 'int' has no len()",)

* typo: fix spelling of Parameter

Signed-off-by: Karl Palsson <[email protected]>

* async: missing slaves: add missing imports

1e0bcde is missing imports into the
async server, the import was only added to the sync server.

Further fix for pymodbus-dev#42

Signed-off-by: Karl Palsson <[email protected]>

* Fix zero_mode argument for ModbusSlaveContext

Using "-" in the argument name causes SyntaxError
'non-keyword arg after keyword arg'

* Fix typo in constants

* Adding an example and adding tcp timeout

* fixes pymodbus-dev#70

* Endianness now used in packing bytes

* Adding a libmodbus wrapper

* adding new contrib example of libmodbus client
* updating example documentation so users can find it

* closes pymodbus-dev#73

* Execute methods of Requests accept context

There were errors whenever a request that got handles in
other_message.py got it's execute method called, as it was being called
with a context parameter. The functions now accept this parameter,
although they don't do anything with it.

The tests have also been updated.

* Add Modbus RTU syncronous server example

* Signal handlers to stop in shutdown().

* WriteMultipleRegistersRequest: Handle values=None case

Currently, if None is passed in explicitly, or if values is not given,
the 'values' object is correctly identified as *not* having an __iter__
attribute, but is incorrectly identified as being a valid register value.
This breaks testInvalidWriteMultipleRegistersRequest.

Solution: if we see None, replace this with [] and skip the check for
__iter__.

* Fix payload tests.

Looking at the "encoded" string, it looks identical to that of the big
endian encoding string, and my understanding is that the data shown in
"encoded" *IS* big-endian, not little-endian.

I have no idea how this passed before, but it passes now.

* sync.ModbusUdpClient: Correct reference to settimeout.

I could not find a 'settimeout' (case-insensitive) anywhere in the
codebase other than on this line, but I *did* see it was a method of
socket.socket.

So I'll assume that this was *supposed* to be calling
socket.socket.settimeout.

* test-client-sync: Fix UDP connection test.

Rather than passing in a vanilla object, we should pass in something
that implements the settimeout method.

* Lazily initialize InstallManagementConsole

Simply importing the management console takes ~0.3 sec on an 1GHz Atom.
Since it is (I suspect) often not used, lazily importing it should help
startup for many programs.

* Fixes the UDP client socket timeout bug

fixes pymodbus-dev#51

* Implement mask_write_register method in client mixin

* Workaround for bug 101 pymodbus-dev#101

* Workaround for bug 101 pymodbus-dev#101

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Document Riptide specific instructions.

* Include Workaround for bug 101 bashwork#101

* Include Workaround for bug 101 bashwork#101

* Better tag names.

* pymodbus fix for modes RTU error cases.

* version bumped to c93103

* version bumped to c93103

* fixed issue with pymodbus timing over serial

* fixed issue with pymodbus timing over serial

* Add RIPTIDE.md  to .gitignore

* bump version to rc93105

*  fix merge conflicts

* fix version file

*  fix unit test failures

* cleanup

* pymodbus-dev#121 changelog updated

* Misc update Add __maintainer__ field in setup.py

* 1. pymodbus-dev#162, creating universal distribution for py2 and py3
2. Merge PR pymodbus-dev#152 , create compatible versions

* fix test failures

* fix ReadDeviceInformationRequest  encoding probelm

*  pymodbus-dev#166 fix failing tests on python 3.5

* mis - Updated documentation

* pymodbus-dev#167 updated documentation for CI

* pymodbus-dev#167 disable pep8/flake checks for the time being

* pymodbus-dev#167, fix install dependencies osx, remove pypy from supported python versions

* pymodbus-dev#167, fix install dependencies osx, remove pypy from supported python versions

* pymodbus-dev#167 , fix minior error in travis.yml

* Bump version to 1.3.0rc2

* Fix pymodbus-dev#170 and other misc updates

* Updated Documents

* Add coverage.rc to show missing lines with coverage >4.0

* new documentation

* pymodbus-dev#171 Minor bug fix in BinaryPayloadBuilder.add_string method for python3
ccatterina pushed a commit to ccatterina/pymodbus that referenced this issue Apr 17, 2018
…t requests (pymodbus-dev#183)

* Refactored and simplified calculation of RTU frames, added missing unit tests

* - fixing a few small issues
- bringing a few areas of coverage back up

* adding installer test script

* enabling the checksum tests in check frame, fixing tests

* * Updating documentation
* Adding code to handle messages that do not respond
* Fixes issue 41

* cleaning up the build tools a bit

* Adding more commands to the setup.py
- pep8, lint, 2to3

Fixed a few pep8/lint bugs to test

* moving files around

* pep8 and cleanup

* more cleanup

* Fixes issue 47

* adding another quick example

* cutting 200 pep8 errors

* working on py3 merge

* updating to python3

* reverting back changes, remember Switch flag next time

* adding some magic methods, just cause

* adding documentation pdf

* Fixes issue 49

* Adds True and False constants for older python versions.

Update issue 50

* adding tests for a few fixes

* Fixes issue 51

* fixing tests broken by interface change

* Updates issue 52

* Fixes issue 53

* Fix to add Python < 2.5 compatibility

This fix simply removes all the ternaries that were added
in Python 2.5.

Fixes issue 50

* adding a mostly complete diagnostic register implementation

* Adding more documentation and helpful factory methods.

The documentation added was to address some questions
with the synchronous and asynchrounous server implementations
as well as the functionality of the data contexts.

The factory methods were added by request to simplify the
creation of a fully populated DataBlock address space.

* adding modbus plus registers

* adding endian ability to payload builder

* Finishing the remaining modbus protocol

* Adding the remaining portions of the protocol (request/response)
* Tieing these into the factory decoder
* Adding tests to cover the new code (need more)
* Fixing a few bugs found along the way

* finished file read/write record requests

* documentation, more tests, fixing extra commands

* adding more tests

* Fixing the client/server async/sync implementations

- asynchronous client/server for tcp working and tested
- synchronous client/server for tcp/udp working and tested
- adding tests to exercise the synchronous client/server
- more documentation

* adding test stubs to get full coverage count

* working on jamod, need to set up more complete project

* adding GetDeviceInformationRequest

* adding read device information to decoder factory

* fixing some example errors

* working on the serial implementations

* fixing the synchronous server implementation

* updating functional tests and documentation for sync-serial

* updating tac files

* Updating the documentation for the serial client/servers

* adding readme to root

* Fixes issue 56

* Fixes issue 1

* adding a requirements file for virtualenv folk

* adding more cohesive code to the payload utilities

* forgot to add the new example to the doc index

* Fixing the rtu size calculation isse pymodbus-dev#55 on google code

* using the endian flag in register factory

* fixing bad documentation

* fixing issue 58 on google code

* Fix binary framer and add start and end tokens

Fixes a TypeError occuring while escaping token bytes in the message and
adds the start and end tokens to the packet.

* Adding checking in the client for an unconnected socket.

* Fixing issue 60 on google code (including ez_setup)

* fixing github issue pymodbus-dev#7

* adding tests and two utilities

* adding message parser utility

* Fixing extended message decoding

* Now correctly decoding sub function messages (diagnostic)
* Message parser now finished and documented
* Fixed broken logger unit test

* ModbusSparseDataBlock handled dictionaries incorrectly (they have an __iter__ attribute). Changed 'if' to 'elif'

* Updating the Readme.rst to explain how to install in zero dependency mode.

* Fixing issue pymodbus-dev#10

* updating the client documentation

* updating the server context documentation

* fixes pymodbus-dev#9 on github

* fixing the factory decoding and adding examples

* pushing to version 1.0

* Fixing a bug in the asynchronous client that slipped through.

* complete tests for the sync client

* cleaning up some pep8 errors

* finished unit tests for async client

* adding another test to the test-install script

* finished covering sync client

* updating documentation

* adding another example, adding debug checks

* Fixing the serial implementation of everything

* updating lots of reference documentation
* fixing the fifo semantics of serial clients
* using transaction manager in async clients
* fixing references

* fixing incorrect rtu lenght calculation

* Add optional server_address to Sync and Async TCP/UDP Server API

* Improve erver_address defaults to passing None

* adding a few messages

* Adding a message encoding generator for testing.

- fixed messages not passing **kwargs to base
- fixed binary framer off by 1
- fixed mei_message rtu size tests
- added a message generator to use with message parser
- fixed message parser with ascii
- tested message parser with all formats (added to messages)

* adding documentation for message formats

* updating documentation and being pedantic

* Allowing overloading of message encoding

* allow codes like payload builder to encode
* added IPayloadBuilder interface (future)
* renamed builder methods to reflect vision
* added error code decoding to name
* fixed affected tests

* Cleaning up the build tools

- moving custom datastores to examples
- bumping required versions
- making the debug server console optional
- updating documentation

* adding support for pydev

* fixing broken nosetest (/dev/pts) and pydev issues

* adding bcd payload builder

* reworking contrib packages

* adding bcd payload contrib

* moving complex examples to contrib

* syncing version on pypi

* adding server rest api

* moving web -> bottle

* fixing documentation

* adding gui base

* adding initial manager page

* adding data view

* fixing error in example

* adding the ability to override sync client framer

* updating the performance test

* fixing documentation

* fixing memory leak in sync client

* adding modicon encoder/decoder

* Fix bogus calculation in ModbusSocketFramer.checkFrame
(one of the tests also seemed wrong, I had to fix it)

* Adding sunspec client example

* Changing @staticmethod to @classmethod to fix inheritance

* adding method to retrieve all the device blocks

* adding the initial mapper interface

* adding ideas in progress

* adding a modbus datastore saver

* making lrc/crc read stdin

* adding the callback server example

* adding a periodic updating example

* fixing documentation

* adding fix for stuck RTU streams

* fixing documentation error

* Adding an example for changing framers

- new example changing-framers.py
- added documentation link

* Reworking the transaction managers to be explicit

- Serial framers use the FIFO manager (results in order)
- Socket framers use the Dict manager (tid -> result)
- Fixed tests and removed bad global managers
- Managers no longer use global state (now instance)

* Bumping the version and adding a changelog

* Fixing a logic error in client code

- Now correctly choosing transaction manager

* Fixing 2to3 common warnings

* Fixed example typo in readme

* Adding slave context delete ability

- Fixes pymodbus-dev#20

* Fixing google code issue 69

- custom-message example had bugs
- http://code.google.com/p/pymodbus/issues/detail?id=69

* Fixed docstring in synchronous serial client connect() method

I think there was a copy/paste error in the docstring. It said tcp but I think it is supposed to be serial.

* Fix for issue pymodbus-dev#21

* Allowing options to be passed through

- This fixes issue pymodbus-dev#21
- Options now go to the transaction manager

* Adding source_address to TCP client inputs

* Typo

* Typo

* Typo

* Typo

* Adding some new examples

* modbus scraper (and documentation)
* thread safe datastore (and documentation)

* Adding a concurrent client example

* Allow specification of client connection handler in Modbus...Server
o ModbusTcpServer and ModbusUdpServer allows handler class other than
  default Modbus{Connected,Disconnected}RequestHandler
o Add debug logging on request failure, to help diagnose root causes

* Fixes pymodbus-dev#46

* Fixes pymodbus-dev#48

* Adds the option to drop into zero mode for slaves

* Fixes pymodbus-dev#42

* Bumping the version to 1.3.0

* add missing self operator

The parameter values of the constructor within  class WriteMultipleRegistersRequest can specified as single value or list of values. But if a single value is given the missing self operator on line 137 leads to crash in line 138 with error: TypeError("object of type 'int' has no len()",)

* typo: fix spelling of Parameter

Signed-off-by: Karl Palsson <[email protected]>

* async: missing slaves: add missing imports

1e0bcde is missing imports into the
async server, the import was only added to the sync server.

Further fix for pymodbus-dev#42

Signed-off-by: Karl Palsson <[email protected]>

* Fix zero_mode argument for ModbusSlaveContext

Using "-" in the argument name causes SyntaxError
'non-keyword arg after keyword arg'

* Fix typo in constants

* Adding an example and adding tcp timeout

* fixes pymodbus-dev#70

* Endianness now used in packing bytes

* Adding a libmodbus wrapper

* adding new contrib example of libmodbus client
* updating example documentation so users can find it

* closes pymodbus-dev#73

* Execute methods of Requests accept context

There were errors whenever a request that got handles in
other_message.py got it's execute method called, as it was being called
with a context parameter. The functions now accept this parameter,
although they don't do anything with it.

The tests have also been updated.

* Add Modbus RTU syncronous server example

* Signal handlers to stop in shutdown().

* WriteMultipleRegistersRequest: Handle values=None case

Currently, if None is passed in explicitly, or if values is not given,
the 'values' object is correctly identified as *not* having an __iter__
attribute, but is incorrectly identified as being a valid register value.
This breaks testInvalidWriteMultipleRegistersRequest.

Solution: if we see None, replace this with [] and skip the check for
__iter__.

* Fix payload tests.

Looking at the "encoded" string, it looks identical to that of the big
endian encoding string, and my understanding is that the data shown in
"encoded" *IS* big-endian, not little-endian.

I have no idea how this passed before, but it passes now.

* sync.ModbusUdpClient: Correct reference to settimeout.

I could not find a 'settimeout' (case-insensitive) anywhere in the
codebase other than on this line, but I *did* see it was a method of
socket.socket.

So I'll assume that this was *supposed* to be calling
socket.socket.settimeout.

* test-client-sync: Fix UDP connection test.

Rather than passing in a vanilla object, we should pass in something
that implements the settimeout method.

* Lazily initialize InstallManagementConsole

Simply importing the management console takes ~0.3 sec on an 1GHz Atom.
Since it is (I suspect) often not used, lazily importing it should help
startup for many programs.

* Fixes the UDP client socket timeout bug

fixes pymodbus-dev#51

* Implement mask_write_register method in client mixin

* Workaround for bug 101 pymodbus-dev#101

* Workaround for bug 101 pymodbus-dev#101

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Riptide 1.3.0 pymodbus internal pre-release (riptide1) with dhoomakethu's fix for bashwork#101.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Use a PEP 404 compliant version.  Start at rc93101 to usurp any other real release candidates.

* Document Riptide specific instructions.

* Include Workaround for bug 101 bashwork#101

* Include Workaround for bug 101 bashwork#101

* Better tag names.

* pymodbus fix for modes RTU error cases.

* version bumped to c93103

* version bumped to c93103

* fixed issue with pymodbus timing over serial

* fixed issue with pymodbus timing over serial

* Add RIPTIDE.md  to .gitignore

* bump version to rc93105

*  fix merge conflicts

* fix version file

*  fix unit test failures

* cleanup

* pymodbus-dev#121 changelog updated

* Misc update Add __maintainer__ field in setup.py

* 1. pymodbus-dev#162, creating universal distribution for py2 and py3
2. Merge PR pymodbus-dev#152 , create compatible versions

* fix test failures

* fix ReadDeviceInformationRequest  encoding probelm

*  pymodbus-dev#166 fix failing tests on python 3.5

* mis - Updated documentation

* pymodbus-dev#167 updated documentation for CI

* pymodbus-dev#167 disable pep8/flake checks for the time being

* pymodbus-dev#167, fix install dependencies osx, remove pypy from supported python versions

* pymodbus-dev#167, fix install dependencies osx, remove pypy from supported python versions

* pymodbus-dev#167 , fix minior error in travis.yml

* Bump version to 1.3.0rc2

* Fix pymodbus-dev#170 and other misc updates

* Updated Documents

* Add coverage.rc to show missing lines with coverage >4.0

* new documentation

* pymodbus-dev#171 Minor bug fix in BinaryPayloadBuilder.add_string method for python3

* 1. pymodbus-dev#179 fix error calculating response pdu length for read coil/discrete input requests
2. pymodbus-dev#179 add tests

* Enable debug logging for send packets
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants