obtain mac with hcitool lescan
(here FD:19:AF:BA:73:C0)
gatttool -b FD:19:AF:BA:73:C0 -t random --char-desc
spot the following lines (see source)
handle = 0x003f, uuid = ef680406-9b35-4933-9b10-52ffa9740042
handle = 0x0040, uuid = 00002902-0000-1000-8000-00805f9b34fb
handle 0x40 is the CCCD to get notifications from the motion service (0406 raw data characteristic)
gatttool -b FD:19:AF:BA:73:C0 -t random --char-write-req --handle 0x40 --value 0100 --listen
by writing 0100 (msb first?) to the handle, we can subscribe to the values in hex
IFS=$'\n'
while true; do
timeout 10s gatttool -b FD:19:AF:BA:73:C0 -t random --char-write-req --handle 0x40 --value 0100 --listen | cut -d ' ' -f 6-11
echo $(date +'%F %T')
sleep 185s
done
sudo setcap cap_net_raw+eip $(eval readlink -f /opt/node-v8.16.2-linux-armv7l/bin/node)