clariusdev / mobileapi

Android API Allowing IPC with the Clarius App
https://www.clarius.com
BSD 3-Clause "New" or "Revised" License
12 stars 4 forks source link

PA HD automatically turns off after 10 minutes with mobileapi #8

Closed daudrain closed 2 years ago

daudrain commented 3 years ago

While doing many test sessions with our app integrating mobileapi with 2 PA HD probes, both probes turns off themselves after a 10 minutes session.

The same test has been performed using only Clarius Android App, and the probes didn't turn off.

Is there any specific limitation when an another app integrating mobileapi?

Thank you

clariusk commented 3 years ago

there is nothing in the api that controls/affects probe shutdown. if the probe was frozen for a certain period, battery drained, etc, then it will shut down automatically. you should monitor the clarius app when this happens to see what messages appear.

daudrain commented 3 years ago

Hi @clariusk,

The same test has been performed many times using Clarius QuickStart application + the C3 Virtual Scanner in Clarius App.

julien-l commented 3 years ago

Hi, in normal operations (when the Mobile API service is not running), the Clarius App puts the scanner in sleep mode as soon as it goes in the background, to save battery. This behaviour changes when a 3rd party app connects to the the Mobile API: the app will keep the scanner alive even when it's in the background, to accommodate user workflows where the 3rd party app is in the foreground. This should remain true as long as the Mobile API service is running and the scanner is imaging.

To help us reproduce the issue, can you indicate:

Thanks.

daudrain commented 3 years ago

Hi, Contact detection delay: 3 seconds Auto freeze delay: Never Keep awake delay: 2 minutes

I've no idea if the service initiated by Clarius QuickStart or our app did disconnect. It always happens around 10 minutes.

julien-l commented 3 years ago

The QuickStart app's logs should show if it disconnected.

Can you reproduce the behaviour with the original QuickStart app or did you make modifications?

daudrain commented 3 years ago

I did reproduce with the original one fetched from this repository.

daudrain commented 3 years ago

There is no log indicating Clarius QuickStart gets disconnected:

2021-06-23 10:20:40.694 27783-27783/me.clarius.example V/MobileApiHelper: Connecting to Clarius service, package: me.clarius.clarius class: me.clarius.mobileapi.MobileApiService
2021-06-23 10:20:40.707 27783-27783/me.clarius.example V/MobileApiHelper: Service connected
2021-06-23 10:20:40.707 27783-27783/me.clarius.example V/MobileApiHelper: Registering messenger
2021-06-23 10:20:40.708 27783-27783/me.clarius.example V/MobileApiHelper: Return status for: REGISTER: 0
2021-06-23 10:20:40.717 27783-27783/me.clarius.example V/MobileApiHelper: Sending image config 400x400 jpeg 80 separateOverlay=false
2021-06-23 10:20:40.724 27783-27783/me.clarius.example V/MobileApiHelper: Return status for: CONFIGURE_IMAGE: 0

However a toast is displayed when Clarius QuickStart stops getting images after 10 minutes: Screenshot from 2021-06-23 13-48-11

clariusk commented 3 years ago

an update, we found some code that disconnects probes after 10 minutes of the Clarius App being backgrounded, this has been addressed for the next s/w rev.

daudrain commented 2 years ago

Hi Clarius support,

We're observing the same behavior with versions 8.6.0 and 9.1.0. The probe does turn off after 10 minutes when used via mobile API.

Recently we've increased usage of our probes via Mobile API as we were previously using them mostly via libcast. And we often do 10+ minutes session with our Android app and Clarius app in background.

Do you plan to fix it?

Thank you, David

clariusk commented 2 years ago

thanks, it should have been fixed, we'll run some tests.

julien-l commented 2 years ago

Hi @daudrain we were able to reproduce your issue, we will investigate and provide a fix soon. Thanks for reporting!

julien-l commented 2 years ago

Hello @daudrain we were able to reproduce the issue and developed a fix which will be included in the next release (version 9.3.0). This will be a "pilot" only release (https://support.clarius.com/hc/en-us/articles/360019548852-Joining-the-Pilot-Program), it should not be released on the app stores.

Details: the Clarius App starts an "idle timer" when it goes in the background to detect inactivity. It triggers after 10 minutes and shuts down the probe. Issue was: the app failed to kill the timer when the Mobile API was connected. Workaround: put the Clarius App in the foreground before the 10 minutes timeout to reset the timer.