Battery level on Lime2

Started by mhammouda, April 01, 2018, 03:33:47 AM

Previous topic - Next topic

mhammouda

Hi,
I started using Lime2 recently. I am using OpenWRT with Lime2. I am powering the board using LiPo battery. I could not find a way to find the battery level. I use SSH to communicate with the board. Is there any script or way to find the battery level through SSH. Help, please.

Gerrit

cat /sys/class/power_supply/battery/status

will give you the status,
and you can find more information in the directory /sys/class/power_supply/battery/ reading the files in it

elvisfernandes

hello,
haven't one to test, but generally you find this on sys/class/power/...  after power maybe battery/status or battery/voltage.
To read
cat /sys/class/power/battery/voltage
This path is only a sample, you have to look inside sys/class/power/ the correct one.


ronin07

Another option is talking to AXP chip via I2C which is a bit more complicated. I am sure i saw that thread once in some forum - do some forum search. Sorry couldn't find the link to that forum thread. Google might become your lifesaver.

andru97

#4
Howdy,

I began utilizing Lime2 as of late. I am utilizing OpenWRT with Lime2. I am driving the board utilizing LiPo battery. I couldn't figure out how to discover the battery level. I utilize SSH to speak with the board. Is there any content or approach to discover the battery level through SSH. Help, if you don't mind.
 ;D ;D


Regards,

LubOlimex

Maybe the OpenWRT doesn't support it out-of-the-box. Worth asking the OpenWRT community. If it doesn't support it then you can access the AXP209 power management chip via I2C and read it, but this might be a little bit more complicated (but challenge will not stop you I hope). Refer to the AXP209 documentation about the registers.

Another option is to switch to our Debian or Armbian images, or use Armbian directly, these support battery level in the kernel and you can find the level with a command or even application.
Technical support and documentation manager at Olimex