Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A20 => Topic started by: mhammouda on April 01, 2018, 03:33:47 AM

Title: Battery level on Lime2
Post by: mhammouda on April 01, 2018, 03:33:47 AM
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.
Title: Re: Battery level on Lime2
Post by: Gerrit on April 01, 2018, 01:56:04 PM
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
Title: Re: Battery level on Lime2
Post by: elvisfernandes on June 14, 2018, 03:11:23 PM
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.

Title: Re: Battery level on Lime2
Post by: ronin07 on September 16, 2018, 10:55:19 AM
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.
Title: Re: Battery level on Lime2
Post by: andru97 on September 18, 2018, 05:16:18 PM
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,
Title: Re: Battery level on Lime2
Post by: LubOlimex on September 19, 2018, 07:13:01 AM
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.