Most recent activity
-
I'm glad to know it's not just me :)
My guess is the Sleep as Android app is sending JS code to the Bangle.js 2 watch via the Bangle.js Gadgetbridge app, and expecting some sort of reply (perhaps via Android Intents?) that it doesn't receive.
I'll try to look into the Gadgetbridge debugging advice soon. You might be able to find something with it, too?
https://www.espruino.com/Gadgetbridge#debugging -
Has anyone used the Sleep as Android app with their Bangle.js 2 (not v1)?
In Sleep as Android's
Settings
→Sleep tracking
→Wearables
→Use wearable
section, there's an option forBangle.js
. If you don't have the Bangle.js Gadgetbridge installed, it'll direct you to the Play Store to get it. Otherwise, when testing, it waits to connect to my Bangle.js 2… and does nothing. I have all the Gadgetbridge and Bangle programming/intents/etc features enabled, and I've confirmed that I can send JavaScript code via Tasker (to auto-toggle Quiet mode).I'm guessing Sleep as Android's integration was written for the Bangle.js v1 since it doesn't mention heart-rate monitoring, and the v2 hardware/firmware may be different enough to break it.
I did reach out to Sleep as Android's support, and apparently it's a third party integration:
I did implement the PineTime integration myself.. but for the Bangle.js I'm sorry this is third party and I do not know anything about it :( I did not yet test this and do not have the device.. although I may get to Bangle.js in the future and hopefully integrate it.
I'd be happy to try debugging this, but I figured I'd get an idea of what others know first.
Aside, I know Bangle.js 2 has a self-contained sleep phase alarm/tracking app. However, I have over 2 years of sleep data in Sleep as Android and I've integrated it into my routine (controls bedroom lights/music, activates different modes on my phone, etc). Installing the sleep phase alarm app didn't seem to make this work, either.
-
- 11 comments
- 499 views
-
Over a period of 1h:11m:46s, starting from around 36% charge and an (almost certainly inaccurate) calculated battery voltage of 3.8126v, using that 67 mA-ish cut-off…
0.113 Ah (or 0.57442 Wh)
The USB power meter offers a way to calculate capacity, so by setting voltage to 3.8v and estimated charging efficiency to 90%, it results in an inaccurate estimated 0.1364 Ah battery capacity (real capacity is 350 mAh).
I attempted to calculate the voltage with the following (using the
pc
calculation to compare with the Bangle's own estimate):let batteryFullVoltage = 0.3144; let v = analogRead(D3); let v = 4.2 * v / batteryFullVoltage; if (v>=3.95) { let pc = 80 + (v-3.95)*20/(4.2-3.95); // 80%+ } else if (v>=3.7) { let pc = 10 + (v-3.7)*70/(3.95-3.7); // 10%+ is linear } else { let pc = (v-3.3)*10/(3.7-3.3); // 0%+ } Terminal.write("Batt voltage:" + (v).toFixed(4).toString() + "\n");
As it turns out, your estimate was pretty close! If I had drained the battery further, I'd probably have hit your target (I try to not let the battery dip too low, either).
-
A brief follow-up - my Bangle.js 2 seems to charge at around 98 mA for the majority of time, then by the time it reaches "100%", it has tapered off to 67 mA, where my powerbank then cuts off power. This is before Charge Gently (chargent) even activates. My USB power meter was powered separately for the tests, so it did not impact the powerbank cutoff.
Taking it off the charger, letting the voltage settle, that put my Bangle 2 at around "96%" (and a few hours later, "94%").
This is an excellent solution that turns an aggravation with my powerbank's cut-off into a free hardware charge limiter for my watch, thank you @halemmerich for the idea!
-
The Chargie seems very cool. Thanks for dropping that name […]
Sure thing! I'm glad mentioning this was helpful.
As for the Bangle, a workaround would be charging from a powerbank. Many of those cut off the charging when the current is low. […]
My pre-2013 powerbank does this and it has bugged me so much. Now I see that this is a feature! I've got a USB power meter that can be independently powered (so it won't increase the power bank's load) - next time I need to charge my Bangle 2, I'll see how it goes.
I'd be really surprised if someone hasn't made an inline USB gadget that does that already - but if not you should totally make one!
Ah, that's actually why I mentioned Chargie - see "Is there any way Chargie can work without the app?" on the FAQ page.
Chargie was originally intended for managing phones via iOS and Android, but it also supports a hardware cut-off that's committed to memory. Granted, there are probably ways to make a cheaper circuit if you don't support Bluetooth control and all that.
-
-
I've seen two separate apps that provide a way to alert on approaching full battery charge,
chargent
andpowermanager
.Rather than simply alerting, does the Bangle.js 2 hardware provide a way to actually reduce the maximum charging voltage limit?
It looks like the charge controller isn't programmable, but I thought I should double-check. I see mentions of
pin_charging
andpin_voltage
, but those seem to be input-only, and the battery percentage code appears to simply convert an analog voltage value.(As context, I've been working on implementing battery charge voltage limiting for the Flipper Zero multi-tool, which is using a Texas Instruments
bq25896
controlled over I²C.)
UPDATE: fetching Gadgetbridge debug logs, I see… nothing from Sleep as Android in Gadgetbridge's logs.
I have my custom code snippet from Tasker successfully shown and parsed, though.
Perhaps there's something between Bangle.js Gadgetbridge and Sleep as Android that needs fixed?
I do frequently see the following, but I suspect it's unrelated:
Looking at
adb logcat
, it seems like Sleep as Android is listening for acom.urbandroid.sleep.watch.CONFIRM_CONNECTED
broadcast:This matches up with the Sleep as Android Wearable integration API documentation:
https://docs.sleep.urbandroid.org/devs/wearable_api.html#initiating-connection-to-phone
I git-clone'd the Gadgetbridge source code and searched recursively for
CONFIRM_CONNECTED
, but didn't find it anywhere.