Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
38c20bc
P183 initial state
flashmark Aug 24, 2025
46f2a50
P183 2nd attempt
flashmark Aug 24, 2025
7d0e802
P183 Add initial documentation
flashmark Aug 27, 2025
cc31b10
P183 Add documentation (preliminary)
flashmark Aug 28, 2025
53ec930
P183 Minor rework
flashmark Aug 31, 2025
a715544
Baseline before refacoring
flashmark Sep 6, 2025
5f8868a
Merge branch 'letscontrolit:mega' into P183_Modbus_registers
flashmark Sep 15, 2025
aa34ac3
P183 Uncrustify
flashmark Sep 15, 2025
02f46b3
Merge branch 'P183_Modbus_registers' of https://github.com/flashmark/…
flashmark Sep 15, 2025
11cf754
Starting complete make over
flashmark Sep 30, 2025
e7aabda
P183 Rework phase 1
flashmark Oct 6, 2025
1ee2b35
Merge branch 'mega' into P183_Modbus_registers
flashmark Oct 6, 2025
18e8b86
P183 Small refactoring
flashmark Oct 6, 2025
bd7661e
P183 Snapshot refactoring
flashmark Oct 12, 2025
8c66411
P183 Start cleaning up
flashmark Oct 15, 2025
fc27c88
Merge branch 'letscontrolit:mega' into P183_Modbus_registers
flashmark Oct 15, 2025
8f5e5f9
Merge branch 'letscontrolit:mega' into P183_Modbus_registers
flashmark Oct 17, 2025
a4dfca1
P183 Pending rework, not final
flashmark Oct 17, 2025
7795cc1
P183 Several fixes
flashmark Oct 18, 2025
6e201fb
P183 Update logging
flashmark Oct 23, 2025
280e8bf
P183: Init link fix & minor updates
flashmark Oct 23, 2025
4515c8c
P183: initial UML design documentation
flashmark Oct 23, 2025
21b427e
P183: Minor fixes and start of design documentation
flashmark Oct 26, 2025
8d5ce4d
Merge branch 'letscontrolit:mega' into P183_Modbus_registers
flashmark Oct 27, 2025
5ba2f9f
Merge branch 'mega' into P183_Modbus_registers
flashmark Dec 11, 2025
b432092
Merge branch 'letscontrolit:mega' into P183_Modbus_registers
flashmark Dec 13, 2025
c182cea
P183 Added documentation
flashmark Dec 13, 2025
67134da
Merge branch 'mega' into P183_Modbus_registers
TD-er Feb 10, 2026
3495afe
Merge branch 'mega' into P183_Modbus_registers
TD-er Feb 10, 2026
abe1a67
Merge branch 'mega' into P183_Modbus_registers
TD-er Feb 12, 2026
e93b4c3
Merge branch 'mega' into P183_Modbus_registers
TD-er Feb 13, 2026
ef31d27
[P183] Make new generic Modbus RTU PR build again
TD-er Feb 13, 2026
c322798
Merge branch 'letscontrolit:mega' into P183_Modbus_registers
flashmark Feb 16, 2026
da1e31d
Merge branch 'letscontrolit:mega' into P183_Modbus_registers
flashmark Mar 5, 2026
0098e3c
Secure work in progress, don't merge to master
flashmark Mar 20, 2026
7e01a41
Merge branch 'mega' into P183_Modbus_registers
flashmark Mar 20, 2026
934b595
Merge branch 'letscontrolit:mega' into P183_Modbus_registers
flashmark Apr 7, 2026
610c3e9
P183 snapshot
flashmark Apr 7, 2026
33e4439
Merge branch 'P183_Modbus_registers' of https://github.com/flashmark/…
flashmark Apr 7, 2026
6b774aa
P183 modbus interfaces support
flashmark Apr 16, 2026
7efc42d
Merge branch 'letscontrolit:mega' into P183_Modbus_registers
flashmark Apr 16, 2026
68bba7f
Merge branch 'letscontrolit:mega' into P183_Modbus_registers
flashmark Apr 23, 2026
2e2ab34
Save state some init problems left
flashmark Apr 23, 2026
bb28e71
Merge branch 'P183_Modbus_registers' of https://github.com/flashmark/…
flashmark Apr 23, 2026
470d3c2
securing state, not ready yet
flashmark Apr 27, 2026
884deb3
Merge branch 'letscontrolit:mega' into P183_Modbus_registers
flashmark May 1, 2026
c66aee9
Functionality ready, to be debugged and cleaned up
flashmark May 2, 2026
79ffeb4
Merge branch 'P183_Modbus_registers' of https://github.com/flashmark/…
flashmark May 2, 2026
afa1b6a
Small review comment updates
flashmark May 3, 2026
0f9c1dd
Rework & fixed initialization
flashmark May 3, 2026
d254ae4
P183 documentation update
flashmark May 5, 2026
9111e0d
Merge branch 'letscontrolit:mega' into P183_Modbus_registers
flashmark May 9, 2026
30d2b12
P183 Modbus cleanup, not ready yet
flashmark May 9, 2026
115cb39
Merge branch 'letscontrolit:mega' into P183_Modbus_registers
flashmark May 16, 2026
6f2cb43
P183 Modbus add cache region
flashmark May 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion docs/source/Interfaces/Interfaces.rst
Original file line number Diff line number Diff line change
Expand Up @@ -205,5 +205,16 @@ NB: When selecting the *User-defined* option, **all 3 GPIO pins should be set**,
Modbus
------

