Closed joharei closed 7 years ago
Hello @joharei
Sad to read this! The one way to check this is to write your code in typical java - maybe Kotlin is somehow not compatible? I will also take a look at this .
Second - some phones have problems with hardware filters - could you disable them temporary and check if this changes anything? In your Android Manifest add: <meta-data android:name="disable_hardware_filtering" android:value="true" />
Also, what is your phone model?
Don't worry, we will figure this out :)
I've tried implementing with Java, but there's no difference. Disabling the hardware filters didn't work either.
These are the phones I've tried:
The log gets filled with these lines:
D/ScanRecord: first manudata for manu ID D/ScanRecord: parseFromBytes
Hey @joharei !
Ok, I'm on it - will try checking this on Samsung Galaxy S6 phone.
Could you try using more responsive foreground scan period? Like (1000, 0) or something? The log you posted is specific to Samsung devices, don't mind it.
Also, just a stupid question, does your app have Location Permission? Go to Apps->YourApp->Permissions. Sometimes it can block the whole scan. I need to check if after migrating to 1.0.0 our SystemRequirementChecker
asks for this permission correctly.
We are in touch!
Tried the faster foreground scan - no joy.
SystemRequirementChecker
seems to work fine, and the permission is granted.
Ranging works fine as well :)
Ok, I launched our test suite on Samsung Galaxy S6 phone with Android 6.0.1.
It works perfectly ok :/ I checked current production version as well as our soon-to-be-released candidate. At this moment I will need to dig into your logs. Could you provide me with some startup logs when your scan is starting? I know there will be a lot of spammy
D/ScanRecord: first manudata for manu ID
from Samsung stack - you can skip it.
Here are my logs. I filtered out D/ScanRecord
. BulkUpdaterPresenter
is my own log tag.
```
04-10 13:44:49.853 7144-7144/? E/Zygote: MountEmulatedStorage()
04-10 13:44:49.853 7144-7144/? E/Zygote: v2
04-10 13:44:49.853 7144-7144/? I/libpersona: KNOX_SDCARD checking this for 10027
04-10 13:44:49.853 7144-7144/? I/libpersona: KNOX_SDCARD not a persona
04-10 13:44:49.913 7144-7144/? I/SELinux: Function: selinux_compare_spd_ram, SPD-policy is existed. and_ver=SEPF_GT-I9506_5.0.1 ver=38
04-10 13:44:49.913 7144-7144/? I/SELinux: Function: selinux_compare_spd_ram , priority [1] , priority version is VE=SEPF_GT-I9506_5.0.1_0038
04-10 13:44:49.913 7144-7144/? E/SELinux: [DEBUG] get_category: variable seinfo: default sensitivity: NULL, cateogry: NULL
04-10 13:44:49.913 7144-7144/? I/art: Late-enabling -Xcheck:jni
04-10 13:44:49.993 7144-7144/? D/ResourcesManager: creating new AssetManager and set to /data/app/my.beaconmanager.debug-2/base.apk
04-10 13:44:50.253 7144-7144/my.beaconmanager.debug I/InstantRun: starting instant run server: is main process
04-10 13:44:50.433 7144-7144/my.beaconmanager.debug W/ResourceType: Too many attribute references, stopped at: 0x01010034
04-10 13:44:50.433 7144-7144/my.beaconmanager.debug W/ResourceType: Too many attribute references, stopped at: 0x01010034
04-10 13:44:50.543 7144-7144/my.beaconmanager.debug D/Activity: performCreate Call secproduct feature valuefalse
04-10 13:44:50.543 7144-7144/my.beaconmanager.debug D/Activity: performCreate Call debug elastic valuetrue
04-10 13:44:50.553 7144-7144/my.beaconmanager.debug D/BulkUpdaterPresenter: Enabling bulk updater
04-10 13:44:50.663 7144-7200/my.beaconmanager.debug D/OpenGLRenderer: Render dirty regions requested: true
04-10 13:44:50.673 7144-7144/my.beaconmanager.debug D/Atlas: Validating map...
04-10 13:44:50.693 7144-7144/my.beaconmanager.debug I/EstimoteSDK: BeaconService.onCreate:79 Creating beacon service for android version 21
04-10 13:44:50.763 7144-7200/my.beaconmanager.debug I/Adreno-EGL:
Hello @joharei
This is really unusual. First thing - you said that you are using Samsung Galaxy S6 with android version 6.0.1, but from the logs I can read that this is version 5.0.1. Here is the source:
and_ver=SEPF_GT-I9506_5.0.1 ver=38
And info from our SDK which is creating service for API 21 (5.0.1):
EstimoteSDK: BeaconService.onCreate:79 Creating beacon service for android version 21
It's seems that this is Samsung Galaxy S4 LTE-A device. Could you confirm that? This is important, because we have different scanning implementations for different Android versions. I launched our test suite on many devices with different Android versions, and it works perfectly fine.
Secondly, it seems that the scan results logs from stack below our SDK (Samsung implementation) scans a couple of Bluetooth devices with Service UUID 0000180f-0000-1000-8000-00805f9b34fb
- that's ok. The problem might be on the upper level.
For now, the questions is does our Estimote app from Google Play store discovers your Beacons? We need to do some troubleshooting before we find the solution.
Cheers!
Hi,
That's right, I changed to another phone since that post, so this is indeed Samsung Galaxy S4, with API 21. Sorry I forgot to mention that!
The Estimote app from Play Store works fine. I can connect to our beacons and make changes, and the changes are reflected in the cloud.
Hey,
I just released some fixups and improvements to scan filters - it may be connected to those issues on Samsung devices. You can check the new version 1.0.1
if your problem is gone (need to wait some time for Maven to process it, would be available later today I guess).
Let me know if this changes anything :)
Tried the 1.0.1
version. Still the same problem.
Are you doing any additional stuff with your BeaconManager
like monitoring, or scanning for other devices? It would be easier for me to check your code (or even try it out on my devices). If I may ask you to send me any more detailed source code (you can email me at pawel.dylag@estimote.com if you want). I am really curious why is this not working only for you.
I created a sample project that's not working for me: https://github.com/joharei/BulkUpdaterTest
I'm not doing anything else than scanning for configurable devices and starting the BulkUpdater.
Could there be a problem with the authentication with the cloud?
Hey @joharei
Scanning for configurable devices doesn't involve any cloud communication. You need it later when authenticating to your device, but this is not the case here. I compiled and run your project on devices here, at Estimote, and uhm... Everything works just fine:
D/MainActivity: Found 60 devices D/MainActivity: Found 67 devices D/MainActivity: Found 71 devices D/MainActivity: Found 71 devices
We don't have Samsung Galaxy S4 phone, so I can't tell you if it works on this specific device. Are you able to check this code on any other device?
I have also run the sample app on a Samsung Galaxy A5, a Google Pixel, and (for experimenting) on a Raspberry Pi 3 running Android Things. They all report this:
D/MainActivity: Found 0 devices D/MainActivity: Found 0 devices D/MainActivity: Found 0 devices
Even though I have a whole bag of beacons on my desk.
The beacons are a bit old (one says rev. D3.4 (07-01-2015)), but the Estimote app can connect to them, and they work for monitoring/ranging.
Hey @joharei
Wow, that was an extremely useful info! It seems that there is some bug on our side that screws up scanning for configurable proximity devices (old beacons). I'm investigating that. If this happen to be true, I will push fixups for you as quick as possible :) I'll keep you informed.
Ok @joharei, there was a bug with parsing old configurable beacons. It's already fixed and will be released soon :) By the way, I really recommend buying new beacons - they work much better and have really cool additional stuff (like Mesh to quickly update settings to many beacons at once, or more robust sensors!)
I'll inform you about the next release :)
Hi @pawelDylag , I need a help. I'm trying to configure multiple beacons using the deviceConnection way and then SettingsEditor for configuring but have been unsuccessful so far.. Could you please give me a pointer or suggest a better way to configure them.. ?
@pawelDylag , also can you help me with the following exception.. Since the device is connected first, and in the success callback, the device settings are edited ?!
java.lang.NullPointerException: Protocol not yet detected - cannot edit device settings. You need to successfully connect to device first.
04-12 11:49:05.603 E/AndroidRuntime(31812): at com.estimote.coresdk.common.internal.utils.Preconditions.checkNotNull(Preconditions.java:21)
04-12 11:49:05.603 E/AndroidRuntime(31812): at com.estimote.mgmtsdk.connection.strategy.DeviceConnectionInternal.getCloudSyncEngine(DeviceConnectionInternal.java:157)
Hey @puja1908
For the sake of clarity, would you kindly open a separate issue for your problem? Also please read this doc about establishing connection to you beacons, and take a look at this issue, where I have just posted some info about SettingsEditor
. Moreover, please provide me with the info about the firmware version of your beacons.
Cheers!
@pawelDylag , My bad! I have created a new issue #209 .. Could you please help me with that. Thanks!
Hey @joharei
Checkout the version 1.0.2
:) Your beacons should be discoverable now!
Cheers!
Hello again @pawelDylag!
This update has improved things, but it's still not working unfortunately. The BulkUpdater
now fetches the pending updates, and starts updating one of the beacons. Then onDeviceStatusChange
is called with the new status SUCCEED
on that beacon, but the beacon has not actually been updated. BulkUpdater
doesn't proceed to the next beacon with pending updates, and doesn't call onFinished
either. These errors appear in the log:
E/EstimoteSDK: DeviceConnectionInternal$5.onFailure:440 Unable to read setting: BATTERY_VOLTAGE_VALUE Reason: Not connected to [f2a606406dcf] E/EstimoteSDK: DeviceConnectionInternal$5.onFailure:440 Unable to read setting: APPLICATION_VERSION Reason: Not connected to [f2a606406dcf]
This is the full log:
D/EstimoteSDK: BasicConnectionStrategy.connect:50 Connecting to bluetooth device D/EstimoteSDK: BlueRock.connectInternal:155 Trying to connect to GATT D/BluetoothGatt: connect() - device: F2:A6:06:40:6D:CF, auto: false D/BluetoothGatt: registerApp() D/BluetoothGatt: registerApp() - UUID=47e73647-4afe-4802-98b6-2dafe4b575b2 D/BluetoothGatt: onClientRegistered() - status=0 clientIf=6 D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=6 device=F2:A6:06:40:6D:CF D/BluetoothGatt: discoverServices() - device: F2:A6:06:40:6D:CF D/EstimoteSDK: BlueRock$2.onConnectionStateChange:164 Connected to GATT server after 930ms, discovering services: true D/BluetoothGatt: onSearchComplete() = Device=F2:A6:06:40:6D:CF Status=0 D/EstimoteSDK: BasicConnectionStrategy.discoverProtocol:83 Discovering protocol D/EstimoteSDK: DeviceConnectionInternal.changeState:192 Changing internal connection state from CONNECTING to CONNECTED D/EstimoteSDK: FullConnectionStrategy.authenticateDevice:66 Authenticating device D/EstimoteSDK: ClassicAuthenticator.authenticate:32 Getting challenge from beacon D/EstimoteSDK: CloudAuthenticator.authenticate:32 Getting challenge from beacon D/EstimoteSDK: CloudAuthenticator.sendChallengeToCloud:47 Sending challenge to cloud I/System.out: (HTTPLog)-Static: isSBSettingEnabled false D/EstimoteSDK: CloudAuthenticator.sendChallengeResponseToDevice:62 Sending challenge response back to device D/EstimoteSDK: CloudAuthenticator.checkAuthLevel:78 Checking auth level D/EstimoteSDK: CloudAuthenticator$4.onSuccess:81 Auth level is -1 D/EstimoteSDK: FullConnectionStrategy.checkDeviceVersion:83 Checking device version and available settings D/EstimoteSDK: FullConnectionStrategy.synchroniseDeviceSettingsWithCloud:103 Synchronizing device with cloud... I/System.out: (HTTPLog)-Static: isSBSettingEnabled false D/EstimoteSDK: DeviceCloudSyncEngine.saveSettingsToDevice:82 Saving settings to device I/System.out: (HTTPLog)-Static: isSBSettingEnabled false W/EstimoteSDK: DeviceCloudSyncEngine$2.onFailure:122 Unable to synchronise setting: TEMPERATURE_OFFSET Reason: Invalid value 0.0 for TEMPERATURE_OFFSET I/System.out: (HTTPLog)-Static: isSBSettingEnabled false I/System.out: KnoxVpnUidStorageknoxVpnSupported API value returned is false W/art: Suspending all threads took: 29.320ms I/System.out: (HTTPLog)-Static: isSBSettingEnabled false I/System.out: (HTTPLog)-Static: isSBSettingEnabled false D/EstimoteSDK: BeaconService.onStartCommand:102 Got wakeup intent. Let's Application#onCreate do its job I/System.out: (HTTPLog)-Static: isSBSettingEnabled false D/EstimoteSDK: FullConnectionStrategy$4$1.onSuccess:110 Device synchronized! D/EstimoteSDK: BulkUpdaterUpdateModule$1.onSuccess:61 Updating device [f2a606406dcf] - SUCCESS D/EstimoteSDK: DeviceConnectionInternal.readSettingFromQueue:429 Setting BATTERY_PERCENTAGE_VALUE is not available on this device. D/EstimoteSDK: DeviceConnectionInternal.readSettingFromQueue:429 Setting UPTIME_IN_SECONDS is not available on this device. D/BluetoothGatt: close() D/BluetoothGatt: unregisterApp() - mClientIf=6 D/EstimoteSDK: DeviceConnectionInternal.changeState:192 Changing internal connection state from CONNECTED to DISCONNECTED E/EstimoteSDK: DeviceConnectionInternal$5.onFailure:440 Unable to read setting: BATTERY_VOLTAGE_VALUE Reason: Not connected to [f2a606406dcf] E/EstimoteSDK: DeviceConnectionInternal$5.onFailure:440 Unable to read setting: APPLICATION_VERSION Reason: Not connected to [f2a606406dcf] I/System.out: (HTTPLog)-Static: isSBSettingEnabled false I/System.out: (HTTPLog)-Static: isSBSettingEnabled false I/System.out: KnoxVpnUidStorageknoxVpnSupported API value returned is false I/System.out: (HTTPLog)-Static: isSBSettingEnabled false D/EstimoteSDK: DeviceCloudSyncEngine$3$1.success:161 Device status updated D/EstimoteSDK: DeviceCloudSyncEngine$3$1.success:161 Device status updated
Hi @pawelDylag!
Is there any progress on this issue?
Hello @joharei
Basically, if BulkUpdater
returns Success
your beacons should be updated. Some settings might have not been saved, but it's only because your Beacon hardware doesn't support them.
Also, could you show me how you build your BulkUpdater
object?
Some beacons seem to get the status SUCCEED, but still have pending changes. The next time a scan triggers the BulkUpdater though, that beacon seems to get updated, and will no longer have pending changes.
This confused me, but it looks like it's working now, even though some beacons seem to need two rounds with the BulkUpdater to really be updated. Thanks for all the help!
I'm actually trying to use the new BulkUpdater, but in order to do that, I need to scan for
ConfigurableDevice
s. The problem is that the callbackonConfigurableDevicesFound
doesn't return any devices.In my
Application
'sonCreate
, I initialize the SDK:And I start the discovery like this (this is Kotlin; bear with me):
The list of
ConfigurableDevices
is always empty, even though I have many Estimote beacons nearby.