NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI
PyPI, #3345 most downloaded on PyPI
A fully featured modbus protocol stack in python
Latest stable
3.16.2
Last release 19 days ago
03 Nov 2026
Ships fairly regularly
a new release about every 5 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
4 versions withdrawn
withdrawn after publishing
14 years old
84 releases · first in 2012
Drag across the ruler to compare, or tap a release to open it.
Discard the late response of a cancelled request
Thanks to @wanjinhao1 a regression was found, that demanded pyserial installed. Thanks for reporting this...and to all, sorry for the inconvenience!
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Thanks to @wanjinhao1 a regression was found, that demanded pyserial installed. Thanks for reporting this...and to all, sorry for the inconvenience!
Changes:
This release is just a bug fix release, but parameter allow_multiple_devices have been removed from server hence 3.16 and not 3.15.1.
This release is just a bug fix release, but parameter allow_multiple_devices have been removed from server hence 3.16 and not 3.15.1.
We welcome no less than 12 new committers. THANKS for your contributions.
Changes:
removed allow_multiple_devices on ModbusSerialServer (cleanup multidrop).
This is really a bug fix release with quite a number of important fixes, thanks to our committers. It is marked as a x.y release for 2 reasons:
This is really a bug fix release with quite a number of important fixes, thanks to our committers. It is marked as a x.y release for 2 reasons:
We welcome 3 new committers.
Fixes:
SimDevice.action (#2989)ModbusSerialServer.__init__ kwargs (#2962)removed cert parameters (apart from sslctx) from ModbusTLSserver/client.
Bug fixes and 3rd party libs (used only for development) are upgraded.
Bug fixes and 3rd party libs (used only for development) are upgraded.
The function generate_ssl() is moved to examples.
ModbusServerContext initialization with dict devices parameter (#2944)DataType.REGISTERS 'h' -> 'H' (#2940)ModbusTlsServer, removed parameters certfile=,keyfile=,password=, only accept sslctx= * This is due to complaints that the development certificate is self signed, and thus insecure for production.
ModbusTlsClient, removed generate_ssl() * This is due to complaints that the development certificate is self signed, and thus insecure for production.
Upgraded 3rd party libraries (only relevant for developing pymodbus)
Small summer maintenance release:
Small summer maintenance release:
Altherma heat pump control, with Home Assistant and updating server.
removed RemoteDeviceContext, because it only is a partial forwarder a proper forwarder should be made at frame level.
datastore get/setValues is removed, please use server.async_get/setValues instead.
datastore show a deprecation warning please use simData instead.
SimData/SimDevice have been updated
No inter_frame_time check for baudrate > 38000.
Minor bug fixes.
asyncio.iscoroutinefunction() is deprecated
This release contains a lot of smaller (but still important) bug fixes, and 2 big new items:
We are also please to welcome 4 new contributors, who we hope will contribute more. A big thanks to all that have helped make this release happen.
Please remember this is an Y type release (in our X.Y.Z scheme) so please remember to check API_CHANGES.RST to see if your project needs to make small changes.
Detailed changes:
when using no_response_expected=, the call returns None
remove idle_time() from sync client since it is void
ModbusSerialServer new parameter "allow_multiple_devices" which gives limited multipoint support with baudrate < 19200 and a good RS485 line.
SimData / SimDevice are now integrated in the server (and will mid-term replace other datastores).
Most important change is that there are now full support for python 3.14 and a number of packages (like mypy) have been updated.
Small maintenance release.
Most important change is that there are now full support for python 3.14 and a number of packages (like mypy) have been updated.
Prepare 3.11.4 (#2815)
Update CodeQL to v4. (#2816)
Solve python3.14 problem (and mypy upgrade). (#2814)
More doc corrections. (#2813)
Correct wrong example in doc. (#2812)
update to pylint 4 (#2806)
ExceptionResponse for no_response_expected. (#2801)
Complete test for SimData / SimDevice. (#2798)
SimData and simDevice. (#2796)
Avoid windows CI problem with log testing. (#2797)
Update doc with 4.0 information. (#2795)
Make global DataType. (#2794)
Remove test pymodbus.log file. (#2793)
Update README. (#2788)
Activate ruff indent checking. (#2787)
Coverage 100% (using no cover, when needed).
A small maintenance release.
Most important change is it creates an alias in pypi for the library, allowing home-assistant to overcome a version problem.
Clarify documentation on reconnect_delay
Remark: in the test coverage commits are a change of the ExceptionResponse PDU, which could cause problems on v3.11.1.
Auto debug in case of an error.
v3.11.0 is actually a bug fix to v3.10.0, but since the fix causes an API change it was not possible otherwise make v3.10.1
v3.11.0 is actually a bug fix to v3.10.0, but since the fix causes an API change it was not possible otherwise make v3.10.1
Revert wrong byte handling in v3.10.0 bit handling order is LSB-> MSB for each byte REMARK: word are ordered depending on big/little endian readCoils and other bit functions now return bit in logical order (NOT byte order)
Example: Hex bytes: 0x00 0x01 delivers False * 8 True False * 7
Hex bytes: 0x01 0x03 delivers True False * 7 True True False * 6
DO NOT USE THIS RELEASE it is broken v3.11.0 repair the broken part.
DO NOT USE THIS RELEASE it is broken v3.11.0 repair the broken part.
trace_connect callback twice (#2670)This release is made due to a longer delay in releasing v4.0.0 (probably end of year).
Remark, this release contains important changes for the modbus integration in Home Assistant ! The changes are tested in a custom_component modbus.
ModbusSlaveContext replaced by ModbusDeviceContext
payload removed (replaced by "convert_to/from_registers")
slave=, slaves= replaced by device_id=, device_ids=
slave request names changed to device
bit handling order is LSB (last byte) -> MSB (first byte) readCoils and other bit functions now return bit in logical order (NOT byte order)
Older versions had LSB -> MSB pr byte V3.10 have LSB -> MSB across bytes.
Example: Hex bytes: 0x00 0x01 Older versions would deliver False * 8 True False * 7 V3.10 deliver True False * 15
Hex bytes: 0x01 0x03 Older versions would deliver True False * 7 True True False * 6 V3.10 deliver True True False * 6 True False * 7
Don't bool-test explicit datastores
* Correct byte order in bits.
Correct bit handling internally and in API.
Remark #2627 is a very important commit, because e.g. read_coils returned the coils in a wrong order, meaning the app would misinterpret. This is a very old, which went unnoticed for years.
Python 3.9 is reaching end of life, and no longer supported. Depending on the usage the code might still work
Start*Server, custom_functions -> custom_pdu (handled by Modbus<x>Server)
Bit handling (e.g. read_coils) was not handling the bits in the correct order
Allow id=0 and check if response.id == request.id.
It turns out that not allowing id=0 was too restrictive, instead now requests with id=0 is allowed provided the device responds with id=0.
New simulator is WIP, not to be used.
Parameterize string encoding in convert_to_registers and convert_from_registers
no_response_expected (#2550)Bug fix release, and remove the deprecated tag on payload.
Bug fix release, and remove the deprecated tag on payload.
The main goals have changed, please see https://pymodbus.readthedocs.io/en/latest/source/roadmap.html
For details on the payload decoder/encoder please see https://github.com/pymodbus-dev/pymodbus/discussions/2525
Changes:
Asyncio future removed from sync client.
Raise exception on no response in async client.
Deprecate BinaryPayloadDecoder / BinaryPayloadBuilder.
This is the biggest release since 3.0.0, it contains:
ModbusSlaveContext, removed zero_mode parameter.
Removed skip_encode parameter.
renamed ModbusExceptions enums to legal constants.
enforced client keyword only parameters (positional not allowed).
added trace_packet/pdu/connect to client/server.
removed on_connect_callback from client.
removed response_manipulator, request_tracer from server.
Version v3.7.3 contains a critical bug, that makes the sync. client disconnect/connect with every request, thus adding a large delay.
Version v3.7.3 contains a critical bug, that makes the sync. client disconnect/connect with every request, thus adding a large delay.
no_response_expected argument to requests (#2385)Bug fix release and framers updated.
Bug fix release and framers updated.
Details:
stacklevel=2 to logging functions (#2330)v3.7.1 had wrong documentation.
v3.7.1 had wrong documentation.
Better error message, when pyserial is missing.
Remove unneeded client parameters.
API CHANGES:
Solve serial unrequested frame.
Allow socket exception response with wrong length
Solve problems with Home Assistant 2024.4.x modbus integration !!!
Solve problems with Home Assistant 2024.4.x modbus integration !!!
Include PRs from dev that do not have API changes.
Solve transport close() as not inherited method.
mypy --check-untyped-defs (#2096)Update framers to ease message integration (only decode/encode)
Changes:
Update datastore_simulator example with client
solve Socket_framer problem with Exception response
v.3.6.0 with pypi upload solved, and documentation set at correct version
v.3.6.0 with pypi upload solved, and documentation set at correct version
* Solve pypi upload error.
Solve pypi upload error.
Release errors (pyproject.toml changes).
Simplify transport_serial (modbus use)
version 3.5.2 ---------------------------------------------------------- - server tracer example. (#1773) - sync connect missing. (#1772) - simulator
Always close socket on error (reset_sock).
test_client: Fix test_client_protocol_execute()
Remove handler parameter from ModbusUdpServer
Remove loop parameter from ModbusSerialServer
Remove handler and allow_reuse_port from repl default config
Static classes from the constants module are now inheriting from enum.Enum and using UPPER_CASE naming scheme, this affects: - MoreData - DeviceInformation - ModbusPlusOperation - Endian - ModbusStatus
Async clients now accepts no_resend_on_retry=True, to not resend the request when retrying.
ModbusSerialServer now accepts request_tracer=.
pass source_address in tcp client.
requests dependency from contrib/explain.py (#1688)Thanks to: Alex James Braza jan iversen
This release integrates the transport layer into the server, upgrade the simulator and many bug fixes.
This release integrates the transport layer into the server, upgrade the simulator and many bug fixes.
examples/contrib/explain.py leveraging Rapid SCADA (#1665)Thanks to: Alex Fredo70 Hangyu Fan James Braza jan iversen
Modbus<x>Client .connect() returns True/False (connected or not)
Modbue<x>Server handler=, allow_reuse_addr=, backlog= are no longer accepted
ModbusTcpClient / AsyncModbusTcpClient no longer support unix path
StartAsyncUnixServer / ModbusUnixServer removed (never worked on Windows)
ModbusTlsServer reqclicert= is no longer accepted
ModbusSerialServer auto_connect= is no longer accepted
ModbusSimulatorServer.serve_forever(only_start=False) added to allow return
Fix regression with REPL server not listening
Thanks to: Alex Fredo70 jan iversen
transport fixes and 100% test coverage.
Bug fix release !
Thanks to: Hayden Roche jan iversen Philip Couling
Transport integrated in async clients.
Thanks to: Alex Christian Krause corollaries dhoomakethu Ghostkeeper jan iversen James Braza Kenny Johansson Pavel Kostromitinov
ModbusTcpDiagClient is removed due to lack of support
Clients have an optional parameter: on_reconnect_callback, Function that will be called just before a reconnection attempt.
general parameter unit= -> slave=
move SqlSlaveContext, RedisSlaveContext to examples/contrib (due to lack of maintenance)
BinaryPayloadBuilder.to_string was renamed to BinaryPayloadBuilder.encode
on_reconnect_callback for async clients works slightly different
utilities/unpack_bitstring now expects an argument named data not string
version 3.2.2 (picked from dev, only bugfixes)
version 3.2.1 (picked from dev, only bugfixes)
Thanks to: Alex, jan iversen, Thijs W
This release changes the development environment, please remember to update requirements and run "precommit --install".
This release changes the development environment, please remember to update requirements and run "precommit --install".
There are smaller API changed, documented in API_CHANGES.rst, as well as 2 new methods to help receive/send values (in contrast to registers).
Thanks to: AKJ7, Alex, Alex Ruddick, banana-sun, cgernert, Jakob Ruhe, James Braza, jan Iversen
helper to convert values in mixin: convert_from_registers, convert_to_registers
import pymodbus.version -> from pymodbus import __version__, __version_full__
pymodbus.pymodbus_apply_logging_config(log_file_name="pymodbus.log") to enable file pymodbus_apply_logging_config
pymodbus.pymodbus_apply_logging_config have default DEBUG, it not called root settings will be used.
pymodbus/interfaces/IModbusDecoder removed.
pymodbus/interfaces/IModbusFramer removed.
pymodbus/interfaces/IModbusSlaveContext -> pymodbus/datastore/ModbusBaseSlaveContext.
StartAsync<type>Server, removed defer_start argument, return is None. instead of using defer_start instantiate the Modbus<type>Server directly.
ReturnSlaveNoReponseCountResponse has been corrected to ReturnSlaveNoResponseCountResponse
Option --modbus-config for REPL server renamed to --modbus-config-path
client.protocol.<something> --> client.<something>
client.factory.<something> --> client.<something>
Fix register type check for size bigger than 3 registers (6 bytes)
More direct readme links for REPL
Thanks to:
Alex, Alexandre CUER, dhoomakethu, jan iversen, peufeu2
small performance improvement on debug log
Thanks to:
Alex Alexandre CUER Dries jan iversen peufeu2
We are happy to announce we have a new home pymodbus-dev, so now we are in a 100% FOSS home. The move from riptideio (a company) was made possible tha
We are happy to announce we have a new home pymodbus-dev, so now we are in a 100% FOSS home. The move from riptideio (a company) was made possible thanks to @dhoomakethu We hope that a 100% FOSS home will encourage more contributors to help make pymodbus even better.
Thanks to:
Alex banana-sun Chris Hung dhoomakethu jan iversen Matthias Straka Pavel Kostromitinov
Added --host to client_* examples, to allow easier use.
unit= in client calls are no longer converted to slave=, but raises a runtime exception.
Added missing client calls (all standard request are not available as methods).
client.mask_write_register() changed parameters.
server classes no longer accept reuse_port= (the socket do not accept it)
Add pygments as requirement for repl
Thanks to:
Alex Alexandre CUER Blaise Thompson dhoomakethu Gao Fang jan Iversen Joe Burmeister Sebastian Machuca Thijs W WouterTuinstra
Update datastore remote to handle write requests (#1166) Allow multiple servers. (#1164) Fix typo. (#1162) Transfer parms. to connected client. (#1161
Update datastore remote to handle write requests (#1166) Allow multiple servers. (#1164) Fix typo. (#1162) Transfer parms. to connected client. (#1161) Repl enhancements 2 (#1141) Server simulator with datastore with json data. (#1157) Avoid unwanted reconnects (#1154) Do not initialize framer twice. (#1153) Allow timeout as float. (#1152) Improve Docker Support (#1145) Fix unreachable code in AsyncModbusTcpClient (#1151) Fix type hints for port and timeout (#1147) Start/stop multiple servers. (#1138) Server/asyncio.py correct logging when disconnecting the socket (#1135) Add Docker and container registry support (#1132) Removes undue reported error when forwarding (#1134) Obey timeout parameter on connection (#1131) Readme typos (#1129) Clean noqa directive. (#1125) Add isort and activate CI fail for black/isort. (#1124) Update examples. (#1117) Move logging configuration behind function call (#1120) serial2TCP forwarding example (#1116) Make serial import dynamic. (#1114) Bugfix ModbusSerialServer setup so handler is called correctly. (#1113) Clean configurations. (#1111)
Thanks to:
Alex Alexandre CUER Blaise Thompson dhoomakethu Gao Fang jan Iversen Joe Burmeister Sebastian Machuca Thijs W WouterTuinstra
This is a major release, with many changes in the interface compared to version 2.5.3.
This is a major release, with many changes in the interface compared to version 2.5.3.
Solve multiple incomming frames. (#1107)
Up coverage, tests are 100%. (#1098)
Prepare for rc1. (#1097)
Prepare 3.0.0dev5 (#1095)
Adapt serial tests. (#1094)
Allow windows. (#1093)
Remove server sync code and combine with async code. (#1092)
Solve test of tls by adding certificates and remove bugs (#1080)
Simplify server implementation. (#1071)
Do not filter using unit id in the received response (#1076)
Hex values for repl arguments (#1075)
All parameters in class parameter. (#1070)
Add len parameter to decode_bits. (#1062)
New combined test for all types of clients. (#1061)
Dev mixin client (#1056)
Add/update client documentation, including docstrings etc. (#1055)
Add unit to arguments (#1041)
Add timeout to all pytest. (#1037)
Simplify client parent classes. (#1018)
Clean copyright statements, to ensure we follow FOSS rules. (#1014)
Rectify sync/async client parameters. (#1013)
Clean client directory structure for async. (#1010)
Remove async_io, simplify AsyncModbus<x>Client. (#1009)
remove init_<something>_client(). (#1008)
Remove async factory. (#1001)
Remove loop parameter from client/server (#999)
add example async client. (#997)
Change async ModbusSerialClient to framer= from method=. (#994)
Add forwarder example with multiple slaves. (#992)
Remove async get_factory. (#990)
Remove unused ModbusAccessControl. (#989)
Solve problem with remote datastore. (#988)
Remove unused schedulers. (#976)
Remove twisted (#972)
Remove/Update tornado/twister tests. (#971)
remove easy_install and ez_setup (#964)
Fix mask write register (#961)
Activate pytest-asyncio. (#949)
Changed default framer for serial to be ModbusRtuFramer. (#948)
Remove tornado. (#935)
Pylint, check method parameter documentation. (#909)
Add get_response_pdu_size to mask read/write. (#922)
Minimum python version is 3.8. (#921)
Ensure make doc fails on warnings and/or errors. (#920)
Remove central makefile. (#916)
Re-organize examples (#914)
Documentation cleanup and clarification (#689)
Update doc for repl. (#910)
Include package and tests in coverage measurement (#912)
Use response byte length if available (#880)
better fix for rtu incomplete frames (#511)
Remove twisted/tornado from doc. (#904)
Update classifiers for pypi. (#907)
Documentation updates
PEP8 compatibale code
More tooling and CI updates
Remove python2 compatibility code (#564)
Remove Python2 checks and Python2 code snippets
Misc co-routines related fixes
Fix CI for python3 and remove PyPI from CI
Fix mask_write_register call. (#685)
Add support for byte strings in the device information fields (#693)
Catch socket going away. (#722)
Misc typo errors (#718)
Support python3.10
Implement asyncio ModbusSerialServer
ModbusTLS updates (tls handshake, default framer)
Support broadcast messages with asyncio client
Fix for lazy loading serial module with asyncio clients.
Updated examples and tests
Support python3.7 and above
Support creating asyncio clients from with in coroutines.
Nothing published for this version
One column per quarter.