TODO Modbus configuration and documentation to be added.
When using devices that use the Modbus RTU protocol the Modbus interface can be configured here. The Modbus RTU devices are connected via a RS485 serial interface. Multiple devices can be connected to the same serial interface, and are distinguished by their Modbus address. Note that a serial to RS485 converter is required to connect Modbus RTU devices to the ESP board.

.. image:: Modbus_Interface.png

Main configuration item is the selection of the serial interface to use for Modbus. The available options depend on the ESP board used. For details about the available serial interfaces, see serial helper page. The option "Not set" means that Modbus link is not used. When a serial interface is selected, it will be initialized and the Modbus RTU devices can be connected to it.

Selection of the RX and TX pins is required.

The Modbus RTU devices are connected to the selected serial interface via a RS485 converter. The converter has a DE (Driver Enable) pin that can be controlled by the ESP board to switch between sending and receiving data. The DE pin can be configured here. If the converter has an automatic DE function, this can be set to "-None-".

The Baud rate for the Modbus RTU communication shall be set. The default value is 9600 baud, but it can be set to other values as required by the connected devices.

Collision Detection is a feature that can be used when the serial port hardware supports it, otherwise it is ignored.
Binary file added docs/source/Interfaces/Modbus_Interface.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
123 changes: 123 additions & 0 deletions docs/source/Plugin/P183.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
.. include:: ../Plugin/_plugin_substitutions_p18x.repl
.. _P183_page:

|P183_typename|
==================================================

|P183_shortinfo|

Plugin details
--------------

Type: |P183_type|

Port Type: |P183_porttype|

Name: |P183_name|

Status: |P183_status|

GitHub: |P183_github|_

Maintainer: |P183_maintainer|

Used libraries: |P183_usedlibraries|

Introduction
------------

Modbus is a serial communication protocol commonly used for connecting industrial electronic devices.
It is a master/slave (or client/server) protocol, which means that one device (the master) initiates communication and the other devices (the slaves) respond.
Modbus RTU (Remote Terminal Unit) is a variant of the Modbus protocol that uses binary representation of data and is typically used over serial communication lines such as RS-485 or RS-232.
This plugin supports Modbus RTU communication over a serial interface. To support RS-485 communication, an external RS-485 to TTL converter is required.

Modbus RTU uses a register-based addressing scheme, where each device has a unique address and data is stored in registers.
Registers can be of different types, such as holding registers, input registers, coils, and discrete inputs.
This plugin supports reading holding registers (function code 03) and writing to holding registers (function code 06).

The plugin can be configured to read up to 4 holding registers from a Modbus slave device and store the values in user variables.
It can also write values to a specified holding register on the Modbus slave device.

The plugin does not support any hardware specific features. Instead it is a generic plugin that can be used with any Modbus RTU compatible device. You have to lookup the correct register addresses and data formats in the documentation of the Modbus device you want to communicate with.

Supported hardware
------------------

|P183_usedby|

Configuration
-------------

* **Name**: Required by ESPEasy, must be unique among the list of available devices/tasks.

* **Enabled**: The device can be disabled or enabled. When not enabled the device should not use any resources.

Sensor
^^^^^^

.. image:: P183_device_settings.png

The available Modbus protocol settings here depend on the build used.

* **Modbus Link**: The Modbs link teh device is connected to. The link must be configured in the Interafces page.

* **Modbus Device Address**: The Modbus slave device ID to communicate with (1..247).

Output Configuration
^^^^^^^^^^^^^^^^^^^^

.. image:: P183_output_config.png

* **Number of registers to read**: The number of holding registers the plugin will read (1..4).

* **Holding register for valueX**: The Modbus holding register address to read for valueX (X=1..4).

The holding register address is a 16-bit value (0..65535). This is the register address as specified with the Modbus device and is used directly in the Modbus read holding registers (function code 03). The plugin will read the number of values specified, starting with value1

Commands available
^^^^^^^^^^^^^^^^^^

.. include:: P183_commands.repl

.. Events
.. ~~~~~~

.. .. include:: P183_events.repl

Get Config Values
^^^^^^^^^^^^^^^^^

