So, after adding an index to the output it’s clear that the board does not reset when I access it with picocom after it was working in HASS.
What I did after:
- HASS was properly reading data, logs show:
2020-03-17 18:09:23 DEBUG (MainThread) [homeassistant.components.serial.sensor] Received: {"hol_temperatura":21.3,"hol_umiditate":38.9,"pod_temperatura":15.7,"pod_umiditate":43,"dressing_temperatura":15.3,"dressing_umiditate":39.6,"afara_temperatura":15.8,"afara_umiditate":44.4,"run_index":95}
2020-03-17 18:09:28 DEBUG (MainThread) [homeassistant.components.serial.sensor] Received: {"hol_temperatura":21.3,"hol_umiditate":38.9,"pod_temperatura":15.6,"pod_umiditate":42.9,"dressing_temperatura":15.3,"dressing_umiditate":39.6,"afara_temperatura":15.8,"afara_umiditate":44.4,"run_index":96}
- removed the USB device, no change in the HASS logs, dmesg shows:
[ 1411.614489] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0
[ 1411.614513] ch341 1-4:1.0: device disconnected
- reattached the device, no change in the HASS logs, dmesg shows:
[ 1468.479785] usb 1-4: new full-speed USB device number 7 using xhci_hcd
[ 1468.743865] usb 1-4: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.54
[ 1468.743867] usb 1-4: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 1468.743869] usb 1-4: Product: USB2.0-Serial
[ 1468.747180] ch341 1-4:1.0: ch341-uart converter detected
[ 1468.749291] usb 1-4: ch341-uart converter now attached to ttyUSB0
- I waited a few minutes, no changes in HASS. I started then picocom and now the run_index was reset to 0:
picocom -b 9600 /dev/ttyUSB0
picocom v3.1
port is : /dev/ttyUSB0
flowcontrol : none
baudrate is : 9600
parity is : none
databits are : 8
stopbits are : 1
escape is : C-a
local echo is : no
noinit is : no
noreset is : no
hangup is : no
nolock is : no
send_cmd is : sz -vv
receive_cmd is : rz -vv -E
imap is :
omap is :
emap is : crcrlf,delbs,
logfile is : none
initstring : none
exit_after is : not set
exit is : no
Type [C-a] [C-h] to see available commands
Terminal ready
{"hol_temperatura":21.3,"hol_umiditate":39.2,"pod_temperatura":15.6,"pod_umiditate":43.1,"dressing_temperatura":15.3,"dressing_umiditate":39.3,"afara_temperatura":15.8,"afara_umiditate":44.7,"run_index":0}
{"hol_temperatura":21.3,"hol_umiditate":39.2,"pod_temperatura":15.7,"pod_umiditate":43.1,"dressing_temperatura":15.3,"dressing_umiditate":39.3,"afara_temperatura":15.7,"afara_umiditate":44.7,"run_index":1}
{"hol_temperatura":21.3,"hol_umiditate":39.2,"pod_temperatura":15.7,"pod_umiditate":43.1,"dressing_temperatura":15.3,"dressing_umiditate":39.3,"afara_temperatura":15.7,"afara_umiditate":44.7,"run_index":2}
{"hol_temperatura":21.2,"hol_umiditate":39.2,"pod_temperatura":15.6,"pod_umiditate":43,"dressing_temperatura":15.3,"dressing_umiditate":39.3,"afara_temperatura":15.7,"afara_umiditate":44.7,"run_index":3}
If I restart HASS while picocom is connected to the port, HASS will not be able to read data - no mention of issues in its logs though.
I still don’t get why there are not more logs from this serial integration to let you know what’s it doing (like connecting to, disconnecting from, error, etc) - have I not enabled the correct logging component?