Stiralbios
Member since Feb 2022 • Last active May 2024Most recent activity
-
I think the best way to do it is with a "state machine" so it need to have a memory of the previous state to switch states and it need to be able to turn on some sensors for a bit.
For example if the state is unknown it could turn on the HRM sensor for a bit to get a new value and then compute a new useful state.I am not sure if all this is possible within the module only or if an app is needed.
-
The one in the wear_detect module. But I though about it and I will probably go on a totally different direction.
I think I will make an app with just a boot.js and a lib.js that can be use by other apps to get wear states (resting, light activity, sport, light sleep, deep sleep, notworn, unknown). The app will listen to some events, sensors, etc and based on these event will update the current wear state -
Thanks. For me it does turn off in a black room, it turn on a bit at the very beginning then turn off. I tried it in a dark room in front of a mirror and then it doesn't turn off. It's probably darkness that is measured but then it wait for to get light back from the green light led and if not it assume it's not worn
-
I was playing a little bit with the watch to see if there way to improve isWorn accuracy and I notice that the HRM turn off quite fast when it's lose contact with an object and turn on immediately when it's in contact with an object.
I guess there is some sort of proximity sensor in the HRM module, is there any way to access this information to use it for the isWorn method for example ? -
-
-
Thanks,
I did the changes on my repo (https://github.com/Stiralbios/BangleApps) and it didn't solve the issue. The memory leak is quite high (~450) so it's probably something big that isn't unloaded like a module but I don't see how.
>eval(require("Storage").read("terminalclock.app.js")) =undefined >process.memory().usage =1529 >Bangle.setUI() =undefined >process.memory().usage =1419 >eval(require("Storage").read("terminalclock.app.js")) =undefined >process.memory().usage =1979 >Bangle.setUI() =undefined >process.memory().usage =1867 >eval(require("Storage").read("terminalclock.app.js")) =undefined >process.memory().usage =2425 >Bangle.setUI() =undefined >process.memory().usage =2313
The goal would be to be used by apps that run in the background too such as activityreminer, sleepphasealarm, sleeplog, ect.
The need for the previous state would be to know if it can go from one state to another. It makes no sens to go directly from "sport" to "deepsleep" for example.
I do understand that isWorn is good as module and I could improve on it to add the HRM stuff but but more complex states I am not sure it's the right approach.