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
Detect presence of RaZberry
Detect presence of RaZberry
Using BMSLink https://linode.bmslink.co.uk with z-way-server. http://linode.bmslink.co.uk:4567
Re: Detect presence of RaZberry
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
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
Using BMSLink https://linode.bmslink.co.uk with z-way-server. http://linode.bmslink.co.uk:4567
Re: Detect presence of RaZberry
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
#!/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
Using BMSLink https://linode.bmslink.co.uk with z-way-server. http://linode.bmslink.co.uk:4567
Re: Detect presence of RaZberry
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.
So it basically works, but is not 100% reliable.