Logic Machine Forum
Bluetooth HRM - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Bluetooth HRM (/showthread.php?tid=1220)



Bluetooth HRM - Morpheus09 - 06.02.2018

Hi!!

I am trying to read a value from a custom made BLE device, the device was created using the heart rate protocol,
I used the example of LM as Bluetooth 4.0 gateway http://openrb.com/lm-as-bluetooth-4-0-gateway/
but I cant make it work...


Also found some information about gatttool, but with no success...

and using..
Code:
require('ble')
ble.up()
sock = ble.sock()
res,err=ble.settimeout(sock, 45)
res, err  = ble.connect(sock, "XX:XX:XX:...",true)
log(res,err)
ble.close(sock)


I get "connect failed" error

the device is working, and it connects NRF Connect on my phone...

If anyone have any idea how to make it work?

Thank you!


RE: Bluetooth HRM - admin - 06.02.2018

Try calling connect without third argument or set it to false.


RE: Bluetooth HRM - Morpheus09 - 06.02.2018

(06.02.2018, 15:35)admin Wrote: Try calling connect without third argument or set it to false.

Same thing.. connection failed..

I am trying with a BLE simulator app on my phone to emulate a HRM... and nothing...


------------------------------EDIT------------------------------------------------------------------------------------------------------------------------------
With the res, err  = ble.connect(sock, "XX:XX:XX:...",false)
it connected... but i dont know how to grab the value from the HRM..


------------------------------EDIT2------------------------------------------------------------------------------------------------------------------------------


I was reading the wrong address.....

Now it works... Thanks for the help!!  Big Grin Big Grin