Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Released
2.3.7 - 2023-07-19
Fixed
Add a single character wait time after flush to avoid timing issues with RTU control pin, see #68 and #72
2.3.6 - 2023-07-19
Added
Add contribution guideline, see #67
Content of
package.jsonis validated on each test workflow runPrecommit hooks for
package.jsonand package version file validation, yaml style, flake8 and trailing whitespace checks, contributes to #67
Changed
umodbus/version.pyfile is validated against the latest changelog entry before running all tests and testing the package creationuloggingplaced intotestsfolder instead of installing it with deprecatedupipin all Docker containers
Fixed
Added missing empty line in several files
2.3.5 - 2023-07-01
Fixed
Time between RS485 control pin raise and UART transmission reduced by 80% from 1000us to 200us
The RS485 control pin is lowered as fast as possible by using
time.sleep_us()instead ofmachine.idle()which uses an IRQ on the order of milliseconds. This kept the control pin active longer than necessary, causing the response message to be missed at higher baud rates. This applies only to MicroPython firmwares below v1.20.0The following fixes were provided by @wpyoga
RS485 control pin handling fixed by using UART
flushfunction, see #68Invalid CRC while reading multiple coils and fixed, see #50 and #52
2.3.4 - 2023-03-20
Added
package.jsonformipinstallation with MicroPython v1.19.1 or newer.editorconfigfor common editor settings.yamllintto lint all used YAML filesyamllintpackage to therequirements-test.txtfileRun YAML linter on test workflow
Modbus version input field in issues template
Changed
Test workflow is also running on pull requests as the workflow is not executed on branches of contributors
Fixed
YAML style violation in Docker, workflow and issue files
mipinstallation commands inREADMEandINSTALLATION
2.3.3 - 2023-01-29
Fixed
Add link to RTU documentation examples from RTU examples files and root README, relates to #7
Add missing ESP32, RP2 and pyboard pin usage for RTU in examples and documentation, relates to #7 and #17
Add missing issue template file, see #46
2.3.2 - 2023-01-09
Added
Installation instructions for
mipusage on MicroPython 1.19.1 or newer, see #44INSTALLATION, TESTING and EXAMPLES files for simpler docs structure
Changed
Split SETUP into INSTALLATION
Use callback to reset register data in RTU client example
Update docs copyright year to 2023
Use fakes machine module instead of classic Mock in docs config file
Fixed
2.3.1 - 2023-01-06
Added
Unittest to read multiple coils at any location if defined as list, verifies #35
Unittests to write a single coil or multiple coils at any location if defined as list, verifies fix #15 and #24
Fixed
All configured register of a client can be accessed and modified individually, see #35
Resolved overlapping register positions in example JSON file
Register length of
EXAMPLE_IREGin TCP and RTU examples corrected to 1 instead of 2
2.3.0 - 2023-01-03
Added
Custom callback functions can be registered on client (ModbusRTU or ModbusTCP) side with new parameters
on_set_cbandon_get_cbavailable from modbus.py functionsadd_coilandadd_hreg. Functionsadd_istandadd_iregsupport onlyon_get_cb, see #31Example callback usage shown in TCP client example
Documentation for callback functions in USAGE
Changed
Typing hint
Callableis now subscriptable
2.2.0 - 2023-01-03
Added
Fake machine module with UART and Pin class to be used on Unix MicroPython container for RTU tests and examples, see #47
RTU docker compose file and RTU docker compose file test based in MicroPython 1.18 image
RTU client Dockerfile and RTU host Dockerfile based on MicroPython 1.18 image
Initial RTU examples unittest
RTU example section for Client and Host in USAGE
Changed
Outsourced the following common functions of serial.py and tcp.py into
CommonModbusFunctionsof common.py:read_coilsread_discrete_inputsread_holding_registersread_input_registerswrite_single_coilwrite_single_registerwrite_multiple_coilswrite_multiple_registers
Inherit from
CommonModbusFunctionsinSerialof serial.py and inTCPof of tcp.pyExtended RTU client example for Docker usage to load all registers from example JSON file
Update internal functions parameter name from
slave_idtoslave_addrof TCP’s_create_mbap_hdrand_validate_resp_hdrfunction to be the same as in SerialUpdate Modbus function documentation from TCP specific to common module in USAGE file
Renamed docker files:
Dockerfile.client->Dockerfile.client_tcpDockerfile.host->Dockerfile.host_tcpDockerfile.test_tcp_example->Dockerfile.test_examples
2.1.3 - 2022-12-30
Fixed
uart_idcan be specified during init ofModbusRTUandSerialclass and is no longer hardcoded to1, but set as1by default to ensure backwards compability, see #7 and #43RTU Client example and USAGE documentation updated with new
uart_idparameter
2.1.2 - 2022-12-28
Changed
Baudrate specific inter frame time is used at Modbus RTU internal function
_uart_readof serial.py instead of constant value of 5ms
Fixed
2.1.1 - 2022-12-27
Fixed
Removed unnecessary dependency to
micropython-urequestsfrom Docker files, setup guide and package setup fileEnable Modbus Client mode for RTU implementation, see #40, removed during #33
2.1.0 - 2022-12-27
Added
Typing hints available for all functions of umodbus, see #27
Docstrings available for all constants, functions and classes of umodbus, see #27
Test for reading more than 8 coils in a row to verify fix of #36
Test for reading single negative holding register value
Test for writing multiple coils to verify fix of #22
Test for writing multiple registers to verify fix of #23
Usage documentation for coil, discrete inputs, holding register and input register usage
Modbus TCP IP and port binding can be checked with
is_boundproperty in tcp.py
Changed
Fixed
Typing hints of function input parameters and return values
Response data of multiple changed registers (
write_multiple_registers) is validated with respect to the providedsignedflag in serial.py and tcp.py, see #23Enable reading more than 8 coils in a row, see #36
Writing multiple coils in TCP, see #22
Writing multiple registers in TCP, see #23
Unit test
test_bytes_to_booluses MSB and LSB data correctlyOnly requested amount of registers are returned by
_process_read_accesslogic of tcp.py, see #35
2.0.0 - 2022-12-03
Added
Perform MicroPython based unittests on every
Testworkflow runAdd usage description of docker based MicroPython unittest framework in USAGE
Add docker compose file based in MicroPython 1.18 image
Add TCP client Dockerfile, TCP host Dockerfile, unittest Dockerfile and TCP unittest specific Dockerfile. All based on MicroPython 1.18 image
Add initial test, testing the unittest itself
Add unittest implementation based on pfalcon’s micropython-unittest
Docstrings available for all functions of functions.py, see #27
Typing hints available for all functions of functions.py, serial.py and tcp.py, see #27
Unittest for functions.py, see #16
Unittest for const.py, see #16
.readthedocs.yaml for Read The Docs, contributes to #26
Changed
Use default values for all registers defined in the example JSON
TCP host example and TCP client example define a static IP address and skip further WiFi setup steps in case a Docker usage is detected by a failing import of the
networkmodule, contributes to #16Define all Modbus function codes as
const()to avoid external modifications, contributes to #18Remove dependency to
Serialandrequestsfromumodbus.modbus, see #18ModbusRTUclass is part of serial.py, see #18ModbusTCPclass is part of tcp.py, see #18ModbusRTUandModbusTCPclasses and related functions removed from modbus.py, see #18Imports changed from:
from umodbus.modbus import ModbusRTUtofrom umodbus.serial import ModbusRTUfrom umodbus.modbus import ModbusTCPtofrom umodbus.tcp import ModbusTCP
read_coilsandread_discrete_inputsreturn a list with the same length as the requested quantity instead of always 8, see #12 and #25Common functions
bytes_to_boolandto_shortmoved to functions.pyUse HTTPS URL instead of SSH for submodule
Cleanup of root README, content moved to SETUP and USAGE, contributes to #30
Moved SETUP and USAGE into docs folder, see #26 contributes to #30
Use
Falseor0as default values for registers without a specific initial value in modbus.py
Fixed
read_coilsreturns list with amount of requested coils, see #12read_holding_registersreturns list with amount of requested registers, see #25
1.2.0 - 2022-11-13
Added
JSON file to set registers on TCP/RTU device
Bash script to wrap manipulation of TCP modbus register data
TOC in README
Use changelog-based-release action to create a draft release with every merge to develop
Use changelog-based-release action to create a drafted prerelease release with every PR build, see #20
Changed
Add more info to TCP client example script
Update modules submodule to
1.3.0Line breaks are no longer used in this changelog for enumerations
Issues are referenced as
#123instead of[#123][ref-issue-123]to avoid explicit references at the bottom or some other location in the fileScope of contents permissions in release and test release workflow is now
writeto use auto release creation
Fixed
Typo in RTU client example script
1.1.1 - 2022-11-09
Fixed
Default value of
setup_registersfunction parameteruse_default_valschanged toFalseto avoid confusion behaviour if not explicitly defined, see issue 13Missing function docstring added to
setup_registersfunctionwrite_single_coilallows0,1,False,True,0x0or0xFF00instead of0x0and0xFF00only as set value, see issue 14
1.1.0 - 2022-11-03
Added
float_to_bin,bin_to_float,int_to_binfunctions added toumodbus/functions.pyDeploy to Test Python Package Index on every PR build with a PEP440 compliant
-rc<BUILDNUMBER>.dev<PR_NUMBER>meta data extensionTest release workflow running only on PRs is archiving and uploading built artifacts to Test Python Package Index
Changed
Author is explicitly mentioned in
setup.pyinstead of used by__author__variable which has been previously defined inversion.pybut no longer available with autodeploy.
Fixed
All uncovered flake8 warnings of
umodbus
1.0.0 - 2022-02-26
Added
setup.pyandsdist_upip.pytaken from pfalcon’s picoweb repo and PEP8 improvedversion.pystoring current library versiontyping.pyenabling type hints
Changed
Moved all uModbus files from
lib/uModbusintoumodbusUpdate import statements of all files of
umodbusUpdate
READMEusage description of MicroPython lib deploy to PyPiUsage examples in
READMEupdated with new import pathEnable setting of
max_connectionsto TCP socket inmodbus ModbusTCP bind functionandtcp TCPServer bind function
Removed
MicroPython helpers module no longer used
MicroPython ESP WiFi Manager module no longer used
Lib folder of dependency modules no longer used
Commented print debug messages in several files of umodbus
0.1.0 - 2022-02-20
Added
This changelog file
.gitignorefilerequirements.txtfile to setup tools for board interactionsCreation header to all files of
lib/uModbusin order to provide proper credits to Pycomget_is_bound()function added tolib/uModbus/tcp.pyto check status of socket binding for the Modbus TCP Server (host)Example register files to show basic usage with a MyEVSE board
Changed
READMEfile with usage examplesReplaced WiPy specific calls in
lib/uModbusfiles with MicroPython 1.16 or higher callsLimit number of concurrent socket connections to the Modbus TCP Server (host) to 10
Return on
_accept_request()in case of anOSErroras MicroPython raises this type of error in case a socket timeout occured.TimeoutErroris not available on MicroPython compared to WiPy
Fixed
PEP8 style issues on all files of
lib/uModbus