We have moved to a new Sailfish OS Forum. Please start new discussions there.
4

JollaC kernel provided battery info

asked 2016-07-22 09:59:26 +0300

miska gravatar image

updated 2016-07-22 14:09:06 +0300

jiit gravatar image

Got my JollaC and was trying to get measurements from battery, but interface in sys is kinda trimmed down (no power_full, power_now, charge_now or charge_full) and when I take a look at current_now, it displays zero shortly after waking up. Later it starts showing some reasonable values. but several seconds after waking up there is constant zero.

edit retag flag offensive close delete

1 Answer

Sort by » oldest newest most voted
2

answered 2016-07-22 11:52:57 +0300

rinigus gravatar image

check out what can you see in /run/state/namespaces/Battery/ . This should provide info through statefs

edit flag offensive delete publish link more

Comments

Thanks. There is some more info then in sysfs. It looks enough for what I need. Will check later whether current_now alternative there behaves better. So in the end, information is available, just the kernel interface is incomplete/broken. It is still worth fixing though even if there is a workaround....

miska ( 2016-07-22 12:05:18 +0300 )edit

As far as I understand, that's actually an interface you are supposed to use on Sailfish. This allows the developers to forget about backend implementation (kernel, power manager, ...) and just use the provided info through statefs. I'm using it in a new plugin for collectd/systemdatascope to collect and display battery stats. In addition to common data, like current, it gives you time to low and full that you could use.

rinigus ( 2016-07-22 12:09:13 +0300 )edit
2

Well, I kinda understand that it could be handy to provide extra information, just don't like the idea that my Linux phone that I bought especially because it is more Linux than Android has broken/incomplete kernel interface.

miska ( 2016-07-22 13:32:37 +0300 )edit
1

True, ideally it should be fixed. Its just that all these phones/parts are probably Android first and its no wonder that kernels are lacking few things that are fixed somehow in userland if needed. No idea what's a cause in Jolla C kernel case and where statefs provider gets the current value.

rinigus ( 2016-07-22 22:57:59 +0300 )edit

I just had a quick look at my Jolla 1 values:

  • /sys/class/power_supply/battery/energy_now: 4390957
  • /sys/class/power_supply/battery/energy_full: 7442300
  • /sys/class/power_supply/battery/energy_full_design: 7980000

  • /run/state/namespaces/Battery/Energy: 8360000

  • /run/state/namespaces/Battery/EnergyFull: 7395940

What kind of value is Energy supposed to be? Why is it higher than EnergyFull? And why do energy_full and EnergyFull not match?

Which values does the Jolla C provide, and can I trust them? :)

MrMoo ( 2016-07-25 20:38:30 +0300 )edit
Login/Signup to Answer

Question tools

Follow
3 followers

Stats

Asked: 2016-07-22 09:59:26 +0300

Seen: 341 times

Last updated: Jul 22 '16