Test serial communication in HA OS?

HA OS 5.14
Core 2021.3.4


Example shows: sudo minicom -D /dev/ttyACM0
When I run it in terminal then nothing works. sudo, apt-get, minicom, picocom
When I enabled in configuration.yaml:
  • platform: serial
    name: APC UPS CS 500
    serial_port: /dev/ttyUSB0
    The HA crashed. Had to disconnect serial cable and reboot couple of times.
    How to test serial communication?

hello
is your os under debian (ubuntu) or alpine?
supervised installation are under alpine.
debian-ubuntu: sudo apt-get …
alpine: apk …
that’s not the same linux.

try

apk update
apk add minicom

You need to show your logs.

Thanks. That worked.

After running:
apk update
apk add minicom
minicom -D /dev/ttyUSB0

The HA terminal stops. HA goes in to reboot and next time the command is not available.

Are you sure /dev/ttyUSB0 is the correct device?

  • name: ttyUSB0
    sysfs: >-
    /sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.2/1-1.2:1.0/ttyUSB0/tty/ttyUSB0
    dev_path: /dev/ttyUSB0
    subsystem: tty
    by_id: /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A9034F0V-if00-port0
    attributes:
    DEVLINKS: >-
    /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A9034F0V-if00-port0
    /dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0-port0
    DEVNAME: /dev/ttyUSB0
    DEVPATH: >-
    /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.2/1-1.2:1.0/ttyUSB0/tty/ttyUSB0
    ID_BUS: usb
    ID_MODEL: FT232R_USB_UART

If you unplug the physical device does /dev/ttyUSB0 disappear? You can get info from gmesg and lsusb

INFO (MainThread) [supervisor.hardware.monitor] Detecting HardwareAction.REMOVE serial hardware /dev/ttyUSB0 - /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A9034F0V-if00-port0
INFO (MainThread) [supervisor.hardware.monitor] Detecting HardwareAction.REMOVE usb hardware /dev/bus/usb/001/003

Bus 001 Device 006: ID 0403:6001
Disapeared.
And re appeared. When added.