kontaktio / kontakt-android-sdk

The repository contains prebuilt artifacts ready to be included to project manually. If you develop with Android Studio please check our docs website.
http://developer.kontakt.io
68 stars 16 forks source link

Becons on discovered not giving all values as expected. #164

Closed agcell closed 7 years ago

agcell commented 7 years ago

Using KonKakt SDK version : 3.3.1 Testing Devices : Can be replicated easily in many devices like moto e4 plus, Intax aqua supreme plus , Moto g4. I have a becon having TLM,UID,URL packet enabled , it through scan result on Discovered below result 👍 {address='E2:02:00:12:EA:40', uniqueId='sEpb', namespace='null', instanceId='null', url='null', eid='null', etlm='null', rssi=-70, shuffled=false} As an of parameter (instanceId and major-minor ) should not be null as per understanding.OnUpdate it throughs correct value of instanceId.

{address='E2:02:00:12:EA:40', uniqueId='sEpb', namespace='f7826da6bc5b71e0893e', instanceId='717a456e6266', url='null', eid='null', etlm='null', rssi=-65, shuffled=false}

Thanks Nisha

sbobowiec commented 7 years ago

What is your ProximityManager configuration? Can you paste some code so I could investigate it?

agcell commented 7 years ago

Thanks for the update. Below, is the configuration : ProximityManager proximityManager = ProximityManagerFactory.create(this); //Configure proximity manager basic options proximityManager.configuration() //Using ranging for continuous scanning or MONITORING for scanning with intervals .scanPeriod(ScanPeriod.RANGING) //Using BALANCED for best performance/battery ratio .scanMode(ScanMode.BALANCED) //OnDeviceUpdate callback will be received with 5 seconds interval .deviceUpdateCallbackInterval(TimeUnit.SECONDS.toMillis(1)); //Setting up iBeacon and Eddystone listeners proximityManager.setIBeaconListener(createIBeaconListener()); proximityManager.setEddystoneListener(createEddystoneListener());

Thanks Nisha

sbobowiec commented 7 years ago

Try to add this line to your configuration: eddystoneFrameTypes(Arrays.asList(EddystoneFrameType.TLM, EddystoneFrameType.UID, EddystoneFrameType.URL))

agcell commented 7 years ago

Thanks for the help, it works for me.

Also i have one question related to Eddystone Becons , sometimes even if the beacon is switch on it goes to onEddystoneLost , which indicates that device is switch off.

Please help.

Thanks Nisha

sbobowiec commented 7 years ago

You mean that your beacon is lost sometimes even if it's nearby to the phone? If so then I suggest you to change broadcasting interval.

agcell commented 7 years ago

Yes, it lost even if it's nearby. Should i need to update deviceUpdateCallbackInterval?

sbobowiec commented 7 years ago

No, deviceUpdateCallbackInterval is used to define time interval for getting updated devices collection in onXXXUpdated() listener's method. It prevents from being called instantly.

Change "Advertising interval" property for your device using our mobile app and set it to lower value. It should resolve your problem.

agcell commented 7 years ago

What is the minimum value of Advertising interval , currently it is 1000.

Thanks

sbobowiec commented 7 years ago

For Beacon Pro the minimum interval is 100 ms, for other devices 20ms. The lower interval affects faster battery draining process. So it's on your own to decide which interval value would be appropriate for you. With interval value set to 200ms repeated lost action should be eliminated.

agcell commented 7 years ago

But we don't want to affect battery draining process.

adrianz commented 7 years ago

Hey @agcell

Unfortunately we can't bend the laws of physics (at least just not yet 😉). Radio signals like those broadcasted by beacons are susceptible to interferences from other radio sources. Additionally, Signals from beacons, like any other radio broadcasts, can get attenuated, reflected, blocked, etc. It all affects the quality of radio signal that reaches your mobile phone.

On the other side, different phones have different antenna designs, Bluetooth chipsets, operating systems, etc. That can also be a factor of how stable is the signal that Android reports to our SDK and your app.

When taking all this into consideration it's easy to come to a conclusion, that when a a beacon does not broadcast often enough, it's possible that some of the packet broadcasted by it might get lost and never reach your phone and then our SDK. If the SDK does not get an information about a new packet coming from the same beacon for too long, it will decide that this beacon is no longer in range and report this to your app. In order to prevent this, you need to increase the likelihood of a signal from a beacon being detected by a phone. The most straightforward way to do this is to broadcast more signals (more often) from a beacon. You need to test for yourself, in the environment your beacons are going to be deployed, what advertising interval will give you the best results. Sadly, there is no golden rule that would allow me to tell you the best value for this parameter for your particular use case. You will need to find it through a bit of trials and errors. From our observations, like @sbobowiec has already mentioned, 1000ms does not provide very stable experience, but values around 200 usually help eliminate problems like yours.

agcell commented 7 years ago

Hi @adrianz

Thanks for the explanation and help provided.

Regards Nisha

agcell commented 7 years ago

I am using below configuration of ProximityManager: ProximityManager proximityManager = ProximityManagerFactory.create(this); //Configure proximity manager basic options proximityManager.configuration() .scanPeriod(ScanPeriod.RANGING) //Using ranging for continuous scanning or MONITORING for scanning with intervals .scanMode(ScanMode.BALANCED) //Using BALANCED for best performance/battery ratio .eddystoneFrameTypes(Arrays.asList(EddystoneFrameType.TLM, EddystoneFrameType.UID, EddystoneFrameType.URL)) .deviceUpdateCallbackInterval(TimeUnit.SECONDS.toMillis(1)); //OnDeviceUpdate callback will be received with 1 seconds interval proximityManager.setEddystoneListener(createEddystoneListener());

But on the start of scanning it takes lot of time (around 1 min) in discovering. Using advertising interval 200 ms.

Please help.