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.4 - 2023-03-20

Added

  • package.json for mip installation with MicroPython v1.19.1 or newer

  • .editorconfig for common editor settings

  • .yamllint to lint all used YAML files

  • yamllint package to the requirements-test.txt file

  • Run 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

  • mip installation commands in README and INSTALLATION

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

Changed

Fixed

  • Basic RTU host example in root README uses correct init values, optional parameters are listed after mandatory ones

  • Remove outdated warning sections about #35 bug from USAGE

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_IREG in 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_cb and on_get_cb available from modbus.py functions add_coil and add_hreg. Functions add_ist and add_ireg support only on_get_cb, see #31

  • Example callback usage shown in TCP client example

  • Documentation for callback functions in USAGE

Changed

  • Typing hint Callable is now subscriptable

2.2.0 - 2023-01-03

Added

Changed

  • Outsourced the following common functions of serial.py and tcp.py into CommonModbusFunctions of common.py:

    • read_coils

    • read_discrete_inputs

    • read_holding_registers

    • read_input_registers

    • write_single_coil

    • write_single_register

    • write_multiple_coils

    • write_multiple_registers

  • Inherit from CommonModbusFunctions in Serial of serial.py and in TCP of of tcp.py

  • Extended RTU client example for Docker usage to load all registers from example JSON file

  • Update internal functions parameter name from slave_id to slave_addr of TCP’s _create_mbap_hdr and _validate_resp_hdr function to be the same as in Serial

  • Update Modbus function documentation from TCP specific to common module in USAGE file

  • Renamed docker files:

    • Dockerfile.client -> Dockerfile.client_tcp

    • Dockerfile.host -> Dockerfile.host_tcp

    • Dockerfile.test_tcp_example -> Dockerfile.test_examples

2.1.3 - 2022-12-30

Fixed

  • uart_id can be specified during init of ModbusRTU and Serial class and is no longer hardcoded to 1, but set as 1 by default to ensure backwards compability, see #7 and #43

  • RTU Client example and USAGE documentation updated with new uart_id parameter

2.1.2 - 2022-12-28

Changed

  • Baudrate specific inter frame time is used at Modbus RTU internal function _uart_read of serial.py instead of constant value of 5ms

Fixed

  • ESP32 port specific wait_tx_done function replaced by generic wait time calculation in _send function of serial.py, see #34

  • A 1ms delay has been added between turning the RS485 control pin on and sending the Modbus PDU in _send function of serial.py

2.1.1 - 2022-12-27

Fixed

  • Removed unnecessary dependency to micropython-urequests from Docker files, setup guide and package setup file

  • Enable 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_bound property in tcp.py

Changed

  • Reordered modules of API documentation

  • data_as_registers and data_as_bits of common.py removed

  • Send illegal function code 0x01 if a register other than coil or holding register is requested to be set

  • Simplified _process_write_access logic of tcp.py

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 provided signed flag in serial.py and tcp.py, see #23

  • Enable 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_bool uses MSB and LSB data correctly

  • Only requested amount of registers are returned by _process_read_access logic of tcp.py, see #35

2.0.0 - 2022-12-03

Added

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 network module, contributes to #16

  • Define all Modbus function codes as const() to avoid external modifications, contributes to #18

  • Remove dependency to Serial and requests from umodbus.modbus, see #18

  • ModbusRTU class is part of serial.py, see #18

  • ModbusTCP class is part of tcp.py, see #18

  • ModbusRTU and ModbusTCP classes and related functions removed from modbus.py, see #18

  • Imports changed from:

    • from umodbus.modbus import ModbusRTU to from umodbus.serial import ModbusRTU

    • from umodbus.modbus import ModbusTCP to from umodbus.tcp import ModbusTCP

  • read_coils and read_discrete_inputs return a list with the same length as the requested quantity instead of always 8, see #12 and #25

  • Common functions bytes_to_bool and to_short moved to functions.py

  • Use 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 False or 0 as default values for registers without a specific initial value in modbus.py

Fixed

  • read_coils returns list with amount of requested coils, see #12

  • read_holding_registers returns list with amount of requested registers, see #25

1.2.0 - 2022-11-13

Added

Changed

  • Add more info to TCP client example script

  • Update modules submodule to 1.3.0

  • Line breaks are no longer used in this changelog for enumerations

  • Issues are referenced as #123 instead of [#123][ref-issue-123] to avoid explicit references at the bottom or some other location in the file

  • Scope of contents permissions in release and test release workflow is now write to use auto release creation

Fixed

1.1.1 - 2022-11-09

Fixed

  • Default value of setup_registers function parameter use_default_vals changed to False to avoid confusion behaviour if not explicitly defined, see issue 13

  • Missing function docstring added to setup_registers function

  • write_single_coil allows 0, 1, False, True, 0x0 or 0xFF00 instead of 0x0 and 0xFF00 only as set value, see issue 14

1.1.0 - 2022-11-03

Added

Changed

  • Author is explicitly mentioned in setup.py instead of used by __author__ variable which has been previously defined in version.py but no longer available with autodeploy.

Fixed

  • All uncovered flake8 warnings of umodbus

1.0.0 - 2022-02-26

Added

Changed

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

Changed

  • Reworked boot.py and main.py for simple usage

  • README file with usage examples

  • Replaced WiPy specific calls in lib/uModbus files with MicroPython 1.16 or higher calls

  • Limit number of concurrent socket connections to the Modbus TCP Server (host) to 10

  • Return on _accept_request() in case of an OSError as MicroPython raises this type of error in case a socket timeout occured. TimeoutError is not available on MicroPython compared to WiPy

Fixed