I am trying to setup the StromPi3 (rev 1.1, firmware 1.72c) under Home Assistant OS (*).I have enabled PL011 UART as primary serial and switched miniUART to secondary via config.txt:
I have made sure that the serial console is disabled via cmdline.txt (console=serial0,115200 is not present):
I have started to fiddle with StromPi in HA OS itself (i.e. not in any docker container) as root.The serial port device in the OS is present (/dev/serial0 -> ttyAMA0).When I setup the port via
stty -F /dev/serial0 38400 -a
speed 38400 baud; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O;
min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho -extproc
(Which is to a letter the same configuration as under Raspbian OS where the communication works.)
When I try to write to the port via
echo -ne 'status-rpi\x0D' > /dev/serial0
and listen via
cat < /dev/serial0
nothing happens, except for breaking the whole StromPi which then needs to be flashed.This procedure however works under Raspbian OS.
Can you please advise what could be wrong?I understand I can switch from HA OS to Raspbian OS, but this is the last resort.I believe the serial communication should be OS-agnostic, besides Home Assistant is known to communicate with serial peripherals without any troubles.
Thanks a lotRoman
I was too quick. I came to a conclusion that HA OS reserves the serial port for itself and trying to interfer leads to a collision.
So instead I tried to make HA to communicate with StromPi. This is what you can try in configuration.yaml:
- platform: serial
name: StromPi Status
- platform: command_line
name: StromPi Handle
command: echo -e -n 'status-rpi\x0D' > /dev/serial0
Of course it's not useful this way and needs further programming, but it's a proof o working communication.
thank you for sharing your detailed explanation.
We are glad that you could find a way to communicate with the StromPi.
Cookie- und Datenschutzhinweise
Schützt vor Cross-Site-Request-Forgery Angriffen.
Speichert die aktuelle PHP-Session.
Diese Webseite verwendet Cookies, um bestimmte Funktionen zu ermöglichen und das Angebot zu verbessern.