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

Camera widget fails to load snapshot with mTLS setup #4909

Closed
Palleri opened this issue Dec 15, 2024 · 31 comments · Fixed by #4911
Closed

Camera widget fails to load snapshot with mTLS setup #4909

Palleri opened this issue Dec 15, 2024 · 31 comments · Fixed by #4911
Labels
bug Something isn't working widget

Comments

@Palleri
Copy link

Palleri commented Dec 15, 2024

Android version: 2024.12.1-full

Device: Samsung s23 Android 14

Home assistant version: 2024.12.2

When I try to add a camera widget the widget becomes transparent.

Screenshot_20241215_233419_One UI Home

12-15 23:35:48.008 12863 12863 D CameraWidget: Broadcast received: 
12-15 23:35:48.008 12863 12863 D CameraWidget: Broadcast action: io.homeassistant.companion.android.widgets.camera.CameraWidget.UPDATE_IMAGE
12-15 23:35:48.008 12863 12863 D CameraWidget: AppWidgetId: 37
12-15 23:35:48.015 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:48.015 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:48.017 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:48.017 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:48.054 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:48.054 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:48.054 12863 12863 D CameraWidget: Fetching camera image
12-15 23:35:48.055 12863 12863 I AppWidgetManager: updateAppWidget() appWidgetIds = [37]
12-15 23:35:48.056 12863 12863 D CameraWidget: Fetch and load complete
12-15 23:35:48.077 12863 16609 D TrafficStats: tagSocket(110) with statsTag=0xffffffff, statsUid=-1
12-15 23:35:48.166 12863 12863 D CameraWidget: Broadcast received: 
12-15 23:35:48.166 12863 12863 D CameraWidget: Broadcast action: io.homeassistant.companion.android.widgets.camera.CameraWidget.UPDATE_IMAGE
12-15 23:35:48.166 12863 12863 D CameraWidget: AppWidgetId: 37
12-15 23:35:48.171 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:48.171 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:48.174 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:48.174 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:48.191 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:48.191 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:48.191 12863 12863 D CameraWidget: Fetching camera image
12-15 23:35:48.192 12863 12863 I AppWidgetManager: updateAppWidget() appWidgetIds = [37]
12-15 23:35:48.193 12863 12863 D CameraWidget: Fetch and load complete
12-15 23:35:48.316 12863 12863 D CameraWidget: Broadcast received: 
12-15 23:35:48.316 12863 12863 D CameraWidget: Broadcast action: io.homeassistant.companion.android.widgets.camera.CameraWidget.UPDATE_IMAGE
12-15 23:35:48.316 12863 12863 D CameraWidget: AppWidgetId: 37
12-15 23:35:48.322 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:48.322 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:48.325 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:48.325 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:48.341 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:48.341 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:48.341 12863 12863 D CameraWidget: Fetching camera image
12-15 23:35:48.342 12863 12863 I AppWidgetManager: updateAppWidget() appWidgetIds = [37]
12-15 23:35:48.343 12863 12863 D CameraWidget: Fetch and load complete
12-15 23:35:48.592 12863 12863 D CameraWidget: Broadcast received: 
12-15 23:35:48.592 12863 12863 D CameraWidget: Broadcast action: io.homeassistant.companion.android.widgets.camera.CameraWidget.UPDATE_IMAGE
12-15 23:35:48.592 12863 12863 D CameraWidget: AppWidgetId: 37
12-15 23:35:48.598 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:48.598 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:48.601 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:48.601 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:48.632 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:48.632 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:48.632 12863 12863 D CameraWidget: Fetching camera image
12-15 23:35:48.632 12863 12863 I AppWidgetManager: updateAppWidget() appWidgetIds = [37]
12-15 23:35:48.633 12863 12863 D CameraWidget: Fetch and load complete
12-15 23:35:48.728 12863 12863 D CameraWidget: Broadcast received: 
12-15 23:35:48.728 12863 12863 D CameraWidget: Broadcast action: io.homeassistant.companion.android.widgets.camera.CameraWidget.UPDATE_IMAGE
12-15 23:35:48.728 12863 12863 D CameraWidget: AppWidgetId: 37
12-15 23:35:48.734 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:48.735 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:48.738 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:48.738 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:48.757 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:48.757 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:48.757 12863 12863 D CameraWidget: Fetching camera image
12-15 23:35:48.758 12863 12863 I AppWidgetManager: updateAppWidget() appWidgetIds = [37]
12-15 23:35:48.759 12863 12863 D CameraWidget: Fetch and load complete
12-15 23:35:48.835 12863 12863 D CameraWidget: Broadcast received: 
12-15 23:35:48.835 12863 12863 D CameraWidget: Broadcast action: io.homeassistant.companion.android.widgets.camera.CameraWidget.UPDATE_IMAGE
12-15 23:35:48.835 12863 12863 D CameraWidget: AppWidgetId: 37
12-15 23:35:48.841 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:48.842 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:48.845 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:48.845 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:48.874 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:48.874 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:48.874 12863 12863 D CameraWidget: Fetching camera image
12-15 23:35:48.875 12863 12863 I AppWidgetManager: updateAppWidget() appWidgetIds = [37]
12-15 23:35:48.876 12863 12863 D CameraWidget: Fetch and load complete
12-15 23:35:48.984 12863 12863 D CameraWidget: Broadcast received: 
12-15 23:35:48.984 12863 12863 D CameraWidget: Broadcast action: io.homeassistant.companion.android.widgets.camera.CameraWidget.UPDATE_IMAGE
12-15 23:35:48.984 12863 12863 D CameraWidget: AppWidgetId: 37
12-15 23:35:48.991 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:48.991 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:48.995 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:48.995 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:49.017 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:49.018 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:49.018 12863 12863 D CameraWidget: Fetching camera image
12-15 23:35:49.018 12863 12863 I AppWidgetManager: updateAppWidget() appWidgetIds = [37]
12-15 23:35:49.019 12863 12863 D CameraWidget: Fetch and load complete
12-15 23:35:49.134 12863 12863 D CameraWidget: Broadcast received: 
12-15 23:35:49.134 12863 12863 D CameraWidget: Broadcast action: io.homeassistant.companion.android.widgets.camera.CameraWidget.UPDATE_IMAGE
12-15 23:35:49.134 12863 12863 D CameraWidget: AppWidgetId: 37
12-15 23:35:49.143 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:49.144 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:49.146 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:49.146 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:49.160 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:49.161 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:49.161 12863 12863 D CameraWidget: Fetching camera image
12-15 23:35:49.161 12863 12863 I AppWidgetManager: updateAppWidget() appWidgetIds = [37]
12-15 23:35:49.162 12863 12863 D CameraWidget: Fetch and load complete
12-15 23:35:49.235 12863 12863 D CameraWidget: Broadcast received: 
12-15 23:35:49.235 12863 12863 D CameraWidget: Broadcast action: io.homeassistant.companion.android.widgets.camera.CameraWidget.UPDATE_IMAGE
12-15 23:35:49.235 12863 12863 D CameraWidget: AppWidgetId: 37
12-15 23:35:49.242 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:49.242 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:49.245 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:49.245 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:49.275 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:49.275 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:49.275 12863 12863 D CameraWidget: Fetching camera image
12-15 23:35:49.276 12863 12863 I AppWidgetManager: updateAppWidget() appWidgetIds = [37]
12-15 23:35:49.277 12863 12863 D CameraWidget: Fetch and load complete
12-15 23:35:49.376 12863 12863 D CameraWidget: Broadcast received: 
12-15 23:35:49.376 12863 12863 D CameraWidget: Broadcast action: io.homeassistant.companion.android.widgets.camera.CameraWidget.UPDATE_IMAGE
12-15 23:35:49.376 12863 12863 D CameraWidget: AppWidgetId: 37
12-15 23:35:49.381 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:49.381 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:49.384 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:49.384 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:49.410 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:49.410 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:49.410 12863 12863 D CameraWidget: Fetching camera image
12-15 23:35:49.411 12863 12863 I AppWidgetManager: updateAppWidget() appWidgetIds = [37]
12-15 23:35:49.412 12863 12863 D CameraWidget: Fetch and load complete
12-15 23:35:49.501 12863 12863 D CameraWidget: Broadcast received: 
12-15 23:35:49.501 12863 12863 D CameraWidget: Broadcast action: io.homeassistant.companion.android.widgets.camera.CameraWidget.UPDATE_IMAGE
12-15 23:35:49.501 12863 12863 D CameraWidget: AppWidgetId: 37
12-15 23:35:49.506 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:49.507 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:49.509 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:49.509 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:49.539 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:49.539 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:49.539 12863 12863 D CameraWidget: Fetching camera image
12-15 23:35:49.539 12863 12863 I AppWidgetManager: updateAppWidget() appWidgetIds = [37]
12-15 23:35:49.541 12863 12863 D CameraWidget: Fetch and load complete
12-15 23:35:49.626 12863 12863 D CameraWidget: Broadcast received: 
12-15 23:35:49.626 12863 12863 D CameraWidget: Broadcast action: io.homeassistant.companion.android.widgets.camera.CameraWidget.UPDATE_IMAGE
12-15 23:35:49.626 12863 12863 D CameraWidget: AppWidgetId: 37
12-15 23:35:49.631 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:49.631 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:49.634 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:49.634 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:49.657 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:49.657 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:49.657 12863 12863 D CameraWidget: Fetching camera image
12-15 23:35:49.658 12863 12863 I AppWidgetManager: updateAppWidget() appWidgetIds = [37]
12-15 23:35:49.659 12863 12863 D CameraWidget: Fetch and load complete
12-15 23:35:49.762 12863 12863 D CameraWidget: Broadcast received: 
12-15 23:35:49.762 12863 12863 D CameraWidget: Broadcast action: io.homeassistant.companion.android.widgets.camera.CameraWidget.UPDATE_IMAGE
12-15 23:35:49.762 12863 12863 D CameraWidget: AppWidgetId: 37
12-15 23:35:49.766 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:49.766 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:49.769 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:49.769 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:49.785 12863 12863 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:49.785 12863 12863 D ServerConnectionInfo: Using external URL
12-15 23:35:49.785 12863 12863 D CameraWidget: Fetching camera image
12-15 23:35:49.786 12863 12863 I AppWidgetManager: updateAppWidget() appWidgetIds = [37]
12-15 23:35:49.787 12863 12863 D CameraWidget: Fetch and load complete
12-15 23:35:50.375 12863 12863 I ViewRootImpl@6b351c6[SettingsActivity]: handleAppVisibility mAppVisible = false visible = true
12-15 23:35:50.376 12863 12863 I ViewRootImpl@6b351c6[SettingsActivity]: stopped(false) old = true
12-15 23:35:50.376 12863 12863 D ViewRootImpl@6b351c6[SettingsActivity]: WindowStopped on io.homeassistant.companion.android/io.homeassistant.companion.android.settings.SettingsActivity set to false
12-15 23:35:50.381 12863 12863 D IntegrationRepository: isAppLocked(): false. (LockEnabled: false, appActive: false, expireMillis: 1734302148115, currentMillis: 1734302150381)
12-15 23:35:50.396 12863 12863 I InsetsSourceConsumer: applyRequestedVisibilityToControl: visible=true, type=navigationBars, host=io.homeassistant.companion.android/io.homeassistant.companion.android.settings.SettingsActivity
12-15 23:35:50.397 12863 12863 I InsetsSourceConsumer: applyRequestedVisibilityToControl: visible=true, type=statusBars, host=io.homeassistant.companion.android/io.homeassistant.companion.android.settings.SettingsActivity
12-15 23:35:50.397 12863 12863 I BufferQueueProducer: [](id:323f00000019,api:0,p:114,c:12863) setDequeueTimeout:2077252342
12-15 23:35:50.397 12863 12863 I BLASTBufferQueue_Java: new BLASTBufferQueue, mName= ViewRootImpl@6b351c6[SettingsActivity] mNativeObject= 0xb400006fadbadf00 sc.mNativeObject= 0xb4000070d8e0f340 caller= android.view.ViewRootImpl.updateBlastSurfaceIfNeeded:3028 android.view.ViewRootImpl.relayoutWindow:10131 android.view.ViewRootImpl.performTraversals:4110 android.view.ViewRootImpl.doTraversal:3288 android.view.ViewRootImpl$TraversalRunnable.run:11344 android.view.Choreographer$CallbackRecord.run:1689 android.view.Choreographer$CallbackRecord.run:1698 android.view.Choreographer.doCallbacks:1153 android.view.Choreographer.doFrame:1079 android.view.Choreographer$FrameDisplayEventReceiver.run:1646 
12-15 23:35:50.397 12863 12863 I BLASTBufferQueue_Java: update, w= 1080 h= 2340 mName = ViewRootImpl@6b351c6[SettingsActivity] mNativeObject= 0xb400006fadbadf00 sc.mNativeObject= 0xb4000070d8e0f340 format= -1 caller= android.graphics.BLASTBufferQueue.<init>:89 android.view.ViewRootImpl.updateBlastSurfaceIfNeeded:3028 android.view.ViewRootImpl.relayoutWindow:10131 android.view.ViewRootImpl.performTraversals:4110 android.view.ViewRootImpl.doTraversal:3288 android.view.ViewRootImpl$TraversalRunnable.run:11344 
12-15 23:35:50.398 12863 12863 I ViewRootImpl@6b351c6[SettingsActivity]: Relayout returned: old=(0,0,1080,2340) new=(0,0,1080,2340) relayoutAsync=false req=(1080,2340)0 dur=9 res=0x403 s={true 0xb400006fdb4af000} ch=true seqId=0
12-15 23:35:50.398 12863 12863 D ViewRootImpl@6b351c6[SettingsActivity]: mThreadedRenderer.initialize() mSurface={isValid=true 0xb400006fdb4af000} hwInitialized=true
12-15 23:35:50.398 12863 12863 D ViewRootImpl@6b351c6[SettingsActivity]: reportNextDraw android.view.ViewRootImpl.performTraversals:4718 android.view.ViewRootImpl.doTraversal:3288 android.view.ViewRootImpl$TraversalRunnable.run:11344 android.view.Choreographer$CallbackRecord.run:1689 android.view.Choreographer$CallbackRecord.run:1698 
12-15 23:35:50.398 12863 12863 I ViewRootImpl@6b351c6[SettingsActivity]: Setup new sync=wmsSync-ViewRootImpl@6b351c6[SettingsActivity]#62
12-15 23:35:50.398 12863 12863 I ViewRootImpl@6b351c6[SettingsActivity]: Creating new active sync group ViewRootImpl@6b351c6[SettingsActivity]#63
12-15 23:35:50.399 12863 12863 I ViewRootImpl@6b351c6[SettingsActivity]: registerCallbacksForSync syncBuffer=false
12-15 23:35:50.439 12863 12950 I ViewRootImpl@6b351c6[SettingsActivity]: Received frameDrawingCallback syncResult=0 frameNum=1.
12-15 23:35:50.439 12863 12950 I ViewRootImpl@6b351c6[SettingsActivity]: mWNT: t=0xb400006fadb2e680 mBlastBufferQueue=0xb400006fadbadf00 fn= 1 mRenderHdrSdrRatio=1.0 caller= android.view.ViewRootImpl$8.onFrameDraw:13841 android.view.ThreadedRenderer$1.onFrameDraw:792 <bottom of call stack> 
12-15 23:35:50.439 12863 12950 I ViewRootImpl@6b351c6[SettingsActivity]: Setting up sync and frameCommitCallback
12-15 23:35:50.442 12863 12917 I BLASTBufferQueue: [ViewRootImpl@6b351c6[SettingsActivity]#25](f:0,a:0,s:0) onFrameAvailable the first frame is available
12-15 23:35:50.443 12863 12917 I ViewRootImpl@6b351c6[SettingsActivity]: Received frameCommittedCallback lastAttemptedDrawFrameNum=1 didProduceBuffer=true
12-15 23:35:50.443 12863 12863 I ViewRootImpl@6b351c6[SettingsActivity]: reportDrawFinished seqId=0
12-15 23:35:50.451 12863 12863 I ViewRootImpl@6b351c6[SettingsActivity]: handleWindowFocusChanged: 1 0 call from android.view.ViewRootImpl.-$$Nest$mhandleWindowFocusChanged:0
12-15 23:35:50.451 12863 12863 D ViewRootImpl@6b351c6[SettingsActivity]: mThreadedRenderer.initializeIfNeeded()#2 mSurface={isValid=true 0xb400006fdb4af000}
12-15 23:35:50.452 12863 12863 D IntegrationRepository: isAppLocked(): false. (LockEnabled: false, appActive: false, expireMillis: 1734302148115, currentMillis: 1734302150452)
12-15 23:35:50.452 12863 12863 D IntegrationRepository: setAppActive(): true
12-15 23:35:50.452 12863 12863 D InputMethodManagerUtils: startInputInner - Id : 0
12-15 23:35:50.452 12863 12863 I InputMethodManager: startInputInner - IInputMethodManagerGlobalInvoker.startInputOrWindowGainedFocus
12-15 23:35:50.457 12863 15395 I ViewRootImpl@6b351c6[SettingsActivity]: Resizing android.view.ViewRootImpl@553b44c: frame = [0,0][1080,2340] reportDraw = false forceLayout = false syncSeqId = -1
12-15 23:35:50.459 12863 12863 I InsetsSourceConsumer: applyRequestedVisibilityToControl: visible=false, type=ime, host=io.homeassistant.companion.android/io.homeassistant.companion.android.settings.SettingsActivity
12-15 23:35:50.459 12863 12863 I ViewRootImpl@6b351c6[SettingsActivity]: handleResized, msg = 4 frames=ClientWindowFrames{frame=[0,0][1080,2340] display=[0,0][1080,2340] parentFrame=[0,0][0,0]} forceNextWindowRelayout=false displayId=0 dragResizing=false compatScale=1.0 frameChanged=false attachedFrameChanged=false configChanged=false displayChanged=false compatScaleChanged=false
12-15 23:35:50.880 12863 12961 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:50.883 12863 12961 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:50.886 12863 12961 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:50.888 12863 12961 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: true, usesWifi is: true
12-15 23:35:50.888 12863 12961 D WebSocketRepository: Sending message 26: {type=ping, id=26}
12-15 23:35:50.889 12863 12961 D WebSocketRepository: Message number 26 sent
12-15 23:35:50.906 12863 12970 D WebSocketRepository: Websocket: onMessage (text)
12-15 23:35:50.907 12863 12970 D WebSocketRepository: Message number 26 received
12-15 23:35:51.299 12863 12863 I ViewRootImpl@6b351c6[SettingsActivity]: ViewPostIme pointer 0
12-15 23:35:51.380 12863 12863 I ViewRootImpl@6b351c6[SettingsActivity]: ViewPostIme pointer 1
12-15 23:35:51.387 12863 12959 D LogcatReader: Read logcat for pid 12863

Log; Me spamming the widget window.

@Palleri Palleri added the bug Something isn't working label Dec 15, 2024
@dshokouhi
Copy link
Member

The background is meant to be transparent that's as designed. Based on the logs the image was retrieved successfully. Is the image not loading?

@dshokouhi dshokouhi added question Further information is requested widget labels Dec 15, 2024
@Palleri
Copy link
Author

Palleri commented Dec 15, 2024

Screenshot_20241215_235001_One UI Home

Screenshot_20241215_234953_Home Assistant

No the image is not loading.
It should be an image of my baby crib where i have installed the camera

@dshokouhi
Copy link
Member

Hmm can you try another camera? I don't see any issues on my end. Does the camera provide a snapshot image or just a steam?

@Palleri
Copy link
Author

Palleri commented Dec 15, 2024

Ive tried every camera entity I own.
A vaccum, another cameras.

I dont really know if it provides a snapshot image by default. It has something called snapshot but i dont know if it counts as just a snapshot.

The image i am referring to is called image.babycam-[cat] in this case cuase it was "detecting" a cat in the last snapahot. So i dont think that one counts as a real snapshot. I donno.

@dshokouhi
Copy link
Member

Can you share the attributes for the camera so we can see what it has?

@Palleri
Copy link
Author

Palleri commented Dec 15, 2024

Screenshot_20241216_000943_Home Assistant

Thank you for taking your time to help me.
I hope this is what you mean.

Other than that this is the state

motion_detection: true
frontend_stream_type: web_rtc
client_id: frigate
camera_name: Babycam-live
device_class: camera
entity_picture: >-
  /api/camera_proxy/camera.babycam_live?token=accesstoken
friendly_name: Babycam-Live
supported_features: 2

@Palleri
Copy link
Author

Palleri commented Dec 15, 2024

If I browse to the url posted in the last comment i do see an image of the actual feed.

@dshokouhi
Copy link
Member

If I browse to the url posted in the last comment i do see an image of the actual feed.

does it load in a browser from the same device?

@Palleri
Copy link
Author

Palleri commented Dec 15, 2024

Yes

@dshokouhi
Copy link
Member

hopefully not the same issue as #4469 anythng else to know about your device? are you using the stock launcher?

@dshokouhi
Copy link
Member

i would also check HA core errors too there may be something there

@Palleri
Copy link
Author

Palleri commented Dec 15, 2024

Hm looks like exactly that.
Im using MTLS with an nginx proxy. I use it for all my services and have been doing it for a long while.

Im using the stock launcher. If you are refering to "non rooted"

@Palleri
Copy link
Author

Palleri commented Dec 15, 2024

Nothing in core logs. Completly empty after I cleared it and tried again.

@Palleri
Copy link
Author

Palleri commented Dec 15, 2024

I saw there was a discussion about notifications aswell.
I tried earlier to send a notify to the same phone with an image of a camera detecting something and that worked flawless. I could se the image in the notification.

@dshokouhi
Copy link
Member

the fact that the entity_picture URL works in a browser but not in the widget is not a good sign thats exactly what we use to display the image.

https://github.com/home-assistant/android/blob/master/app/src/main/java/io/homeassistant/companion/android/widgets/camera/CameraWidget.kt#L196

I tried earlier to send a notify to the same phone with an image of a camera detecting something and that worked flawless. I could se the image in the notification.

not quite the same as loading the mage in a widget just tells us the URL works there and we can get the image

have you tried checking for updates and/or restarting the device?

@dshokouhi
Copy link
Member

as your camera is not providing an SVG image its not related to the other issue

@Palleri
Copy link
Author

Palleri commented Dec 15, 2024

Ah okey, there is an updare actually for my phone. I will update my phone will come back to you.
Recently restarted my device, both before and after trying multiple times.

@Palleri
Copy link
Author

Palleri commented Dec 15, 2024

Unfortunately that did not work.

@dshokouhi
Copy link
Member

cant really think of anything else asides from trying a debug build which adds more logging to see if there is another issue at play here.

to do that you can extract the APK from the following github action and sideload the debug build then replicate the issue and get the app logs, you can use the full or minimal version here. The app will install side by side production and wont interfere, i recommend giving a unique name so you can remove it later easily . The app will have a red icon to help distinguish it.

https://github.com/home-assistant/android/actions/runs/12323221681

given the logs show the image was fetched successfully have my doubts this will yield different results.

12-15 23:35:49.657 12863 12863 D CameraWidget: Fetching camera image
12-15 23:35:49.658 12863 12863 I AppWidgetManager: updateAppWidget() appWidgetIds = [37]
12-15 23:35:49.659 12863 12863 D CameraWidget: Fetch and load complete

@Palleri
Copy link
Author

Palleri commented Dec 16, 2024

12-16 01:02:35.933 22964 22964 D ServerConnectionInfo: Using external URL
12-16 01:02:35.933 22964 22964 D CameraWidget: Fetching camera image
12-16 01:02:35.934 22964 22964 I AppWidgetManager: updateAppWidget() appWidgetIds = [45]
12-16 01:02:35.937 22964 22964 D Picasso : Main        created      [R7] Request{https://*****.***/api/camera_proxy/camera.babycam_live?token=TOKEN resize(1080,0)}
12-16 01:02:35.937 22964 22964 D CameraWidget: Fetch and load complete








12-16 01:02:35.933 22964 22964 D CameraWidget: Fetching camera image
12-16 01:02:35.934 22964 22964 I AppWidgetManager: updateAppWidget() appWidgetIds = [45]
12-16 01:02:35.937 22964 22964 D Picasso : Main        created      [R7] Request{https://*******/api/camera_proxy/camera.babycam_live?token=TOKEN resize(1080,0)}
12-16 01:02:35.937 22964 22964 D CameraWidget: Fetch and load complete
12-16 01:02:35.938 22964 27255 D Picasso : Dispatcher  enqueued     [R7]+1ms 
12-16 01:02:35.939 22964 27300 D Picasso : Hunter      executing    [R7]+2ms 
12-16 01:02:35.942 22964 27255 D Picasso : Dispatcher  delivered    [R5]+233ms, [R6]+110ms 
12-16 01:02:35.943 22964 22964 D Picasso : Main        errored      [R5]+234ms HTTP 400
12-16 01:02:35.944 22964 22964 D Picasso : Main        errored      [R6]+111ms HTTP 400
12-16 01:02:35.973 22964 27255 D Picasso : Dispatcher  batched      [R7]+35ms for error
12-16 01:02:36.175 22964 27255 D Picasso : Dispatcher  delivered    [R7]+237ms 
12-16 01:02:36.176 22964 22964 D Picasso : Main        errored      [R7]+237ms HTTP 400
12-16 01:02:36.811 22964 22964 I ViewRootImpl@d5b6015[SettingsActivity]: handleAppVisibility mAppVisible = false visible = true
12-16 01:02:36.813 22964 22964 I ViewRootImpl@d5b6015[SettingsActivity]: stopped(false) old = true
12-16 01:02:36.813 22964 22964 D ViewRootImpl@d5b6015[SettingsActivity]: WindowStopped on io.homeassistant.companion.android.minimal.debug/io.homeassistant.companion.android.settings.SettingsActivity set to false
12-16 01:02:36.821 22964 22964 D IntegrationRepository: isAppLocked(): false. (LockEnabled: false, appActive: false, expireMillis: 1734307340674, currentMillis: 1734307356821)







12-16 01:02:35.282 22964 26843 I okhttp.OkHttpClient: strict-transport-security: max-age=31536000; includeSubDomains
12-16 01:02:35.283 22964 26843 I okhttp.OkHttpClient: {"entity_id":"camera.babycam_live","state":"streaming","attributes":{"access_token":"TOKEN","motion_detection":true,"frontend_stream_type":"web_rtc","client_id":"frigate","camera_name":"Babycam-live","device_class":"camera","entity_picture":"/api/camera_proxy/camera.babycam_live?token=TOKEN","friendly_name":"Babycam-Live","supported_features":2},"last_changed":"2024-12-15T18:24:51.480126+00:00","last_reported":"2024-12-16T00:01:06.214139+00:00","last_updated":"2024-12-16T00:01:06.214139+00:00","context":{"id":"01JF6C9FN6DS0QC3078G8G7WEQ","parent_id":null,"user_id":null}}
12-16 01:02:35.283 22964 26843 I okhttp.OkHttpClient: <-- END HTTP (21ms, 693-byte body)

EDIT

@dshokouhi
Copy link
Member

looks like its failing there

12-16 01:02:35.943 22964 22964 D Picasso : Main        errored      [R5]+234ms HTTP 400
12-16 01:02:35.944 22964 22964 D Picasso : Main        errored      [R6]+111ms HTTP 400
12-16 01:02:35.973 22964 27255 D Picasso : Dispatcher  batched      [R7]+35ms for error
12-16 01:02:36.175 22964 27255 D Picasso : Dispatcher  delivered    [R7]+237ms 
12-16 01:02:36.176 22964 22964 D Picasso : Main        errored      [R7]+237ms HTTP 400

based on

Im using MTLS with an nginx proxy.

can you check the proxy config maybe something is not setup properly there? as far as the app is concerned we should not have anything blocked. Although it is strange its working elsewhere 🤔

https://companion.home-assistant.io/docs/troubleshooting/networking#addendum-reverse-proxy-via-nginx

you dont see any auth errors in HA? a 400 error points to auth but here the token should be good enough 🤷

@Palleri
Copy link
Author

Palleri commented Dec 16, 2024

Hi, i just discovered something similar to the issue I was having with the assist function that my AI cannot talk back to me through the phone because the app does not send the client certificate in the request.

[16/Dec/2024:09:24:12 +0100] - - 400 - GET https URL "/api/camera_proxy/camera.babycam_live?token=TOKEN" [Client 192.168.1.159] [Length 230] [Gzip -] [Sent-to ] "okhttp/5.0.0-alpha.14" "-" [Client-Cert -]
[16/Dec/2024:09:24:12 +0100] - 200 200 - GET https URL "/api/states/camera.babycam_live" [Client 192.168.1.159] [Length 695] [Gzip -] [Sent-to HA_IP] "Home Assistant/2024.12.1-14604 (Android 14; SM-S911B)" "-" [Client-Cert CN=CLIENT_CERT]
[16/Dec/2024:09:24:12 +0100] - - 400 - GET https URL "/api/camera_proxy/camera.babycam_live?token=TOKEN" [Client 192.168.1.159] [Length 230] [Gzip -] [Sent-to ] "okhttp/5.0.0-alpha.14" "-" [Client-Cert -]
[16/Dec/2024:09:24:12 +0100] - 200 200 - GET https URL "/api/states/camera.babycam_live" [Client 192.168.1.159] [Length 695] [Gzip -] [Sent-to HA_IP] "Home Assistant/2024.12.1-14604 (Android 14; SM-S911B)" "-" [Client-Cert CN=CLIENT_CERT]
2024/12/16 09:24:12 [warn] 20#20: *172755 using uninitialized "server" variable while logging request, client: 192.168.1.159, server: URL, request: "GET /api/camera_proxy/camera.babycam_live?token=TOKEN HTTP/2.0", host: "URL"
2024/12/16 09:24:12 [warn] 20#20: *172755 using uninitialized "server" variable while logging request, client: 192.168.1.159, server: URL, request: "GET /api/camera_proxy/camera.babycam_live?token=TOKEN HTTP/2.0", host: "URL"
[16/Dec/2024:09:24:11 +0100] - - 400 - GET https URL "/api/camera_proxy/camera.babycam_live?token=TOKEN" [Client 192.168.1.159] [Length 230] [Gzip -] [Sent-to ] "okhttp/5.0.0-alpha.14" "-" [Client-Cert -]
[16/Dec/2024:09:24:11 +0100] - 200 200 - GET https URL "/api/states/camera.babycam_live" [Client 192.168.1.159] [Length 695] [Gzip -] [Sent-to HA_IP] "Home Assistant/2024.12.1-14604 (Android 14; SM-S911B)" "-" [Client-Cert CN=CLIENT_CERT]
[16/Dec/2024:09:24:10 +0100] - - 400 - GET https URL "/api/camera_proxy/camera.babycam_live?token=TOKEN" [Client 192.168.1.159] [Length 230] [Gzip -] [Sent-to ] "okhttp/5.0.0-alpha.14" "-" [Client-Cert -]
[16/Dec/2024:09:24:10 +0100] - 200 200 - GET https URL "/api/states/camera.babycam_live" [Client 192.168.1.159] [Length 695] [Gzip -] [Sent-to HA_IP] "Home Assistant/2024.12.1-14604 (Android 14; SM-S911B)" "-" [Client-Cert CN=CLIENT_CERT]
[16/Dec/2024:09:24:09 +0100] - - 400 - GET https URL "/api/camera_proxy/camera.babycam_live?token=TOKEN" [Client 192.168.1.159] [Length 230] [Gzip -] [Sent-to ] "okhttp/5.0.0-alpha.14" "-" [Client-Cert -]
[16/Dec/2024:09:24:09 +0100] - 200 200 - GET https URL "/api/states/camera.babycam_live" [Client 192.168.1.159] [Length 695] [Gzip -] [Sent-to HA_IP] "Home Assistant/2024.12.1-14604 (Android 14; SM-S911B)" "-" [Client-Cert CN=CLIENT_CERT]
[16/Dec/2024:09:24:09 +0100] - - 400 - GET https URL "/api/camera_proxy/camera.babycam_live?token=TOKEN" [Client 192.168.1.159] [Length 230] [Gzip -] [Sent-to ] "okhttp/5.0.0-alpha.14" "-" [Client-Cert -]

This might be the same kind of issue.
The client cert is not being forwarded here.

[16/Dec/2024:09:24:09 +0100] - - 400 - GET https URL "/api/camera_proxy/camera.babycam_live?token=TOKEN" [Client 192.168.1.159] [Length 230] [Gzip -] [Sent-to ] "okhttp/5.0.0-alpha.14" "-" [Client-Cert -]
This indicate that the Client-Cert is empty.

[Client-Cert CN=CLIENT_CERT]
This indicate that the client cert is being forwarded, i redacted the name of the certificate here.


Old issue

The problem

While using MTLS with companion app the piper TTS failed to play the response when using assist on android. I am using a dedicated NGNX proxy server, not as an addon to hassio. NGINX log: [02/Sep/2024:10:19:02 +0200] - - 400 - GET https ***.***.*** "/api/tts_proxy/104c89b5f9053e4751d03002aab527c96124bd77_en-us_894b186240_tts.piper.mp3" [Client 192.168.1.159] [Length 230] [Gzip -] [Sent-to ] "stagefright/1.2 (Linux;Android 14)" "-" [Client-Cert -]

Client certificate is empty [Client-Cert -] I have the latest version of Android system webview on the client.

I am getting HTTP error 400 due to the lack of client certificate not being sent.

When I disable the MTLS on my NGINX its working and I can hear the response on my android and the log looks like this:

[02/Sep/2024:10:57:14 +0200] - 200 200 - GET https ***.***.*** "/api/tts_proxy/cb0d3bdc54e7744cb0fb34691b93ac44aaf9123d_en-us_894b186240_tts.piper.mp3" [Client 192.168.1.159] [Length 13141] [Gzip -] [Sent-to ***.***.***] "stagefright/1.2 (Linux;Android 14)" "-" [Client-Cert -]

Here the client certificate is being used displayed in the log [Client-Cert CN=BOB] when using a browser as it should look like.

[02/Sep/2024:10:28:11 +0200] - 200 200 - GET https ***.***.*** "/api/tts_proxy/cb0d3bdc54e7744cb0fb34691b93ac44aaf9123d_en-us_894b186240_tts.piper.mp3" [Client ***.***.***] [Length 13141] [Gzip -] [Sent-to ***.***.***] "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:129.0) Gecko/20100101 Firefox/129.0" "https://***.***.***/lovelace-***/default_view" [Client-Cert CN=BOB]

I do also have a wyoming satellite and the voice is being played back on that device. This device is not using client certificate because it is connected directly to the wyoming-protocol and not through the nginx proxy.

home-assistant/core#125073 (comment)

@Palleri
Copy link
Author

Palleri commented Dec 16, 2024

Hi, it works if I go around the nginx proxy and directly to the HA host (without MTLS)
I used the APK install I got from you to test with.


EDIT:

nginx.conf

server {
	set $server	HA-ip;
        server_name     HA-name;
        listen          443 ssl;
        http2           on;
        ssl_certificate             /etc/nginx/ssl/cert.pem;
        ssl_certificate_key         /etc/nginx/ssl/key.key;
        include                     /etc/nginx/ssl-verify.conf;
        include                     ssl-withoutcert.conf;
        proxy_http_version 1.1;
        proxy_set_header   Upgrade    $http_upgrade;
        proxy_set_header   Connection "upgrade";
        proxy_redirect     off;

        location / {
            proxy_pass          http://HA-ip;
            proxy_http_version 1.1;
	    proxy_set_header    Upgrade  $http_upgrade;
	    proxy_set_header    Connection  "upgrade";
            include             common_location.conf;
            #include             /etc/nginx/ssl-cn.conf;

        }

    }

ssl-verify.conf

ssl_client_certificate      /etc/nginx/ssl/ca.pem;
ssl_verify_client           on;

ssl-withoutcert.conf
I am using this file because I am using a wildcard cert on this nginx proxy and this way I can separate the different domains being used.

ssl_protocols TLSv1.2 TLSv1.3;  
ssl_ciphers ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-CCM:DHE-RSA-AES256-CCM8:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-CCM:DHE-RSA-AES128-CCM8:DHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256; 
ssl_prefer_server_ciphers on; 
ssl_dhparam                 /etc/nginx/ssl/dhparam.pem;
ssl_session_timeout         10m;
ssl_session_cache           shared:SSL:10m;
ssl_session_tickets         off;
#ssl_stapling                on;
#ssl_stapling_verify         on;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;

common_location.conf

add_header Strict-Transport-Security    "max-age=31536000; includeSubDomains" always;
add_header X-Frame-Options              SAMEORIGIN;
add_header X-Content-Type-Options       nosniff;
add_header X-XSS-Protection             "1; mode=block";
add_header Content-Security-Policy "object-src 'none'; base-uri 'none'; require-trusted-types-for 'script'; frame-ancestors 'self';";
add_header Content-Security-Policy "frame-ancestors 'self';";

@dshokouhi
Copy link
Member

Hi, it works if I go around the nginx proxy and directly to the HA host (without MTLS)

This means whatever fix needs to happens either needs to happen on the server or with the MTLS setup. The app can't help with that.

@dshokouhi dshokouhi closed this as not planned Won't fix, can't repro, duplicate, stale Dec 16, 2024
@jpelgrom
Copy link
Member

Hi, it works if I go around the nginx proxy and directly to the HA host (without MTLS)

This means whatever fix needs to happens either needs to happen on the server or with the MTLS setup. The app can't help with that.

No? The issue appears to be that Picasso (for the widget) isn't using the client certificate correctly, which is something the app should try to fix as it claims to support client certificates.

@dshokouhi dshokouhi reopened this Dec 16, 2024
@dshokouhi
Copy link
Member

Hi, it works if I go around the nginx proxy and directly to the HA host (without MTLS)

This means whatever fix needs to happens either needs to happen on the server or with the MTLS setup. The app can't help with that.

No? The issue appears to be that Picasso (for the widget) isn't using the client certificate correctly, which is something the app should try to fix as it claims to support client certificates.

Good call 🙏 did not consider that 🤦

Based on a brief Google I can see: https://stackoverflow.com/questions/42166667/is-there-a-way-to-enable-tls-1-2-in-picasso-library-on-older-devices

I personally do not have a TLS setup so may not be the best to test this but I think we should probably also log the error if possible so we dont have to jump through hoops to get a proper log :)

@Palleri
Copy link
Author

Palleri commented Dec 16, 2024

Hi, it works if I go around the nginx proxy and directly to the HA host (without MTLS)

This means whatever fix needs to happens either needs to happen on the server or with the MTLS setup. The app can't help with that.

No? The issue appears to be that Picasso (for the widget) isn't using the client certificate correctly, which is something the app should try to fix as it claims to support client certificates.

I was thinking the same.
Ive seen this with the assist function as well. Really dont know if this is just me, but if someone could try to reproduce the issue.

I think I will test with nginx proxy manager just to make sure my config is not the culprit.

@jpelgrom jpelgrom changed the title Camera widget are transparent Camera widget fails to load snapshot with mTLS setup Dec 16, 2024
@dshokouhi dshokouhi removed the question Further information is requested label Dec 16, 2024
@dshokouhi
Copy link
Member

Ive seen this with the assist function as well

Would you be able to log a separate bug for this with corresponding logs? This particular issue is related to a library we use to load images into the widget. Assist uses completely different stuff :)

For clarity if you use other features of the app that integrate with Android features like a entity state widget or device controls they still work right?

@Palleri
Copy link
Author

Palleri commented Dec 16, 2024

Ive seen this with the assist function as well

Would you be able to log a separate bug for this with corresponding logs? This particular issue is related to a library we use to load images into the widget. Assist uses completely different stuff :)

For clarity if you use other features of the app that integrate with Android features like a entity state widget or device controls they still work right?

Yeah absolutely sorry my bad.

@jpelgrom
Copy link
Member

@Palleri Would you be willing and able to test if the changes from #4911 resolve your issue? You can get an apk from the artifacts file here: https://github.com/home-assistant/android/actions/runs/12360564443?pr=4911, similar to when you used a debug build.

@Palleri
Copy link
Author

Palleri commented Dec 16, 2024

@Palleri Would you be willing and able to test if the changes from #4911 resolve your issue? You can get an apk from the artifacts file here: https://github.com/home-assistant/android/actions/runs/12360564443?pr=4911, similar to when you used a debug build.

Good job, that worked!

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

Successfully merging a pull request may close this issue.

3 participants