-
-
Notifications
You must be signed in to change notification settings - Fork 952
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
InfiniSleep: SleepTk Port #2170
Conversation
Build checks have not completed. Possible reasons for this are:
|
Is the sleep cycle/duration tracking done by an algorithm that calculates it via hrm and accelerometer data or is it done by simply starting and stopping the tracker and counting the time between that? |
For now, it is done using start-stop. I am looking into using sensor data, but looks like without a solid algorithm, this is the most accurate for this watch. |
@tituscmd I can't seem to figure out why the build check isn't working. Could you please help me? |
Try building all of the targets locally - when you run |
I haven't created a PR yet so unfortunately I don't actually know either 😅 |
Is there anything stopping you from using an algorithm like the Pillow app (iOS) does? You could perhaps offload the calculating of when you fall asleep and the different cycles and whatnot to InfiniLink to save storage. |
https://www.nature.com/articles/s41598-023-36444-2 I haven't read the entirety of it yet, partly because it's rather late, but maybe this is a step in the right direction 🙂 |
@tituscmd I have heard that the Pillow app (iOS) is pretty accurate, do you know if the algorithm is available online? That might be a good lead for me. There isn't much stopping me other than memory constraints, so far I can guarantee data logging on the watch. Offloading to the companion app is definitely possible. |
I'll try to find out if Pillow's sleep tracking algorithm is available online. If not, you can check out the link in my latest message. Edit: After a bit of researching, it seems the actual algorithm is not known. The only thing I can find is that they say they use HRM and accelerometer data to estimate sleep amount and sleep cycles. |
I haven't read too deeply, but seems like a ML implementation which I think is difficult to pull off on the watch. |
At the moment you're using your main branch for this PR. You have quite a few other features on this branch like background HR, flashlight changes, local VS code config changes etc that I'm guessing you didn't mean to include (you can see a list of all the changes at https://github.com/InfiniTimeOrg/InfiniTime/pull/2170/files) - each feature needs to go in its own PR so the other features need to be removed from this branch first. It might well be easier to create a new feature branch on your repository so you're free to do whatever you like with your main branch, and then use the new branch for this PR. If you want to use a separate branch for this feature, I believe you will need to open a new PR from that branch as AFAIK github does not let you change the source branch of an existing PR Branch management can definitely get complex so if this doesn't make sense please say, I can try to clarify :) |
@mark9064 The flashlight was just an early test for me to learn the codebase and I think I merged the background HR for personal use. I'm not too versed in branch management, could you help me understand the steps to have a branch without the other changes? |
Without messing up your main too much, I would first save your changes to a separate branch:
Now that your changes are safely put away, we can blow over main to match the upstream InfiniTime code:
Okay, we're now in "clean slate" mode: your changes are safely saved in a
Now the hard part: you need to cherry pick changes from your
If this works, your In case you accidentally mess it up (it's very easy to mess this up), I've followed these steps myself and push them to a branch in my fork for safe-keeping: https://github.com/vkareh/InfiniTime/commits/sleep-tk-port/ In the future, a good practice is to always start with a clean up-to-date |
Thanks for the info, there are actually far less changes NOT relating to the sleep tracker. So what if I made a branch which all my changes and reset the main branch like you suggested, but on the branch I just undo the changes manually and make new commits, how does that compare? |
A SleepTk port that can help with setting a suggested wake alarm based on sleep cycle goals.
Another feature is the gradual wake feature that vibrates at intervals to slowly wake you up instead of a full-blown alarm.
Another big feature is the sleep session tracking. You can start a session once you are going to sleep and stop it once you are awake. It has information like cycle count and total sleep time to help you understand why you are tired when you wake up.