December 23, 2018 2:20 PM CET
I would like to read out the WeDo 1.0 motion detector from linux on raspberry pi (Raspbian GNU/Linux 9 (stretch)). I use the gattool for the bluetooth connection to sbrick plus.
connection and motor control is working, as well as reading out temperature and voltage.
But I am not able to read out the motion detector values. I measured voltage directly at the motion detector and read out that the voltage is changing on C1 pin at the lego connector depending on the distance.
Reading out the distance using the sbrick software is working fine.
Accourding to the documentation of the BLE sbrick protocol (https://social.sbrick.com/wiki/view/pageId/11) I did the following:
(1) Set up periodic voltage measurement on channel 00:gatttool -b device-ID -i hci1 --char-write-req --handle=0x001a --value=2c00
Using value 2d to read out the voltage measurement setup delivers no value
gatttool -b device-ID -i hci1 --char-write-req --handle=0x001a --value=2dgatttool -b device-ID -i hci1 --char-read --handle=0x001a
(2) Query ADC for voltage mesurement on channel 00
gatttool -b device-ID -i hci1 --char-write-req --handle=0x001a --value=0f00gatttool -b device-ID -i hci1 --char-read --handle=0x001a
This delivers value: 00 00
Value does not change no matter what distance on motion detector.
Any help/ suggestions would be highly appreciated.