Forums - It takes a long time to connect an bridge for Android APP

8 posts / 0 new
Last post
It takes a long time to connect an bridge for Android APP
MrFine001
Join Date: 13 Jun 16
Posts: 14
Posted: Thu, 2016-07-21 01:56

I user Android APP to connect CSRmesh node, When I touch the app it start connecting the node ,but it cost near 20 second  to connected successful, I don`t know why so long time ,and can you fixed it, or like iOS app, let user to select to connect.

 

Thanks!

  • Up0
  • Down0
Jesse Tsai Moderator
Join Date: 5 Apr 16
Posts: 12
Posted: Wed, 2016-08-03 00:40

Hi,

Currently the Android mesh library has its limitations for various Android model and version. You can implement the bridge scan yourself and call "connectBridge" API in MeshService to improve the performance.

Thanks.

  • Up0
  • Down0
ianmjames
Join Date: 10 Jun 16
Posts: 9
Posted: Fri, 2016-10-07 07:26

Hi,

I have been struggling to get Android Tablets to connect to Mesh Bridge nodes for a long time.

I have found that some tablets connect with in 10 seconds but most take between 30seconds and five minutes!

At what point should I call connectBridge()? as I would like to try this.

I have tried the following:

 

ASUS K013 this is the quckest and most reliable but is old now and is no longer available

ACER ICONIA ONE 7-B1-770 up to 2 minutes to connect

LENOVO TAB 7 up to 2 minutes to connect.

 

The ACER and LENOVO were puchased recently, October 16 and they run Android Version 5.0.1, the ASUS runs Android 5.0

This is a big issue for us as we need to find tablets that connect reliably and quickly to bridge nodes, one of our projects is in the lift industry and we need one table per Bluetooth 1010 board. 

We have found the Mesh is very reliable but the Bridge to Tablet really lets the system down.

 

 

  • Up0
  • Down0
aircable
Join Date: 8 Jun 16
Location: San Jose
Posts: 25
Posted: Mon, 2016-10-10 17:25

Our solution to improve the situation was to build a bridge that has faster advertisement interval. 
Do this:

//#define GATT_ADVERT_GROSS_INTERVAL (1245 * MILLISECOND)

#define GATT_ADVERT_GROSS_INTERVAL (620 * MILLISECOND)

 

This will help a lot. Using Web Bluetooth in the Chrome Browser we get a discover time or 0.5-2 seconds, depending. Connection to GATT service until successful takes about 1-2 seconds as well. You find the source code for our Web Bluetooth implementation on Github.

I'm sure if you play around with those parameters you get even better.

 

  • Up0
  • Down0
ianmjames
Join Date: 10 Jun 16
Posts: 9
Posted: Tue, 2016-10-11 10:11

I have tried:

#define GATT_ADVERT_GROSS_INTERVAL (620 * MILLISECOND)

but it made no difference.

This is what I see on the in Android Studio over the ADB

 

 

/com.csr.csrmeshdemo D/BluetoothAdapter: startLeScan(): null
/BluetoothAdapterService(577318368): getState() - mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@2c6c07d3
com.csr.csrmeshdemo D/BluetoothAdapter: 870688436: getState(). Returning 12
D/BluetoothAdapterService(577318368): getState() - mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@2c6c07d3
com.csr.csrmeshdemo D/BluetoothAdapter: 870688436: getState(). Returning 12
D/BluetoothAdapterService(577318368): getState() - mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@2c6c07d3
com.csr.csrmeshdemo D/BluetoothAdapter: 870688436: getState(). Returning 12
/com.csr.csrmeshdemo D/BluetoothLeScanner: onClientRegistered() - status=0 clientIf=1
com.csr.csrmeshdemo I/BluetoothLeScanner: startRegisteration: mLeScanClients={android.bluetooth.BluetoothAdapter$2@1c839276=android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper@37e98077}
? D/BluetoothAdapterService(577318368): getState() - mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@2c6c07d3
/? D/BluetoothAdapter: 421409624: getState(). Returning 12
? D/BluetoothAdapterService(577318368): getState() - mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@2c6c07d3
? D/BluetoothAdapter: 421409624: getState(). Returning 12
/com.csr.csrmeshdemo D/BluetoothAdapter: stopLeScan()
? D/BluetoothAdapterService(577318368): getState() - mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@2c6c07d3
com.csr.csrmeshdemo D/BluetoothAdapter: 870688436: getState(). Returning 12
? D/BluetoothAdapterService(577318368): getState() - mAdapterProperties: com.android.bluetooth.btservice.AdapterProperties@2c6c07d3
com.csr.csrmeshdemo D/BluetoothAdapter: 870688436: getState(). Returning 12
com.csr.csrmeshdemo I/BluetoothLeScanner: startRegisteration: mLeScanClients={android.bluetooth.BluetoothAdapter$2@1c839276=android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper@37e98077} ,callback=android.bluetooth.BluetoothAdapter$2@1c839276
com.csr.csrmeshdemo D/BluetoothAdapter: isEnabled
com.csr.csrmeshdemo D/BluetoothAdapter: isEnabled

Can someone at Qualcomm explain this message?

com.csr.csrmeshdemo D/BluetoothAdapter: 870688436: getState(). Returning 12

 

  • Up0
  • Down0
aircable
Join Date: 8 Jun 16
Location: San Jose
Posts: 25
Posted: Tue, 2016-10-11 11:54

I may have another idea, which is based on the fact that on earlier (maybe current) versions of Android Bluetooth lock up and you have to reset it.

The CSRmesh uses random MAC addresses for mesh packets. No only one, but a new random address for each packet sent. This is being cached by the bluedroid stack and put into the pairing file /data/misc/bluedroid/...

You find that file will be very big and thus it takes a long time for the OS to scan through it. 

At some point (which happened to me multiple times) I had to delete that file, lose all my pairings as well as the cached MAC addresses that the CSRmesh devices create. Then it's fast again.

Can you confirm?

Also check the Web Bluetooth code we have, use the secure server (!) aircable.net port 8101 with Chrome DEV on your Android. That will pop up a box with the scan results filtering only CSR Bridges. If not, click on the wave logo on top.

  • Up0
  • Down0
ianmjames
Join Date: 10 Jun 16
Posts: 9
Posted: Wed, 2016-10-12 08:11

I am unable to locate the file:

/data/misc/bluedroid/...

any ideas how to see it?

Thanks

  • Up0
  • Down0
aircable
Join Date: 8 Jun 16
Location: San Jose
Posts: 25
Posted: Wed, 2016-10-12 11:08

unlocked and rooted, otherwise /data is not readable

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.