Hello,
I have a Intel Nuc running HA, connected with my home network and a USB serial interface connected to my Unitronics OPLC M91.
When I test the MODBUS interface on the same usb converter in Windows, I can communicate and get data update…
If I configure it in HA, It is not working:
/config cat home-assistant.log
2022-11-07 20:47:22.206 INFO (Syncworker_2) [homeassistant.components.modbus.modbus] modbus M91 communication open
2022-11-07 20:47:23.697 DEBUG (Syncworker_3) [pymodbus.client.sync] New Transaction state 'SENDING'
2022-11-07 20:47:26.715 ERROR (SyncWorker_3) [homeassistant.components.modbus.modbus] Pymodbus: M91: Modbus Error: [Input/Output] Modbus Error: [Invalid Me
ssage] No response received, expected at least 2 bytes (0 received)
2022-11-07 20:47:42.493 DEBUG (Syncworker_4) [pymodbus.client.sync] New Transaction state 'SENDING'
2022-11-07 20:47:45.503 DEBUG (SyncWorker_4) [homeassistant.components.modbus.modbus] Pymodbus: M91: Modbus Error: [Input/Output] No Response received from
the remote unit/Unable to decode response
2022-11-07 20:48:02.493 DEBUG (Syncworker_3) [pymodbus.client.sync] New Transaction state 'SENDING'
2022-11-07 20:48:05.501 DEBUG (Syncworker 3) [homeassistant.components.modbus.modbus] Pymodbus: M91: Modbus Error: [Input/Output] No Response received from
the remote unit/Unable to decode response
2022-11-07 20:48:22.497 DEBUG (SyncWorker_4) [pymodbus.client.sync] New Transaction state 'SENDING'
2022-11-07 20:48:25.507 DEBUG (Syncworker_4) [homeassistant.components.modbus.modbus] Pymodbus: M91: Modbus Error: [Input/Output] No Response received from
the remote unit/Unable to decode response
2022-11-07 20:48:42.501 DEBUG (SyncWorker_0)
2022-11-07 20:48:45.587 DEBUG (Syncworker_0)
the remote unit/Unable to decode response
2022-11-07 20:49:02.495 ERROR (Syncworker_3) [pymodbus.client.sync] [Errno 2] could not open port /dev/ttyUSBB: [Errno 2] No such file or directory: '/dev/
ttyusie'
2822-11-07 20:49:02.585 DEBUG (Syncworker_3) [homeassistant.components.modbus.modbus] Pymodbus: M91: Modbus Error: [Connection] Failed to connect[ModbusSer
ialclient(rtu baud[38400])]
2022-11-07 20:49:22.498 ERROR (Syncworker_4) [pymodbus.client.sync] [Errno 2] could not open port /dev/ttyUSB0: [Errno 2] No such file or directory: '/dev/
ttvUSRO'
[pymodbus.client.sync] New Transaction state 'SENDING'
[homeassistant.components.modbus.modbus] Pymodbus: M91: Modbus Error: [Input/Output] No Response received from
The device is known in Linux
→
(config
/config setserial -G -v /dev/ttyUSB[01]
/dev/ttyUSB0 uart unknown port 0x0000 irq 0 baud_base 24000000 spd_normal
My Config is:
# modbus config
logger:
logs:
homeassistant.components.modbus: debug
pymodbus.client: debug
modbus:
- name: M91
type: serial
baudrate: 38400
bytesize: 8
method: rtu
parity: N
port: /dev/ttyUSB0
stopbits: 1
binary_sensors:
- name: "test"
address: 4000
scan_interval: 20
device_class: moving
input_type: discrete_input
If I unplug the USB from the Nuc and connect it to my windows PC, I can communicate with the OPLC with QMODmaster.
Settings are the same: 38400,n,8,1 within the PLC software
I have no idea why the communication does not start in HA.
Restarts have no effect.
Any suggestions?
Thanks in advance
Walter