Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New ibeacons not detected in my app

I am developing a beacon detection application and at the moment works very well for kontakt brand beacons.

The client has sent me some new beacons that i have never seen and I have searched with google but i can't find what brand they can be.

The following information related to this beacon they gave me:

uuid: fda50693-a4e2-4fb1-afcf-c6eb07647825
pass: 000000
name: ion_beacon00021
major: 16789
minor: 24532

enter image description here

I have transformed my code to monitor both uuid without making it work

for (index, beaconID) in beaconsIds.enumerated() {

  let beaconUUID = UUID(uuidString: beaconID)!
  let identifier = "BLERegionBeacon \(index)"

  let beaconRegion = CLBeaconRegion(proximityUUID: beaconUUID, identifier: identifier)
  self.locationManager?.startMonitoring(for: beaconRegion)
  self.locationManager?.startRangingBeacons(in: beaconRegion)
}

func configureLocationManager() {
    self.locationManager = CLLocationManager()
    self.locationManager!.delegate = self
    self.locationManager!.desiredAccuracy = kCLLocationAccuracyBest
    self.locationManager!.distanceFilter = kCLDistanceFilterNone;
    self.locationManager!.activityType = CLActivityType.automotiveNavigation;

    for region in self.locationManager!.monitoredRegions {
      self.locationManager?.stopMonitoring(for: region)
    }

    if CLLocationManager.authorizationStatus() != CLAuthorizationStatus.authorizedAlways {
      self.locationManager?.requestAlwaysAuthorization()
    }

    self.locationManager!.startUpdatingLocation()

}

When not finding how to make this new ibeacon work I have resorted to third party applications (like MyBeacon, Detector, Beacon Demonstrator, Locate) to get validate if the information I have of this beacon is correct, but in no application I have been able to make it detect this ibeacon.

I bought a new battery to make sure it was not as simple as that, but neither. :'(

I had the idea to use any application that detects bluetooth devices and I found BLE Scanner. With this application i was lucky and could realize that at least the name that i have of the beacon is correct, but not found any related to major or minor or pass. I also thought that the long id seen there could be correct and that the I had was not... But I discarded it because when I connected the brand kontakt also gave me a different uuid.

enter image description here

enter image description here

ISCONNECTABLE Jumps between YES and NO.

When i use BLE Scanner to detect beacons Kontakt show me addional info called SERVICEDATA and ISCONNECTABLE still in YES.

enter image description here

- Is there anything else that needs to be done to detect these beacons?

- Anyone have any idea what may be going on?

Thank you very much

EDIT

Following the help of davidgyoung, I could realize that the Locate application if it works but only in its version for android. And in fact correctly returns the information I had been given from that beacon at first.

I found that these beacons with configurable using an application called BeaconFlyer and there I realized the reason for being that password that had sent me. I was able to change the uuid although strangely I just put numbers and no letters. I changed it by 32 zeros following the same pattern of 8-4-4-4-12. I still get no results in IOS but works on android, even after changing the uuid.

It is possible that some brands need to be certified to be detected by iOS devices and that the android do not have these restrictions.

EDIT 2

Considering all these details, it seems that the problem is IOS and not android, so it occurred to me that maybe if I created a simple android project just to test the functionality of the beacons, I should be able to detect it.

The test was done by registering this UUID f7826da6-4fa2-4e98-8024-bc5b71e0893e which is the one that has always works for me and with which I detect without any problem the beacons markkontakt.

To my surprise I detect it without problem even without registering the UUID that I have for this brand. It is very strange considering that only register 1 UUID that was the mark kontakt

like image 550
jose920405 Avatar asked Dec 11 '22 10:12

jose920405


2 Answers

If you are detecting another beacon with the same code, then the simplest explanation is that the ProxmityUUID you were given is wrong.

You won't be able to determine the correct ProximityUUID from BLE Scanner on iOS, as iOS blocks access to iBeacon advertisements unless you know the ProximityUUID up front. If you can get your hands on an Android device you can use the Locate app to see any beacon regardless of its identifiers. https://play.google.com/store/apps/details?id=com.radiusnetworks.locate&hl=en You can use this to find out what it is actually sending. There are similar apps for MacOS as well if you have access to a Mac.

like image 162
davidgyoung Avatar answered Jan 02 '23 23:01

davidgyoung


It is quite clear that your client sent you "beacons" and not necessarily "iBeacons". As davidyoung pointed out, what constitutes an iBeacon is specified (quite strictly) by Apple. Download the specs from there and have a look, if you are so inclined.

I have used several BLE scanners to check what uuid, major, and minor numbers various brand iBeacons I worked with have, among them the mentioned BLE scanner. I think the specification does not prevent somehow putting additional services into an iBeacon, which results in different brand iBeacons potentially showing slightly different info in different scanners. However, what you show in the screenshot and the fact that the isconnectable field switches values make me think that these beacons are not correctly working.

There will be no way to make them work on iOS that way then. You can write your own Bluetooth protocol code to do stuff with them, but that then won't rely on Apple's iBeacon mechanics. This will mean the nice stuff like region monitoring even while the app is suspended and so on won't work. It's also probably more battery draining and in general more work.


I am as said not a Bluetooth expert, but learned this much: UUIDs are all over the specs. The UUID you (and Apple) refer to is a part of the data packet the iBeacon is supposed to send, but I have also seen BLE services in general being identified by UUIDs in (non-Apple) reference documents. This can get confusing when you scan such a beacon and see UUIDs (or at least strings that look like ones) in several places. So even if the beacons you have follow the spec (or can be configured to do so somehow) my guess is that someone screwed up. For example, they could have edited (maybe even with a hardwired connection and tool) the wrong UUID, not setting the one you need to use, but accidentally overwriting the part that specifies the device as an iBeacon (byte 5 and 6 of the data packet come to mind), making it impossible for you to use them.

As an advice I would suggest the following: If your client is interested in actual iBeacon functionality, tell them they should buy correct beacons. the kontakt ones are actually quite good. I've tested cheap china knockoffs and would advise against those, as they quickly become unreliable. It might be tempting to save a few bucks at first, but if you need to constantly replace beacons in the long run that becomes more expensive in the end.

like image 25
Gero Avatar answered Jan 02 '23 23:01

Gero