Skip to content

Conversation

@dhoomakethu
Copy link
Contributor

@dhoomakethu dhoomakethu commented Dec 30, 2020

version 2.5.0rc3

  • Minor fix in documentations
  • Travis fix for Mac OSX
  • Disable unnecessary deprecation warning while using async clients.
  • Use Github actions for builds in favor of travis.

version 2.5.0rc2

  • Documentation updates
  • Disable strict mode by default.
  • Fix ReportSlaveIdRequest request
  • Sparse datablock initialization updates.

version 2.5.0rc1

  • Support REPL for modbus server (only python3 and asyncio)
  • Fix REPL client for write requests
  • Fix examples
    • Asyncio server
    • Asynchronous server (with custom datablock)
    • Fix version info for servers
  • Fix and enhancements to Tornado clients (seril and tcp)
  • Fix and enhancements to Asyncio client and server
  • Update Install instructions
  • Synchronous client retry on empty and error enhancments
  • Add new modbus state RETRYING
  • Support runtime response manipulations for Servers
  • Bug fixes with logging module in servers
  • Asyncio modbus serial server support

dhoomakethu and others added 18 commits December 19, 2020 11:37
The _strict argument should be defaulted to False since the inter_char_timeout feature is not working correctly. Changes in the past have tried to fix the issue but one way or another they do not seem to work consistently across all computers and systems. Therefore I think by default the _strict argument should be set to False unless specified to prevent the faulty behavior from producing false timeouts.

There are two possible reasons why I think this feature may never work correclty:
* One the OS handling the timeout incorrectly if more than one character arrives at the same time if it is busy doing something else.
* Another one as described here https://stackoverflow.com/a/37053542/1813498 is the fact that the timeout value must be a multiple of 0.1. At 9600 the inter char value is calculated to be 0.00171875 and then rounded to 0 so therefore it will not work correctly.

The conclusion from my side is that it is not possible to accurately measure this timeout and should perhaps be removed. At least it should be by default disabled. This small patch aims to do the later.
Wrongly attempted to treat the object as a dict, needs to check if the
property is there at all.

Fixes: 042458b: other: reportSlaveId: allow slaves to provide custom responses

Signed-off-by: Karl Palsson <karlp@tweak.net.au>
Currently, to create a sparse data store, you are required to provide an
initial list/dict.  The first entry is then used as a "default" for the
reset() call, which seems rather at odds with the "sparse" nature.

Instead, use a supplied intial value if provided, and use that to
properly reset the store to _that_ value.  Similarly don't require an
initial list at all, allowing addresses/registers to be filled in via
follow up calls to .setValues()

Example old code: (We want to register 20 addresses at 0x2000}

 # must provide at least one initial value!
 hr = ModbusSparseDataBlock({0x2000: 0x55aa})
 # actually register what we want using flexible lists.
 hr.setValues(0x2000, [0]*20)

Example new code:

 hr = ModbusSparseDataBlock()
 hr.setValues(0x2000, [0]*20)

Example old code using reset:

 hr = ModbusSparseDataBlock({
	0x2000: 0x55,
	0x3000: 0x66
	})
 hr.reset()

At this point, the store contained two registers, 0x2000 and 0x2001,
both containing the value 0x55.  This hardly seems to have been the
intention of .reset() on a Sparse store, but is obvious for the
sequential store.

Fixes: #566

Signed-off-by: Karl Palsson <karlp@etactica.com>
@dhoomakethu dhoomakethu added this to the 2.5.0 milestone Dec 30, 2020
@dhoomakethu dhoomakethu mentioned this pull request Jan 13, 2021
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 3, 2021

SonarCloud Quality Gate failed.

Bug E 1 Bug
Vulnerability A 0 Vulnerabilities
Security Hotspot E 10 Security Hotspots
Code Smell A 30 Code Smells

No Coverage information No Coverage information
0.7% 0.7% Duplication

@dhoomakethu dhoomakethu merged commit 7e8e7cf into dev Feb 3, 2021
@janiversen janiversen deleted the 2.5.0 branch April 5, 2022 07:56
@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.