Get Config Values retrieves values or settings from the sensor or plugin, and can be used in Rules, Display plugins, Formula's etc. The square brackets **are** part of the variable. Replace ``<taskname>`` by the **Name** of the task.

.. include:: P183_config_values.repl

Plugin state
------------

This plugin uses a new Modbus facility that allows multiple Modbus devices to share the same Modbus link.
The current implementataion of the Modbus facility requires that the plugin specifies the serial link parameters.
When a Modbus link is shared between multiple plugins, the last plugin that connects to the Modbus link will determine the serial link parameters.
This may lead to unexpected behavior if multiple plugins are using different serial link parameters on the same serial port. For a deterministic behavior, make sure that all plugins using the same serial port use the same serial link parameters.

In the future the Modbus facility may be extended to configure the Modbus links as separate entities. As a result the plugins would only need to specify which Modbus link to use, instead of the serial link parameters.
This change will be backward incompatible with the current implementation. Therefore the plugin status is set to 'Experimental'.

Change log
----------

.. versionchanged:: 2.0
...

|added|
Major overhaul for 2.0 release.

.. versionadded:: 1.0
...

|added|
Initial release version.





28 changes: 28 additions & 0 deletions docs/source/Plugin/P183_commands.repl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.. csv-table::
:header: "Command", "Extra information"
:widths: 20, 30

"
``modbus,write,<address>,<value>``

","
Write value ``<value>`` into the holding register ``<address>``.
"
"
``modbus,read,<address>``

","
Read the value from the holding register ``<address>``. Note that the value is read from the Modbus device but it will not be returned as part of the command. The value is printed in the logging.
"
"
``modbus,scan``

","
Scans the modbus address range for responding units. It will do a read function for holding register 1. Note this will take some time. Ouput is in the logging.
"
"
``modbus,dump,<start>,<end>``

","
Dumps the holding registers in the address range ``<start>`` until ``<end>``.
"
10 changes: 10 additions & 0 deletions docs/source/Plugin/P183_config_values.repl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. csv-table::
:header: "Config value", "Information"
:widths: 20, 30

"
| ``[<taskname>#register,<reg>]``
","
| Returns the value of holding register ``<reg>`` of the device. The value is directly read from the Modbus device. The holding register number ``<reg>`` can be any valid register in the device.
"

Binary file added docs/source/Plugin/P183_device_settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/Plugin/P183_output_config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/source/Plugin/_Plugin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ There are different released versions of ESP Easy:
":ref:`P177_page`","|P177_status|","|P177_status_lb|","P177"
":ref:`P178_page`","|P178_status|","|P178_status_lb|","P178"
":ref:`P180_page`","|P180_status|","|P180_status_lb|","P180"

":ref:`P183_page`","[P183_status]","[P183_status_lb]","P183"

.. include:: <isonum.txt>
.. include:: _plugin_sets_overview.repl
Expand Down
2 changes: 1 addition & 1 deletion docs/source/Plugin/_plugin_categories.repl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. |Plugin_Analog_input| replace:: :ref:`P002_page`, :ref:`P007_page`, :ref:`P025_page`, :ref:`P060_page`, :ref:`P097_page`
.. |Plugin_Acceleration| replace:: :ref:`P120_page`, :ref:`P125_page`
.. |Plugin_Color| replace:: :ref:`P112_page`
.. |Plugin_Communication| replace:: :ref:`P016_page`, :ref:`P020_page`, :ref:`P035_page`, :ref:`P044_page`, :ref:`P054_page`, :ref:`P071_page`, :ref:`P087_page`, :ref:`P089_page`, :ref:`P094_page`, :ref:`P101_page`, :ref:`P118_page`, :ref:`P176_page`
.. |Plugin_Communication| replace:: :ref:`P016_page`, :ref:`P020_page`, :ref:`P035_page`, :ref:`P044_page`, :ref:`P054_page`, :ref:`P071_page`, :ref:`P087_page`, :ref:`P089_page`, :ref:`P094_page`, :ref:`P101_page`, :ref:`P118_page`, :ref:`P176_page`, :ref:`P183_page`
.. |Plugin_Display| replace:: :ref:`P012_page`, :ref:`P023_page`, :ref:`P036_page`, :ref:`P057_page`, :ref:`P073_page`, :ref:`P075_page`, :ref:`P095_page`, :ref:`P104_page`, :ref:`P116_page`, :ref:`P131_page`, :ref:`P148_page`
.. |Plugin_Distance| replace:: :ref:`P013_page`, :ref:`P110_page`, :ref:`P113_page`, :ref:`P134_page`
.. |Plugin_Dust| replace:: :ref:`P018_page`, :ref:`P053_page`, :ref:`P056_page`, :ref:`P144_page`, :ref:`P175_page`
Expand Down
Loading