Android Question BLE issue with multiple devices in vicinity

techknight

Well-Known Member
Licensed User
Longtime User
I am having trouble with the BLE example, I have two nRF devices that I am developing with, both of which broadcast the same Service and Characteristic IDs, they all do for UART services.

Trouble is, Manager.Connect only accepts an ID for connection, and not the Name or MAC address, or anything other than ID. This is a HUGE problem because its just gonna randomly pick which device to connect to, because the IDs being advertised by the two modules are the same, the names and MACs are different of course. But the ServiceID is the same.

Ideas??
 

techknight

Well-Known Member
Licensed User
Longtime User
Nevermind, I am an idiot. the scan log is showing the ID as the mac address, and not the serviceID.

I had that confused for some reason.
 
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
hey @techknight could I ask how easy your nRF are conecting & keep connected to your b4a?
I'm using the example from the forum but in my case it's hard to keep the nRF (nRF52840) connected longer (over 5 minutes) to the b4a App

thanks
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
Honestly, I haven't gotten that far yet.

I am actually customizing the firmware that is written to the nRF52832 which I have, I have the Fanstel version which has a 20dBm amplifier on it.

But the UART example code they provide needs alot of tweaking to get it to work right for what I am doing. I had to play around with the defined MTU size, as well as the connection min//max interval time so I could get the throughput I needed. Plus the default firmware is crash-happy because of the NRF logging code which I commented out even though I am not in debug mode.

What I did notice which might also be your issue, is the Starter service gets destroyed, ALOT by Android 9. (which is what I am using) since the example targets SDK 26. So when that happens, bye bye connection. That may be whats occuring to you. But keep in mind this happens when my phone goes idle, and screen goes black from being idle.

But if I do a wakelock, and keep the app up and in the foreground, I dont have any problems. Yet.
 
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
@techknight thank you
My application use a tablet android 5, always screen on, app running and showing data all the time..
Thanks once again will check that later for now continue with the sensors and the nRFs

all the best with your project!!
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
Android 5 has "infancy" issues with BLE. You almost need a newer version with a better BT stack with some known bugs fixed.
 
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
same problem with b4i using an iPhone, I really think it is a limitation of b4x,
anyway I'll look on it later, at the moment using the App developed from NodicSemiconductor to test my nRF firmware and sensores.

thanks
 
Upvote 0
Top