evothings / cordova-ble

Bluetooth Low Energy plugin for Cordova
http://www.evothings.com/
Apache License 2.0
242 stars 103 forks source link

RSSI read not working in real app #143

Open sunnymtl opened 7 years ago

sunnymtl commented 7 years ago

I'm able to read the RSSI value continuously through Evothing app (on Samsung S4 Android 5.0) from a connected device. But after I built the custom app with exactly the same code, the RSSI value won't show. I have tried the online phonegap builder and the command line cordova builder, and another phone (G3 Android 6.0), got the same result: NO RSSI read. Could anybody help? should I add something when I build the real app?

Here is the method I used: evothings.ble.rssi( deviceHandle, function (rssi) { console.log("RSSI=" + rssi }, function (err) { console.log("ERROR=" + err });

Thanks a lot!

tozymandias commented 7 years ago

I am having the same problem. This method used to work (with an older version of the plugin) at some point, and then it stopped working. Please let me know if you find a solution. Thanks.

sunnymtl commented 7 years ago

@tozymandias Sure. I have submitted a ticket to ask the team, but no answer yet. No idea why it worked with evothing studio but not the app.

acutetech commented 7 years ago

There is a bug in ble.js for the RSSI call - at about line 980: exec(deviceOrHandle, success, fail, 'BLE', 'rssi', [objectHandle(deviceOrHandle)]); should be: exec(success, fail, 'BLE', 'rssi', [objectHandle(deviceOrHandle)]);

acutetech commented 7 years ago

I see this was also reported and the bug found in #135

ustincameron commented 7 years ago

Is this resolved?

sunnymtl commented 7 years ago

I have tried other ble plugins, finally use this: https://github.com/randdusing/cordova-plugin-bluetoothle, which doesn't have major problems.