Coder Social home page Coder Social logo

urbandroid-team / sleep-as-android-garmin-addon Goto Github PK

View Code? Open in Web Editor NEW
45.0 45.0 14.0 19.1 MB

Code for both Android part and Garmin part of the Sleep as Android Garmin smartwatch integration

Java 54.67% Shell 0.53% Monkey C 43.73% JavaScript 1.08%
android garmin sleep

sleep-as-android-garmin-addon's People

Contributors

artaud avatar egroeg121 avatar gitter-badger avatar paulsd avatar petrnalevka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sleep-as-android-garmin-addon's Issues

Battery drain issues

Let's talk about the battery drain.

How big drain do you get on your watch model?
How big a drain is acceptable for you?
What might be the causes of the drain?
What might be done to lower it?

Disable alarm in app settings

It would be nice if I could disable the alarm feature (wehere you dismiss or snooze the current alarm on the watch.) in the app settings.

One reason is the issue #20 .
Bit I actually prefer to dismiss/snooze the alarm on my phone.

Watch freezes on stop tracking

I'm using current (today is 10.12.2018) released versions of SaA (beta), Garmin addon, Garmin watch app with a OnePlus 6 on Android Pie with a Garmin VA3.

Every time the tracking is stopped - no difference if it is stopped from the watch or phone - the watch freezes completely. It stucks at the screen "Tracking". I tried to get a log or something, but I were not able to access the watch anymore. The only way to "fix" it is by performing a cold restart (pressing 15 secs on the hardware button).

Edit: Don't know how to reference an issue in the correct way, so: Mentioned from Artaud

Streaming acceleromer data?

Sorry, this isn't an issue, but I was just wondering if you managed to find a way to stream accelerometer data from the watch to phone in real time?

Watch backlight turns on after a few seconds of movement

I'm not sure if this is intended or not but for the Fenix 5 the backlight will come on after some movement. I think this should be made into a setting because some people may not want it to wake the person next to them. It'd also be a good battery saver for people that move around a lot at night.

remove tones

tones may be behind some issues with alarm crashing as apparently tonesOn method is bugged

Investigate the connection between active watchface and HR crashing the app / watch

I believe the issues with heart rate and intermittent tracking aren't an actual Garmin issue, but in fact stem from a 3rd party watch face app. Specifically Actiface, Dozen Run, and others.

I first noticed the issue about 8-10 months ago when I installed dozen run. That app not only broke the heart rate tracking in Sleep As, but also broke sleep tracking in Garmin's native app. All returned to normal after uninstalling dozen run. Esstentially the same thing happened when I installed Actiface and Watch II. Uninstalled those and again things returned to normal. Since then, you removed its hr tracking, so I reinstalled Actiface, which promptly broke Garmin's native tracking. I then upgraded the firmware to 4.3 and uninstalled Actiface and Watch II. Again, the native tracking has returned, but only sporadically, so it is possible there is a FW issue as well, Sleep As Android tracking still works 100% of the time however. Sorry I can't provide any more technical details, but maybe this will help a little.

HS # 58274

UnexpectedTypeException in onTap crash

Thanks to @MrFly, we've got a bug to squash .]


Error: Unhandled Exception
Time: 2018-10-16T19:38:28Z
Part-Number: 006-B2700-00
Firmware-Version: '5.40'
Language-Code: deu
ConnectIQ-Version: 3.0.3
Filename: 201809~1
Appname: Sleep
Message: 'UnexpectedTypeException: Expected Number/Float/Long/Double, given null/Float'
Stack:

  • pc: 0x1000276c
    File: '/home/artaud/prog/urbandroid/source/SleepGarmin/SleepGarmin-watch/source/SleepMainDelegate.mc'
    Line: 55
    Function: onTap
  • pc: 0x30001d0d

_Originally posted by @MrFly in https://github.com/urbandroid-team/Sleep-as-Android-Garmin-Addon/issues/10#issuecomment-430877353_

show pulse while sleep tracking

I would like to see my pulse on the display while the app is active.

I guess this should be an option in the app settings to en/disable.
Maybe even set an update interval.

Testing the Sensor causes an exception on the watch

Details
Device: Vivoactive HR+ (SW version 4.40)
Sleep version: 20180613
Sleep Garmin version: 20170725
Garmin Connect IQ app version: 20170103-upd5

