I am building an ios app using the ionic framework (cordova based), and am struggling to find a heart rate device (Wahoo Tickr) using a number of different cordova plugins.
The plugin I have looked at most closely is cordova-plugin-ble-central. On device ready ($ionicPlatform.ready
) I check to see if bluetooth is enabled using ble.isEnabled()
. I get a successful result from this.
I then run ble.scan([],10,successCallback, errorCallback)
but no devices are found. In fact, neither the success or error callbacks seem to be made. Running through XCode on my iPhone5 (running ios8), I see the following logs
2015-03-12 16:01:27.171 health[2893:1320748] scan
2015-03-12 16:02:27.173 health[2893:1320748] stopScanTimer
..which I have found are logged out from the plugin's BLECentralPlugin.m file.
I have also tried using the BluetoothSerial plugin, and BluetoothLE, but neither appear to find my device.
My device is found correctly in other apps (RunKeeper, Wahoo Fitness).
I was wondering if anyone had encountered this issue, and if so if they had managed to solve it or not. I feel that I am missing a step, but as Bluetooth is enabled and the plugin methods are accessed successfully I am just unsure how to proceed.
Thanks
If your heart rate monitor is connected to a client, it won't be advertising so you won't see it while scanning.
Try using LightBlue on your phone. If LightBlue can see the heart rate monitor, your Cordova app running cordova-plugin-ble-central should be able to see it.
If LightBlue can't see the heart rate monitor, un-pair it from your phone and try again.