@@ -241,6 +241,8 @@ based on TCP togehter with the latest provided
241241All described functions require a successful setup of a Host communicating
242242to/with a Client device which is providing the data and accepting the new data.
243243
244+ #### TCP
245+
244246``` python
245247from umodbus.tcp import TCP as ModbusTCPMaster
246248
@@ -254,6 +256,31 @@ host = ModbusTCPMaster(
254256 timeout = 5 ) # optional, default 5
255257```
256258
259+ #### RTU
260+
261+ ``` python
262+ from umodbus.serial import Serial as ModbusRTUMaster
263+
264+ slave_addr = 10 # bus address of client
265+
266+ # check MicroPython UART documentation
267+ # https://docs.micropython.org/en/latest/library/machine.UART.html
268+ # for Device/Port specific setup
269+ # RP2 needs "rtu_pins = (Pin(4), Pin(5))" whereas ESP32 can use any pin
270+ # the following example is for an ESP32
271+ rtu_pins = (25 , 26 ) # (TX, RX)
272+ host = ModbusRTUMaster(
273+ addr = 1 , # bus address of this Host/Master, usually '1'
274+ baudrate = 9600 , # optional, default 9600
275+ pins = rtu_pins, # given as tuple (TX, RX)
276+ # data_bits=8, # optional, default 8
277+ # stop_bits=1, # optional, default 1
278+ # parity=None, # optional, default None
279+ # ctrl_pin=12, # optional, control DE/RE
280+ # uart_id=1 # optional, see port specific documentation
281+ )
282+ ```
283+
257284#### Coils
258285
259286Coils represent binary states, which can be get as and set to either ` 0 ` (off)
0 commit comments