Symptom
I had just installed the app add-ons and app onto my watch today and once I had it all set up and connected, ran the "Test Sensors" in the Sleep app. The watch buzzed with the prompt "Launch Sleep (Yes/No)". I tap "Yes" and the Connect IQ Error screen pops up (black screen, stylized "IQ" in the middle with a red circle and exclamation mark). After a few seconds, a slightly different "Launch Sleep" menu appears. Cycle repeats ad-nauseum.

I would provide a stacktrace or something, but nothing no additional files related to the app exists.

Rename Graphs in sidebar

I was often kinda misoriented in the app. Renaming "Graphs" to something like "Graphs/History" would have helped.

Thanks in advance!

Build failed

`FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task :app:mergeDebugResources.

Could not resolve all files for configuration :app:debugRuntimeClasspath.
Could not find com.urbandroid:common:1.23.
Searched in the following locations:
- https://jcenter.bintray.com/com/urbandroid/common/1.23/common-1.23.pom
- https://jcenter.bintray.com/com/urbandroid/common/1.23/common-1.23.aar
- https://dl.google.com/dl/android/maven2/com/urbandroid/common/1.23/common-1.23.pom
- https://dl.google.com/dl/android/maven2/com/urbandroid/common/1.23/common-1.23.aar
- file:/home/chakaponden/.m2/repository/com/urbandroid/common/1.23/common-1.23.pom
- file:/home/chakaponden/.m2/repository/com/urbandroid/common/1.23/common-1.23.aar
- https://repo.maven.apache.org/maven2/com/urbandroid/common/1.23/common-1.23.pom
- https://repo.maven.apache.org/maven2/com/urbandroid/common/1.23/common-1.23.aar
- file:/home/chakaponden/Sleep-as-Android-Garmin-Addon/SleepGarmin-android/app/libs/common-1.23.aar
- file:/home/chakaponden/Sleep-as-Android-Garmin-Addon/SleepGarmin-android/app/libs/common.aar
Required by:
project :app`

Latest Android Studio 3.6.3

Sleep tracking crashes about a quarter into the night

Since the rewrite was released everything was working for me. Just recently things stopped working and now sleep tracking crashes a few hours after I've fallen asleep. I wake up in the morning to see my watch on my default widget. This happens regardless of how I start tracking (from the phone/watch) and is now consistent every time I use the app. I've tried to look for logs in the device but didn't see anything from this addon. I did find something in the ERR_LOG.TXT file under GARMIN/DEBUG:

2697 (fenix 5) SW ver: 1000
Build Type: RELEASE
Commit:bef5fea663aeec52575bd5b5b91e2d15afc92b7d
ESN: 3962006839
10/07/18 02:17:42
RTL
errnum: 0x00a
r0: 0x2005bd40
r1: 0x00000063
r2: 0x0000007e
r3: 0x0000007f
r4: 0x000a4a49
Stack frame PC, SP: 0x000cceb9, 0x2005b948
Call Stack - SP at 0x2005b948:
	0x000704cf
	0x000a4a49
	0x0008cba5
	0x000a4a49
	0x000a4a49
	0x0008d82d
	0x000a551d
	0x0001011d
	0x0000b475
	0x00070675
	0x0008d82d
	0x0008d82d
	0x0008d6bd
	0x00020075
	0x000a4c89
	0x00027983
	0x0002621b
	0x0001fdeb
	0x0008d82d
	0x0008d6bd
	0x0008d6db
	0x0008e9a5
	0x0004f255
	0x0004f0ad
	0x0005d523
	0x00011985
	0x0005d571
	0x0005d57d
	0x0008ea8b
	0x000e5b47
	0x0008b80d
	0x00000000
Uptime: 4880819

It looks like I should be seeing a log file specifically for the app.
If you guys make another release with logging enabled I'd be happy to share the logs and help debug the issue.

Watch crash on every first start on a given day on some watches

As mentioned by @MrFly in #10 (comment)

On some watch models the first start on a given day always results in an app crash (IQ logo shows on the watch screen).

Further start attempts do not crash the app - the app is able to work normally.

Whoever is able to reproduce it, please comment with your watch model and ideally attach a crash log from the watch (/GARMIN/APPS/LOGS/CIQ_LOG.txt).

Unable to Debug the watch app using the ConnectIQ Simulator and the Android Emulator

Hi, I tried to debug the application for the watch and the companion Android app so that I can try some things regarding battery saving but unfortunately I failed to create my development setup for both apps.

