Hello i need your support for manage TWO serial comunication with Hassio x RPI 4 connected to USBs ports
One is by modbus that running correctly this is the configuration
modbus:
name: plc
type: serial
method: rtu
port: /dev/ttyUSB0
baudrate: 9600
stopbits: 1
bytesize: 8
parity: N
The second i need send some strings (ande receive) to serial port other USB with
shell command, for this i use serial platform.
sensor:
- platform: serial
serial_port: /dev/ttyUSB1
switch:
- platform: command_line
switches:
modem1_at:
command_on: echo -e -n "ATE1\r" > /dev/ttyUSB1
command_off: echo -e -n "AT+CMGF=1\r" > /dev/ttyUSB1
For both i use a suitable adapter usb -> RS232.
If use one system only with usb0 it all ok, but when i try both with Modbus USB0 and Shell command with USB1 the second fail.
I made some tests and i was suprise that if i move the adapter from fisical port
USB0 to USB1 (but the yaml file doesn’t touch - port: /dev/ttyUSB0) the modbus running in correct way, it seem that USBx is not relative to fiscal port Could be ?
So Can you suggest to me in what way i can manage two serial comunication ? (USB port or alternative GPIO Tx & RX).
Thanks in advance, and a great new year.
Paolo