Page 1 of 1
Detect presence of RaZberry
Posted: 05 Mar 2015 23:02
by skiv71
Hi,
I'm looking to detect the presence of the RaZberry GPIO board.
I've found out that the port, ttyAMA0 is always present in Raspbian, regardless of any device that might be connected.
With that in mind, is there any way I can probe the serial to discover if RaZ is actually present?
Thanks
Neil
Re: Detect presence of RaZberry
Posted: 06 Mar 2015 02:04
by pofs
Sure it is

Try to initialize the library (or its JS binding) on that port, if discover fails then it is not a valid Z-Wave device.
Re: Detect presence of RaZberry
Posted: 06 Mar 2015 23:41
by skiv71
I've been in touch with ps @ zwave and he's mentioned the get-tty but I really need to do this by sending a hex string and looking for a response. Not sure what to send though and what to expect
Re: Detect presence of RaZberry
Posted: 07 Mar 2015 15:37
by skiv71
I sussed it myself...
#!/bin/bash
# initialise
port=/dev/ttyAMA0
# set port
stty -F $port cs8 raw 115200
# test port
echo -ne "\x01\x03\x00\x07\xFB" >$port
a=($(xxd -p -l 12 -c 2 <$port))
b=$(printf %.d 0x${a[3]})
# evaluate
if [ "$b" = "327" ]; then
echo z-wave.me
fi
Re: Detect presence of RaZberry
Posted: 08 Mar 2015 22:00
by pofs
This may actually fail in case there's a number of devices in your network reporting to controller. So report from device will be read instead of actual response (which will come later).
So it basically works, but is not 100% reliable.