I am able to start the watch app using the Connect IQ simulator through VS Code, and I am also able to start the Android app in my emulated Android device (Pixel 5 API 28, SleepAsAndroid is installed). I set the debug values in both apps to true, so it uses the tethered connection. I can also connect both using ADB. When debugging the Android app I see that the Simulator device is recognized and connected, however no messages are sent between the two emulated devices. I think this has to do with the Android app not recognizing that the watch app is installed in the simulated watch. IQApp(IQ_APP_ID) in the Android app works, but the state of the App is always unknown and/or not installed.

My question: How do you develop/debug both apps, do you use a real Android device? Is it necessary to install Garmin Connect on the emulated Android device? I installed it but I could not log in, and even if I could I would not be able to connect the simulated watch. Is this even necessary when using the TETHERED connection type? Thanks

OS: Linux
Simulated Garmin watch: Venu 2 (I removed all other devices from the manifest)

sleep apnea, low respiratory rate

I was interested in the option of receiving a low breathing rate alarm. Can you tell that the app tracks your breathing while you sleep and the alert above is the same as sleep apnea?

With the xiaomi mi band, I will be able to get such an alert? Possibly which bands support this functionality.

Dismiss on the watch does not work

A tap on dismiss does not work. It simply does nothing (at least as user I'm not able to see any difference than not tapping on it).

I'm using SaA beta, and all other pieces of software in the current versions (10.12.2018) on a Garmin VA3.

This was mentioned here

Don't trigger Backlight on movement/gesture (Fenix 6 / Power Profiles)

Hey there,
it's really annoying when the Backlight always triggers when moving around a bit in bed (already woke up because of this) ..., but as I rely on "Gesture Backlist activation" on running and other activities I can't disable it (as advised here: #9)
On newer Fenix Models like the Fenix 6 one can configure Power Profiles, and those Power Profiles can be activated within Activity Settings. So it would be possible to create a Power Profile with disabled Backlight which one could assign to "Sleep App" ...
Mind implementing this Feature? ;-)
thx, bye from Austria
Andreas Schnederle-Wagner

No response since Android 10

I got an update to Android 10 this days. Since this, it's not possible to start Sleep from phone and watch. Before this, starting from watch worked without problems. Starting from phone ended up in the screen with the red x and green v, but do not respond - this hasn't changed.

If starting from watch, the "Sleep" entry on the watch gets a grey background, but nothing else happens.

Can I provide some more informations? I'm using the Garmin VA3 with newest firmware, Android 10 and a OnePlus 6 phone. All settings against killing apps (power saving) were checked twice and it worked the last few weeks (before A10) really good.

Instinct 2X Solar - SaA Alarm Dismiss stops alert on watch, but Snooze does not

Hi there,

Should I be using a different version of Garmin Add-on for Sleep? In looking at things to file this Issue, I see that the version I have installed is from the Play store, 20220207.

So much seems to work just fine with this version of the app and my watch, but I only just realized it's as old as it is.

At any rate, Sleep as Android is the 20231001 version.

To be clear about the report - If I dismiss my alarm on the phone in SaA, the watch stops it's alarm and goes back to it's normal operation. If I snooze my alarm in SaA, the alarm continues indefinitely on the watch and I have to power cycle the watch to get it to go away.

High Battery Consumption and Connection Issues with Garmin Addon - Suggestion to Explore Companion SDK

Hello Sleep as Android team,

I am an avid user of your main app and appreciate the functionalities it offers. However, I've been experiencing issues with the Garmin addon. The battery drain that occurs while using it is significant, which prevents me from making full use of this extension.

I've also noted that you acknowledged connection stability issues in your Google Play Store description, which has been a concern as well. This combination of high battery usage and unstable connections certainly impacts the overall user experience.

Recently, I was browsing the Garmin Developer site and stumbled upon something called the "Companion SDK". This software development kit supposedly allows for live broadcasting of various data types.

Have you considered looking into this Companion SDK as a possible solution? It might offer a more efficient way of handling data and could potentially address the aforementioned issues with the Garmin addon.

Link to Companion SDK
https://developer.garmin.com/health-sdk/overview/

List of issues on Forerunner 935

I don't want to spam the issue tracker with too many FR935 related issues, so I'm making this one for the ones I noticed.

Versions (all of them the latest stable releases, as far as I know):

Connect IQ App: 20181128
Android App: 20181011
Sleep Garmin: 20181206
"Sleep tracking from watch" app: 1.0
Garmin Forerunner 935 firmware: 11.00

This current setup is actually rock solid and tracks my sleeps without ever restarting the watch/disconnecting/etc. The battery drain is not bad either though the FR935 has a huge battery (it's using about 1-2%/hour). The previous release had a lot of stability problems, but they seem to be fixed, kudos! Also kudos for the open source approach!

However there are regressions that new release introduced, which are possible to work around, but definitely result in a poor user experience until you figure out the only right combination to start/stop tracking. Here's a list:

  1. After starting the Sleep app on the watch, the text is stuck on "Starting..." instead of "Tracking" (this was working properly in the previous version of the Connect IQ app) -- it still tracks though
  2. Cannot start tracking from the main Android app, have to start it through the watch, otherwise it's stuck at "Waiting for connectivity..." until it times out without popping up the "Start Sleep?" question on the watch
  3. Cannot stop tracking on the phone, have to select "Stop tracking" on the watch app, otherwise tracking will restart on the Android app after a short while
  4. The design of the Connect IQ screen is very clumsy on the circular screen, the previous/next options are barely visible/cut off on the top/bottom of the screen, they should be a bit lower to make them visible
  5. there are also no backgrounds to anything on the Connect IQ app, just a black background with a few lines of white text -- I see from this project's source that other watch versions have nice backgrounds, it should work on the FR935 as well, it's pretty much the same hardware as the Fenix 5/5s, screen size for sure

I'm on the stable SaA Android app, not using heart rate tracking function (because it's not in the stable yet). The Forerunner 935 is a very popular device (especially for triathlonists), so it would be cool to have stable and good looking app on it, not just for my own sake. Let me know if I can help by testing some fixes.

Once again, thanks for all the work on this project (and on Sleep as Android in general), it's very much appreciated!

Alarm starts right after starting tracking

I had issues (like #17 and #22) before and will try to report logs if it happens again.

But since the newer version with the improved UI (v202010*) was automatically installed on my watch a few days ago I had a new strange issue the last days.

  1. I start SaA on my phone at ~1:00 at night.
    5 minute delay configured before sleep should tracking start.
    Alarm set to ~7:30 in the morning
  2. I press the button on my Garmin vivoactive 3
  3. I select Sleepto start the tracking on the watch.
  4. The phone starts tracking too after a few seconds when the watch sent the command.
  5. After a few more seconds or a minute the app on the watch starts an alarm like I have to wake up. 😕
  • I try to Dismiss and Snooze the alarm, but nothing happens. Like these buttons have no functionality at all.
  • Why does the alarm happen at all? It should be a few hours before this should happen.
  • I am forced to do a reboot of the watch.
    • Then It works.

I am not sure how often this happens, but it happened the last two or three days ion a row.
I will keep an eye on this and report if I know more.
Are there any logs I can provide?

Sleep -> Starting ... all-nighter

Hi, I just got a new Garmin watch, and have been using Sleep as Android for I can't remember how long.

However I tried yesterday pretty much all night to get Sleep as andriod sleep tracking working for my Garmin Forerunner 245 Music, and I can't get it working. Not sure it's the new watch or that I can't tracking my sleep anymore, I lost sleep last night.

Anyway, I installed: 'Sleep as Android' (already been using), 'Garmin Addon for Sleep as Android', 'Sleep as Android' for the Watch and 'Sleep watch starter'.

And when I started the sleep tracking from the watch using 'Start/Stop' button -> select 'Sleep' -> 'Start/Stop' button again. Then the watch screen shows "11:49, Starting ..." with options to 'Resume tracking' or 'Stop tracking', and it just here. I waited for about half hour and nothing happens, and it's stayed in the same screen (with correct time been displayed) when I waked up in the morning.

The watch is a Garmin Forerunner 246 music with (software/firmware version 4.40), and the phone is a Xiaomi M9 with Android 10, MIUI 11. I've enabled Wearables with 'Use wearables' -> Garmin.

I didn't try to start sleep tracking from the Phone last night, but when I tried it now by 'Start Sleep tracking' from my phone, it will display 'Garmin, Waiting for connectivity' with 'Cancel' and 'Track without' options at the bottom, both options seems working fine. Initially I thought that it too will waiting forever in this screen, but after about 3 minutes(?), it eventually went into sleep tracking mode.

So it seems the start sleep tracking function (is it the Garmin Addon on the watch or the Sleep watch starter?) on the watch cannot starting/communicate with Sleep as Android in the phone?

New Watch: Venu 3

It looks like the Venu 3 isn't supported yet. Keep getting a server error for ConnectIQ when attempting to download as well

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.