Hi!
I’m trying to connect to my beacons in my app to read the sensor data more reliably. But when trying to connect i get this error: “DeviceConnectionInternal$1.onError:260 Device [“Device ID”] does not belong to user.”
I have claimed my beacons, i see them all in the cloud. I can even connect to them using the Estimote App. I have called EstimoteSDK.initialize(); with the App ID and App Token, taken from estimote cloud. Is there anything else i have to do?
I can connect to them if i use getConnectionForStorageRead(); instead of getConnection. But it disconnects after a few seconds.
I use a Samsung s7 and a Lenovo Tab 4 10.
connectManager.setConfigurableDevicesListener(new BeaconManager.ConfigurableDevicesListener() {
@Override
public void onConfigurableDevicesFound(List<ConfigurableDevice> configurableDevices) {
for (final ConfigurableDevice configDevice : configurableDevices){
if(configDevice.getUniqueKey().contains(DEVICE_ID)){
if(connection == null) {
connection = connectionProvider.getConnection(configDevice);
}
else if(!connection.isConnected()){
connection.connect(new DeviceConnectionCallback() {
@Override
public void onConnected() {
Log.d("Connection", "onConnected: Connected to "+configDevice.getUniqueKey()+" Successfully");
}
@Override
public void onDisconnected() {
Log.d("Connection", "onConnected: Disconnected from "+configDevice.getUniqueKey());
}
@Override
public void onConnectionFailed(DeviceConnectionException exception) {
Log.d("Connection", "onConnected: Failed to connect to "+configDevice.getUniqueKey());
}
});
}
else{
connection.settings.sensors.light.ambientLight().get(new SettingCallback<Float>() {
@Override
public void onSuccess(Float value) {
Toast.makeText(actv, "Light: "+value, Toast.LENGTH_SHORT).show();
scannedDevicesList.set(0,"Light Value: "+value+" Lux");
}
@Override
public void onFailure(DeviceConnectionException exception) {
Log.d("Connection","Failed to read light sensor");
}
});
}
}
}
}
});