Problem with bluetooth on android 2.1 (samsung spica i5700) where pairing works but connection does
Posted
by user319634
on Stack Overflow
See other posts from Stack Overflow
or by user319634
Published on 2010-04-18T10:41:11Z
Indexed on
2010/04/18
10:43 UTC
Read the original article
Hit count: 4243
I have a Samsung Spica i5700 which I already have updated to Android 2.1. I am using the phone with an application called Run.GPS (http://www.rungps.net). This application logs data such as GPS position, route, speed, bearing etc. It can also log heartrate provided the user has a Zephyr HxM bluetooth heart rate monitor ("HxM"), which I do have.
I can pair the HxM to the phone through the standard bluetooth utility. I'm prompted for the PIN, which I enter and the device is shown as 'Paired but not connected'.
In the Run.GPS application itself, I click on 'Connect Heartrate Monitor'. This times out after about 30 seconds and the error message is 'Could not connect to heartrate monitor. Please try other settings'.
I used a friend's HTC Windows Mobile as a control device to see if the HxM works there. It does. The Run.GPS application automatically sets the baud rate (initially to 9600 IIRC, though the connection also worked with higher baud rates) and it is possible to choose between various COM ports as well as a .Net COM port.
I did some testing on my Spica Android, to try to find out why the bluetooth connection doesn't work. Below are some log files that I connected over adb when I clicked on 'Connect to Heartrate Monitor' in the Run.GPS application.
I would be interested in any tips (including if I'm posting to the wrong forum here ;-)) - whether or not it's possible to experiment with the baud rate in Android etc. I still don't know if the problem is with the Run.GPS application (I've posted already on the development forum there) or with Android 2.1. I checked out another application - Endomondo - which is also a sport tracking application which supports heartrate monitor only with the HxM. There, what looked like exactly the same error occurred - I clicked on 'Connect Zephyr HxM'. For a few seconds I was shown the 'Connecting...' status, but then it timed out into 'Not Connected'. I'm thus tending towards looking at Android for the problem.
Here's the output of adb logcat while trying to connect
./adb logcat | grep Run.GPS
D/WYNEX> (11551): Excute :: Run.GPS Trainer UV, (null)
E/Run.GPS (11997): Cannot connect to BT device
E/Run.GPS (11997): java.io.IOException: Service discovery failed
E/Run.GPS (11997): at android.bluetooth.BluetoothSocket$SdpHelper.doSdp(BluetoothSocket.java:374)
E/Run.GPS (11997): at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:184)
E/Run.GPS (11997): at ju.a(Unknown Source)
E/Run.GPS (11997): at qk.j(Unknown Source)
E/Run.GPS (11997): at fs.c(Unknown Source)
E/Run.GPS (11997): at le.a(Unknown Source)
E/Run.GPS (11997): at s.b(Unknown Source)
E/Run.GPS (11997): at pb.a(Unknown Source)
E/Run.GPS (11997): at as.a(Unknown Source)
E/Run.GPS (11997): at am.b(Unknown Source)
E/Run.GPS (11997): at gf.onTouchEvent(Unknown Source)
E/Run.GPS (11997): at android.view.View.dispatchTouchEvent(View.java:3709)
E/Run.GPS (11997): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
E/Run.GPS (11997): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
E/Run.GPS (11997): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1665)
E/Run.GPS (11997): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
E/Run.GPS (11997): at android.app.Activity.dispatchTouchEvent(Activity.java:2061)
E/Run.GPS (11997): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1649)
E/Run.GPS (11997): at android.view.ViewRoot.handleMessage(ViewRoot.java:1694)
E/Run.GPS (11997): at android.os.Handler.dispatchMessage(Handler.java:99)
E/Run.GPS (11997): at android.os.Looper.loop(Looper.java:123)
E/Run.GPS (11997): at android.app.ActivityThread.main(ActivityThread.java:4363)
E/Run.GPS (11997): at java.lang.reflect.Method.invokeNative(Native Method)
E/Run.GPS (11997): at java.lang.reflect.Method.invoke(Method.java:521)
E/Run.GPS (11997): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
E/Run.GPS (11997): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
E/Run.GPS (11997): at dalvik.system.NativeStart.main(Native Method)
E/Run.GPS (11997): Cannot connect to BT device
E/Run.GPS (11997): java.io.IOException: Service discovery failed
Here's the output of dmesg while trying to connect the heartrate monitor
<4>[74726.239833] select 11691 (.serviceModeApp), adj 15, size 3205, to kill
<4>[74726.240741] select 11739 (com.wssnps), adj 15, size 3207, to kill
<4>[74726.246870] select 11750 (id.partnersetup), adj 15, size 3219, to kill
<4>[74726.253390] select 11857 (p.bluetoothicon), adj 15, size 3299, to kill
<4>[74726.259879] select 13131 (ndroid.settings), adj 15, size 4586, to kill
<4>[74726.266372] send sigkill to 13131 (ndroid.settings), adj 15, size 4586
<7>[74733.945097] [BT] GPIO_BT_WAKE = 1
<7>[74733.945121] [BT] wake_lock(bt_wake_lock)
<7>[74733.951799] [BT] GPIO_BT_HOST_WAKE = 1
<7>[74733.951822] [BT] wake_lock timeout = 5 sec
<7>[74735.890196] [BT] GPIO_BT_HOST_WAKE = 0
<7>[74736.150987] [BT] GPIO_BT_HOST_WAKE = 1
<7>[74736.151009] [BT] wake_lock timeout = 5 sec
<7>[74737.490185] [BT] GPIO_BT_HOST_WAKE = 0
<7>[74740.073913] [BT] GPIO_BT_HOST_WAKE = 1
<7>[74740.073948] [BT] wake_lock timeout = 5 sec
<7>[74741.315336] [BT] GPIO_BT_HOST_WAKE = 0
<7>[74743.249747] [BT] GPIO_BT_HOST_WAKE = 1
<7>[74743.249768] [BT] wake_lock timeout = 5 sec
<7>[74744.865099] [BT] GPIO_BT_HOST_WAKE = 0
<7>[74745.154487] [BT] GPIO_BT_HOST_WAKE = 1
<7>[74745.154509] [BT] wake_lock timeout = 5 sec
<7>[74748.852534] [BT] GPIO_BT_HOST_WAKE = 0
<7>[74749.156256] [BT] GPIO_BT_HOST_WAKE = 1
<7>[74749.156278] [BT] wake_lock timeout = 5 sec
<7>[74750.490018] [BT] GPIO_BT_HOST_WAKE = 0
<4>[74754.230424] select 11691 (.serviceModeApp), adj 15, size 3191, to kill
<4>[74754.231326] select 11739 (com.wssnps), adj 15, size 3193, to kill
<4>[74754.237473] select 11750 (id.partnersetup), adj 15, size 3205, to kill
<4>[74754.243950] select 11857 (p.bluetoothicon), adj 15, size 3283, to kill
<4>[74754.250452] select 13140 (com.svox.pico), adj 15, size 3465, to kill
<4>[74754.256787] send sigkill to 13140 (com.svox.pico), adj 15, size 3465
© Stack Overflow or respective owner