Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLE intermittent transmitter #2499

Closed
ingrove opened this issue May 2, 2022 · 2 comments · Fixed by #2500
Closed

BLE intermittent transmitter #2499

ingrove opened this issue May 2, 2022 · 2 comments · Fixed by #2500
Labels
bug Something isn't working sensor-tracking

Comments

@ingrove
Copy link

ingrove commented May 2, 2022

Home Assistant Android version:
2022.3.0-full
Android version:
12
Phone model:
Google Pixel 5
Home Assistant version:
2022.4.7
Last working Home Assistant release (if known):

Description of problem:
The BLE beacon transmitter randomly stops/starts/disappears.
Traceback (if applicable, to get the logs you may refer to: https://companion.home-assistant.io/docs/troubleshooting/faqs/#android-crash-logs):
HA core log:

2022-05-02 14:45:00 DEBUG (MainThread) [homeassistant.components.mobile_app.webhook] Received webhook payload from Pixel 5 for type update_sensor_states: [{'unique_id': 'ble_emitter', 'state': '', 'type': 'sensor', 'icon': 'mdi:bluetooth-off', 'attributes': {'Advertise mode': 'lowLatency', 'Measured power': -59, 'Transmitting power': 'low', 'id': '008fd71e-a43a-4ab4-8e02-f969133f8380-100-1'}}]

2022-05-02 14:45:00 DEBUG (MainThread) [homeassistant.components.mobile_app.webhook] Received webhook payload from Pixel 5 for type update_sensor_states: [{'unique_id': 'ble_emitter', 'state': '', 'type': 'sensor', 'icon': 'mdi:bluetooth-off', 'attributes': {'Advertise mode': 'lowLatency', 'Measured power': -59, 'Transmitting power': 'low', 'id': '008fd71e-a43a-4ab4-8e02-f969133f8380-100-1'}}]

2022-05-02 14:45:59 DEBUG (MainThread) [homeassistant.components.mobile_app.webhook] Received webhook payload from Pixel 5 for type update_sensor_states: [{'unique_id': 'ble_emitter', 'state': 'Transmitting', 'type': 'sensor', 'icon': 'mdi:bluetooth', 'attributes': {'Advertise mode': 'lowLatency', 'Measured power': -59, 'Transmitting power': 'low', 'id': '008fd71e-a43a-4ab4-8e02-f969133f8380-100-1'}}]

Companion App log:

05-02 14:45:00.066 31838 31838 E mpanion.androi: Not starting debugger since process cannot load the jdwp agent.
05-02 14:45:00.068 31838 31838 D ProcessState: Binder ioctl to enable oneway spam detection failed: Invalid argument
05-02 14:45:00.081 31838 31838 D CompatibilityChangeReporter: Compat change id reported: 171979766; UID 10471; state: ENABLED
05-02 14:45:00.144 31838 31838 W mpanion.androi: Entry not found
05-02 14:45:00.146 31838 31838 W mpanion.androi: Entry not found
05-02 14:45:00.147 31838 31838 W mpanion.androi: Entry not found
05-02 14:45:00.153 31838 31838 W mpanion.androi: JIT profile information will not be recorded: profile file does not exist.
05-02 14:45:00.154 31838 31838 W mpanion.androi: JIT profile information will not be recorded: profile file does not exist.
05-02 14:45:00.154 31838 31838 W mpanion.androi: JIT profile information will not be recorded: profile file does not exist.
05-02 14:45:00.163 31838 31838 V GraphicsEnvironment: ANGLE Developer option for 'io.homeassistant.companion.android' set to: 'default'
05-02 14:45:00.163 31838 31838 V GraphicsEnvironment: ANGLE GameManagerService for io.homeassistant.companion.android: false
05-02 14:45:00.164 31838 31838 V GraphicsEnvironment: Updatable production driver is not supported on the device.
05-02 14:45:00.164 31838 31838 D NetworkSecurityConfig: Using Network Security Config from resource network_security_config debugBuild: false
05-02 14:45:00.167 31838 31838 D NetworkSecurityConfig: Using Network Security Config from resource network_security_config debugBuild: false
05-02 14:45:00.207 31838 31838 I FirebaseApp: Device unlocked: initializing all Firebase APIs for app [DEFAULT]
05-02 14:45:00.217 31838 31838 I FirebaseInitProvider: FirebaseApp initialization successful
05-02 14:45:00.220 31838 31838 D WM-WrkMgrInitializer: Initializing WorkManager with default configuration.
05-02 14:45:00.236 31838 31862 I DynamiteModule: Considering local module com.google.android.gms.measurement.dynamite:55 and remote module com.google.android.gms.measurement.dynamite:70
05-02 14:45:00.236 31838 31862 I DynamiteModule: Selected remote version of com.google.android.gms.measurement.dynamite, version >= 70
05-02 14:45:00.236 31838 31862 V DynamiteModule: Dynamite loader version >= 2, using loadModule2NoCrashUtils
05-02 14:45:00.236 31838 31838 D Sentry  : io.sentry.auto-init read: false
05-02 14:45:00.236 31838 31838 I Sentry  : Retrieving auto-init from AndroidManifest.xml
05-02 14:45:00.253 31838 31864 D CompatibilityChangeReporter: Compat change id reported: 160794467; UID 10471; state: ENABLED
05-02 14:45:00.374 31838 31871 I FA      : App measurement initialized, version: 61007
05-02 14:45:00.374 31838 31871 I FA      : To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
05-02 14:45:00.375 31838 31871 I FA      : To enable faster debug mode event logging run:
05-02 14:45:00.375 31838 31871 I FA      :   adb shell setprop debug.firebase.analytics.app io.homeassistant.companion.android
05-02 14:45:00.381 31838 31876 I WebViewFactory: Loading com.google.android.webview version 100.0.4896.127 (code 489612734)
05-02 14:45:00.450 31838 31876 I cr_WVCFactoryProvider: Loaded version=100.0.4896.127 minSdkVersion=29 isBundle=true multiprocess=true packageId=2
05-02 14:45:00.465 31838 31876 I cr_LibraryLoader: Successfully loaded native library
05-02 14:45:00.466 31838 31876 I cr_CachingUmaRecorder: Flushed 8 samples from 8 histograms.
05-02 14:45:00.479 31838 31838 D SensorReceiver: Received intent: android.net.wifi.STATE_CHANGE
05-02 14:45:00.480 31838 31838 D SensorReceiver: Received intent: android.net.wifi.WIFI_STATE_CHANGED
05-02 14:45:00.480 31838 31838 D SensorReceiver: Sensor wifi_state corresponding to received event android.net.wifi.WIFI_STATE_CHANGED is disabled, skipping sensors update
05-02 14:45:00.480 31838 31838 D SensorReceiver: Received intent: android.media.RINGER_MODE_CHANGED
05-02 14:45:00.480 31838 31838 D SensorReceiver: Sensor audio_sensor corresponding to received event android.media.RINGER_MODE_CHANGED is disabled, skipping sensors update
05-02 14:45:00.494 31838 31868 D SensorWorker: Updating all Sensors.
05-02 14:45:00.496 31838 31874 I WM-Processor: Moving WorkSpec (2bb3752e-e1a4-414d-8958-2733643b09e7) to the foreground
05-02 14:45:00.507 31838 31838 I WM-SystemFgDispatcher: Started foreground service Intent { act=ACTION_START_FOREGROUND cmp=io.homeassistant.companion.android/androidx.work.impl.foreground.SystemForegroundService (has extras) }
05-02 14:45:00.508 31838 31867 D UrlRepository: localUrl is: false and usesInternalSsid is: false
05-02 14:45:00.512 31838 31874 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=aeb9bc6a-e17e-4b90-b173-e0a4ed1cb35c, tags={ io.homeassistant.companion.android.websocket.WebsocketManager } ]
05-02 14:45:00.534 31838 31869 D BeaconParser: Parsing beacon layout: m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24
05-02 14:45:00.536 31838 31869 D BluetoothAdapter: isLeEnabled(): ON
05-02 14:45:00.537 31838 31869 D BluetoothAdapter: isLeEnabled(): ON
05-02 14:45:00.546 31838 31919 D BluetoothAdapter: isLeEnabled(): ON
05-02 14:45:00.546 31838 31838 E BeaconTransmitter: Advertisement start failed, code: 3
05-02 14:45:00.559 31838 31838 I BeaconTransmitter: Advertisement start succeeded.
05-02 14:45:00.612 31838 31869 D UrlRepository: localUrl is: false and usesInternalSsid is: false
05-02 14:45:00.612 31838 31919 D UrlRepository: localUrl is: false and usesInternalSsid is: false
05-02 14:45:00.726 31838 31864 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=2bb3752e-e1a4-414d-8958-2733643b09e7, tags={ io.homeassistant.companion.android.sensors.SensorWorker } ]
05-02 14:45:00.731 31838 31838 I WM-SystemFgDispatcher: Stopping foreground service

Screenshot of problem:
image

Additional information:

@ingrove ingrove added the bug Something isn't working label May 2, 2022
@dshokouhi
Copy link
Member

Thanks for submitting the report. Looks like there is a case where the app is sending the state as a blank string so that appears to be the reason for the gaps there.

{'unique_id': 'ble_emitter', 'state': '', 

I also see the transmitter encountered an error, not sure if its related or an actual issue because it seems to be transmitting shortly after.

05-02 14:45:00.546 31838 31838 E BeaconTransmitter: Advertisement start failed, code: 3
05-02 14:45:00.559 31838 31838 I BeaconTransmitter: Advertisement start succeeded.

@dshokouhi
Copy link
Member

I assume this happens when we lose the state of the variable here:

private var bleTransmitterDevice = IBeaconTransmitter("", "", "", transmitPowerSetting = "", measuredPowerSetting = 0, advertiseModeSetting = "", transmitting = false, state = "", restartRequired = false)

Should probably have this restore to the last state value if blank

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sensor-tracking
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants