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!
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.
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.
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.
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
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.
I am unable to locate the file:
/data/misc/bluedroid/...
any ideas how to see it?
Thanks
unlocked and rooted, otherwise /data is not readable