I hooked up a Raspberry Pi to my Opentherm Gateway today and (after
struggling to get the USB->serial converter to work), it all works just as advertised:
- pi@raspberrypi ~ $ uname -a
Linux raspberrypi 3.2.27+ #250 PREEMPT Thu Oct 18 19:03:02 BST 2012 armv6l GNU/Linux
pi@raspberrypi ~ $ ls -l /dev/ttyUSB0
crw-rw---T 1 root dialout 188, 0 Feb 7 12:39 /dev/ttyUSB0
pi@raspberrypi ~ $ stty -F /dev/ttyUSB0 9600 -icrnl -echo clocal
pi@raspberrypi ~ $ echo -e 'PR=A\r' > /dev/ttyUSB0
pi@raspberrypi ~ $ head -2 /dev/ttyUSB0
OpenTherm Gateway 4.0a4
SE
The SE appears to be caused by the newline sent by echo (although it should be ignored by the gateway). The way to get rid of that is by telling echo not to send a newline:
- pi@raspberrypi ~ $ echo -e 'PR=A\r\c' > /dev/ttyUSB0
pi@raspberrypi ~ $ head -2 /dev/ttyUSB0
OpenTherm Gateway 4.0a4
T80190000
For the record, my initial suggestion to add the -onlret option to stty also works perfectly fine:
- pi@raspberrypi ~ $ stty -F /dev/ttyUSB0 9600 -icrnl -echo clocal -onlret
pi@raspberrypi ~ $ echo 'PR=A' > /dev/ttyUSB0
pi@raspberrypi ~ $ head -2 /dev/ttyUSB0
OpenTherm Gateway 4.0a4
T10010A00