Skip to content
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

[Harmony] [KW99] Battery indicator doesn't work #94

Closed
ghost opened this issue Sep 7, 2019 · 7 comments
Closed

[Harmony] [KW99] Battery indicator doesn't work #94

ghost opened this issue Sep 7, 2019 · 7 comments

Comments

@ghost
Copy link

ghost commented Sep 7, 2019

Device: KW99
AsteroidOS: nightly 20190902

Battery indicator shows "undefined %" and charging status is unknown (no notification after plugging in).

Works on nightly from around 20190311.

@JNissi
Copy link

JNissi commented Sep 10, 2019

cat /sys/class/power_supply/battery/uevent (or /capacity) shows the battery status correctly. Will debug DBus next.

@JNissi
Copy link

JNissi commented Sep 26, 2019

I flashed the latest nightly (23.9.2019), still the same problem.

I then flashed a bare-bones build where I've removed most stuff so it only starts the psplash and sshd.

After testing that image around for a moment I flashed the latest Asteroid nightly back on the watch and for some reason the battery level is now shown correctly.

I wish I could give any kind of explanation for what happened.

@FlorentRevest
Copy link
Member

This very much looks like a similar class of problem as what we had here AsteroidOS/meta-bass-hybris#6 (comment)

If my intuition is right: the battery level is provided by statefs providers. statefs providers are registered in a post-inst script run on first boot by opkg https://github.com/AsteroidOS/meta-asteroid/blob/master/recipes-nemomobile/statefs/statefs_git.bb#L51 and for some weird reason, since a few releases, opkg just crashes randomly while trying to run "opkg reconfigure" on first boot. This really happens randomly and is virtually impossible to reproduce. Since opkg reconfigure is only ran once, if it fails then the commands it is supposed to run are not run again.

I have no explanation for why this happens and no good fix for it. I was able to mitigate the related time bug (a postinst script to setcap timed-qt5 was used) by moving the command to build-time AsteroidOS/meta-asteroid@9806321 But afaik this is not something we can do with statefs providers installation.

@MrNickH
Copy link

MrNickH commented Feb 6, 2020

This very much looks like a similar class of problem as what we had here AsteroidOS/meta-bass-hybris#6 (comment)

If my intuition is right: the battery level is provided by statefs providers. statefs providers are registered in a post-inst script run on first boot by opkg https://github.com/AsteroidOS/meta-asteroid/blob/master/recipes-nemomobile/statefs/statefs_git.bb#L51 and for some weird reason, since a few releases, opkg just crashes randomly while trying to run "opkg reconfigure" on first boot. This really happens randomly and is virtually impossible to reproduce. Since opkg reconfigure is only ran once, if it fails then the commands it is supposed to run are not run again.

I have no explanation for why this happens and no good fix for it. I was able to mitigate the related time bug (a postinst script to setcap timed-qt5 was used) by moving the command to build-time AsteroidOS/meta-asteroid@9806321 But afaik this is not something we can do with statefs providers installation.

Just ran
/usr/lib/statefs/provider-action register /usr/lib/statefs/libprovider-power_udev.so default --system
And got

Trying to dump default provider "/usr/lib/statefs/libprovider-power_udev.so"
Trying to dump as a loader
Not a loader: /usr/lib/statefs/libprovider-power_udev.so
File /usr/lib/statefs/libprovider-power_udev.so is not config?, skipping
Can't retrieve information from libprovider-power_udev.so

Not sure if helping or barking up the wrong tree here though.

@schindlershadow
Copy link

I managed to get this on sturgeon
Screenshot_20210810_151809
im on 1.1-nightly

@speaktrap
Copy link

I also encountered this issue, fresh flash after unlocking bootloader of a stock Watch.
I switched to ADB, did the opkg reconfigure statefs and rebooted, works like a charm.
Why not implement some kind of quick hack for now? Something akin to "if battery status undefined –> try to reregister power status provider"

@MagneFire
Copy link
Member

Since AsteroidOS/meta-asteroid#83 has been merged. So this issue is finally solved 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

6 participants