OpenSeizureDetector / Android_Pebble_SD

The main OpenSeizureDetector Android App, that is published on the Android Play Store.
http://openseizuredetector.org.uk
GNU General Public License v3.0
9 stars 11 forks source link

Latch Alarms Function not Working Correctly (V4.2.x) #146

Closed jones139 closed 3 months ago

jones139 commented 4 months ago

New issue raised against the Android App

@seaside1 reported an issue against the Garmin Watch App (https://github.com/OpenSeizureDetector/Garmin_SD/issues/51). The issue appears to be with the Android App, so opening this issue and closing the one against the Garmin App.

Hi!

I'm starting to move over from Pebble to Garmin vivoactive 3. As far as I can tell the Latch Alarm is not working with Garmin (at least not working as it does with Pebble).

Using the same phone (Nexus 6P and also tested with Samsung S23 Ultra) For Pebble Alarm will sound throughout the entire period set in the latch alarm duration For Garmin Alarm will only sound periodically at start and then nothing.

Two recording of the problem one with a Garmin and one with a Pebble https://drive.google.com/file/d/1roXqGK2-mj0Zx3cSe7CazFF9POQZQAiB/view?usp=sharing https://drive.google.com/file/d/1rntG3Q1ySptkh_kfdx8lUF_EM6dmoMze/view?usp=sharing

jones139 commented 4 months ago

Thank you for the feedback - you have answered one of the things I have been wondering about, which is whether anyone was still using Pebble watches or not! (I was thinking of removing support for them in a future version of the Android App).

Latch Alarms is not a feature I ever use, so it is possible that I may have broken it and not noticed (this is another example of why I would like some automated tests for this app when I get the chance!).

I have just tested it using the PineTime watch (which is what I have set up for development at the moment), and Version 4.2.2 of the Android App, and it latches ok, but does not seem to un-latch after the specified time like it should, and pressing the Accept Alarm does not re-set it. I had to go into the phone Apps settings and force stop openseizuredetector to re-set it....so we have an issue there.

I'll test Garmin next, but I think this is an issue with the Android App rather than the watch app, so don't be alarmed if I close this issue and open another one in the Android App repository.

jones139 commented 4 months ago

With the Garmin version the latch again worked but did not timeout after the 30 seconds that I have set in the settings, but pressing Accept Alarm did re-set it correctly. So this is an issue with the Android App.

jones139 commented 4 months ago

@seaside1 As a separate issue, in the video, the Garmin watch is showing an ERR: Retry error message, which means it failed to send data to the phone for some reason (most likely a problem with bluetooth communications). Also towards the top of the screen near the time, the gap between receiving data is shown in seconds - it should be about 5 seconds, but I saw 10s and 13s in the video - again showing the data transfer is not working correctly. This is unrelated to the alarm latching issue

seaside1 commented 4 months ago

Yes you are right testing with another phone (S23 Ultra) I have initiall 8-9s but then goes down to 4-6 ish. And yes seems to be unrelated to Alarm Latching.

seaside1 commented 3 months ago

Latch Alarms working strange on Pinetime as well. See video: https://drive.google.com/file/d/1yZ8cQlXFcPevOVebzeTh5ml8DHtv2IUe/view?usp=sharing

Not possible to accept alarm when Latch is enabled.

jones139 commented 3 months ago

What an awful noise!

The reason it sounded so bad is the system did not shutdown properly when you changed the settings so there were essentially two versions of the android app running at once - please try doing a 'force stop' of OpenSeizureDetector or re-booting the phone and see if it behaves better.

The failure to shut down properly is probably something in the Bluetooth Data Source used for Pinetime, as I thought I had found all of the causes of it in the Garmin Data source (they are very difficult to find....)

Thanks for reporting these issues!

Graham

On Thu, 21 Mar 2024 at 19:44, seaside1 @.***> wrote:

Latch Alarms working strange on Pinetime as well. See video: https://drive.google.com/file/d/1yZ8cQlXFcPevOVebzeTh5ml8DHtv2IUe/view?usp=sharing

Not possible to accept alarm when Latch is enabled.

— Reply to this email directly, view it on GitHub https://github.com/OpenSeizureDetector/Android_Pebble_SD/issues/146#issuecomment-2013516873, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACLSY7NPQE7MJT5L6TZEELYZM2CDAVCNFSM6AAAAABEEGRGUKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJTGUYTMOBXGM . You are receiving this because you were assigned.Message ID: @.***>

-- Graham Jones http://google.com/+GrahamJones Hartlepool, UK.

jones139 commented 3 months ago

I think I can see the issue in the code - the alarm latch is keeping the display showing ALARM, but is not initiating the alarm sound if the system is not detecting an alarm condition. That whole piece of code is a bit complicated but I don't fancy doing a major re-hash in 4.2.x just now in case I break it, so I'll add another check in to see if we have a latched alarm, and if we do it will make a noise and try to send an SMS. I'll tidy the code up in V4.3

jones139 commented 3 months ago

Seems to be fixed in V4.2.3b - I have not been able to repeat the issue with PineTime - it seems to work the same for PineTime as for Garmin to me. Please try the draft version 4.2.3b here: https://github.com/OpenSeizureDetector/Android_Pebble_SD/blob/V4.2.x_latch/app/release/app-release-4.2.3b.apk and see if that fixes the issue for you.

seaside1 commented 3 months ago

Yes, I can confirm that 4.2.3b works. Great work! :)

jones139 commented 3 months ago

Thanks for confirming. I'll add that into the release of v4.2.3 - just a couple of other issues to include in it before I put it on Play store.