1

I've been trying to use Kontakt.io's sample Android app(available at this address) to implement a simple app that would connect to a Kontakt beacon and change the details such as major, minor, txPower etc. I'm able to detect the beacons and read the correct details for all the above but I am unable to change them. Looking at the sample app, the steps should be straightforward and this is what I've done

  1. onBeaconsDiscovered has a list of BeaconDevice objects as a parameter so I choose one of those BeaconDevice objects and store it in variable called beacon.
  2. I then say beacon.setPassword("password".getBytes()). The actual password used is the password for that specific beacon from the Kontakt.io web panel.
  3. BeaconConnection beaconConnection = BeaconConnection.newInstance (MyActivity.this, beacon, connListener);
  4. beaconConnection.connect()

That should be it according to the sample app, but it doesn't seem to actually work. I connect to the beacon(meaning onConnected() callback is called) but I then get an error saying authentication has failed due to a wrong password.

I've tried this with a couple of different beacons, new from Kontakt, using the password from the web panel and it doesn't work so, while a possibility, I don't think I just have a faulty beacon.

There are some comments in their docs about a master password for these beacons - not sure where to get that or if that is what is required.

I'm slightly suspicious of the fact that Kontakt has this sample app here but they haven't released it on the Google Play store(i.e. does their code actually work?).

Either way, I'd appreciate any thoughts on what I'm missing.

I am trying to use this as part of a large application that would do a bunch of things with the beacons, hence the need to write my own app.

Please note this is specifically regarding Kontakt.io beacons and specifically their Android SDK.

KJ Helios
  • 11
  • 3

1 Answers1

0
beacon.setPassword("password".getBytes())

Kontakt.io's beacons have 4 byte long password which is why you can't get access to your beacon parameters.

The sample app allows you to authorize your beacon and manipulate its parameters.

Please note also that once you attempt to authorize the beacon with the wrong password it will reject the connection and change its state to NON-CONNECTABLE.

The NON-CONNECTABLE state was introduced to prevent multiple connection requests from unknown users.

The NON-CONNECTABLE state lasts no more than 20 minutes and during this period no connection can be established to your beacon.

For more information, please visit kontakt.io's knowledge base or kontakt.io - Beacon datasheet

dawid gdanski
  • 2,432
  • 3
  • 21
  • 29
  • I did not put the actual password in the code snippet above. As mentioned in the original post, I am using the password for the relevant beacon from the Kontakt.io web panel which, as you mention, is a 4 character password. – KJ Helios Feb 12 '15 at 21:59
  • With regards to non-connectability, first, if I use the correct password from the web panel, why is it rejecting it and saying the password is incorrect? Second, every time it says the password is incorrect, I manually take the battery out and reset it - per the kontakt.io docs, that should make it immediately connectable again. Appreciate your response but I don't think it really addresses the question. – KJ Helios Feb 12 '15 at 22:01