Cubietruck battery support

3,648 views
Skip to first unread message

Martín M

unread,
Oct 27, 2013, 12:29:56 AM10/27/13
to cubie...@googlegroups.com
Hi All. I´ve just purchased a Cubietruck and I´m waiting for it to arrive. I´ve purchased because of the battery property of the cubietruck, because for the project I´m working on A10 Cubieboard worked well, but lack on battery support and it´s needed. Regarding Cubietruck battery I have the following question´s:

1. Wich battery voltage and type should be used?
2. Is there any Linux application where you can monitor battery level?
3. It´s possible to switch betwen DC Adapter to battery without booting it (or interrupting it normal function, like a Cell Phone).

I was not able to find any answer on this into the forum or the web. Hope somewone on the forum could help me.

Best Regards

Martin

benn

unread,
Oct 27, 2013, 2:52:24 AM10/27/13
to Martín M, cubie...@googlegroups.com, support
于 2013/10/27 12:29, Martín M 写道:
> Hi All. I´ve just purchased a Cubietruck and I´m waiting for it to
> arrive. I´ve purchased because of the battery property of the
> cubietruck, because for the project I´m working on A10 Cubieboard
> worked well, but lack on battery support and it´s needed. Regarding
> Cubietruck battery I have the following question´s:
>
> 1. Wich battery voltage and type should be used?
I will confirm it tomorrow

> 2. Is there any Linux application where you can monitor battery level?
at least export via sysfs

> 3. It´s possible to switch betwen DC Adapter to battery without
> booting it (or interrupting it normal function, like a Cell Phone).
yes

>
> I was not able to find any answer on this into the forum or the web.
> Hope somewone on the forum could help me.
>
> Best Regards
>
> Martin
> --
> You received this message because you are subscribed to the Google
> Groups "Cubieboard" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to cubieboard+...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cubieboard.
> For more options, visit https://groups.google.com/groups/opt_out.

Martín M

unread,
Oct 27, 2013, 11:28:08 PM10/27/13
to cubie...@googlegroups.com, Martín M, support
Thank´s Huang for your reply. I´ll wait for the complete details. Since Cubietruck doesnt arrive yet, I have time :)
Would be great if there is an application for the battery in addition to sysfs.


Regard´s.

Martín M

unread,
Nov 29, 2013, 8:27:27 AM11/29/13
to cubie...@googlegroups.com, Martín M, support
Hi All, finally I´ve received Cubietruck yesterday. I dont know how to start with battery. Any idea?

I´ve installed Linaro Nand Image and measured voltage at battery port and there is 0 v present.


Looking into Cubietruck software I found /sys/class/power_supply/battery directory with a lot of variable but don´t know how to configure.

Any help would be appreciated.

Regards

root@cubietruck:/sys/class/power_supply/battery# cat technology
Li-ion


root@cubietruck:/sys/class/power_supply/battery# ls
adcfreq         chgmicrovol         ihold       status      vhold
capacity        chgpretimemin       iholden     subsystem   vholden
chgcsttimemin   current_now         model_name  technology  voltage_max_design
chgen           device              online      temp        voltage_min_design
chgendcur       energy_full_design  power       type        voltage_now
chgintmicrocur  health              present     uevent

Martín M

unread,
Dec 11, 2013, 9:00:41 AM12/11/13
to cubie...@googlegroups.com, Martín M, support
Hi All, any guide or tutorial about how to use sys-fs for battery definition and monitoring in Cubietruck?

There should be a way to define battery type and battery level but I´m not able to find it.

Regards

Martin

Michal Suchanek

unread,
Dec 11, 2013, 3:42:09 PM12/11/13
to cubie...@googlegroups.com, Martín M, support
On 11 December 2013 15:00, Martín M <mmio...@gmail.com> wrote:
> Hi All, any guide or tutorial about how to use sys-fs for battery definition
> and monitoring in Cubietruck?
>
> There should be a way to define battery type and battery level but I´m not
> able to find it.

AFAIK only one type of battery is supported so the level is defined by
the type. The only variables are capacity and aging.

There was some battery calibration but that might have been part of
the Android userspace.

Anyway, I did not get to connecting my battery to CT, it's just lying
on the table next to it.

As the Lithium base batteries can overheat to the point of burning
down I need to do that some time when I can watch what is happening to
the battery.

Thanks

Michal

Martín M

unread,
Dec 11, 2013, 4:11:37 PM12/11/13
to cubie...@googlegroups.com, Martín M, support
Hi Michael, I didnt realized that battery can burn itself, that scares me.
I have not connected battery yet, should arrive tomorrow or friday (delivery´s to Argentina take long time ; )

I´m working with Linaro, and there might be some place to define buttery type, probably into script.bin
As show before, Cubietruck default seem to be Li-ion, while recommended is Li-po (the one I´m waiting for).

root@cubietruck:/sys/class/power_supply/battery# cat technology
Li-ion

Any way for definig those values? Or any advice about how to use battery?

Regards

jons...@gmail.com

unread,
Dec 11, 2013, 4:18:51 PM12/11/13
to cubieboard, Martín M, support
On Wed, Dec 11, 2013 at 4:11 PM, Martín M <mmio...@gmail.com> wrote:
> Hi Michael, I didnt realized that battery can burn itself, that scares me.
> I have not connected battery yet, should arrive tomorrow or friday
> (delivery´s to Argentina take long time ; )
>
> I´m working with Linaro, and there might be some place to define buttery
> type, probably into script.bin
> As show before, Cubietruck default seem to be Li-ion, while recommended is
> Li-po (the one I´m waiting for).
>
> root@cubietruck:/sys/class/power_supply/battery# cat technology
> Li-ion

Get the datasheet for the AXP power chip on your Cubietruck here:
http://www.x-powers.com/en/

Some of them aren't in English so if needed copy the sections into
Google translate.
Jon Smirl
jons...@gmail.com

Martín M

unread,
Dec 11, 2013, 6:45:24 PM12/11/13
to cubie...@googlegroups.com, Martín M, support
Hi Jon thanks for the link. I thought there would be a tutorial, as there are for installation, GPIO, etc. From http://www.x-powers.com/en/product/axp202.html says it is designed for Li-Ion/Polymer
but I dont know how to select Li-Po into the sys-fs. By default Li-Ion is selected. Also I dont know how to set capacity and the check battery % charge level. I think that setting both values and retrieving % charge level should be enough to use battery without any problems.

I found some script for testing that could be interesting

Again, if someone know how to set battery capacity and battery type would be great.

Regards

Martin

jons...@gmail.com

unread,
Dec 11, 2013, 6:57:12 PM12/11/13
to cubieboard, Martín M, support
On Wed, Dec 11, 2013 at 6:45 PM, Martín M <mmio...@gmail.com> wrote:
> Hi Jon thanks for the link. I thought there would be a tutorial, as there
> are for installation, GPIO, etc. From
> http://www.x-powers.com/en/product/axp202.html says it is designed for
> Li-Ion/Polymer
> but I dont know how to select Li-Po into the sys-fs. By default Li-Ion is
> selected. Also I dont know how to set capacity and the check battery %
> charge level. I think that setting both values and retrieving % charge level
> should be enough to use battery without any problems.
>
> I found some script for testing that could be interesting
> https://github.com/ciddaemon/sunxi/blob/master/scripts/README.md

Full datasheet is there in English
http://www.x-powers.com/download/AXP202%20Datasheet_v1.0_en.pdf

Look at the source code for the AXP202 device driver. That should
answer all of your questions.
https://github.com/linux-sunxi/linux-sunxi/tree/sunxi-3.4/drivers/power/axp_power

Martín M

unread,
Dec 13, 2013, 9:33:37 AM12/13/13
to cubie...@googlegroups.com
Hi Jon, thanks for the links. Looking into the code seems that I LiION is only a name and there would be no change, correct?

What I sould change into the code below is the values that match the battery I'm using correct? I´ve bouth a 3000mAH battery, so I shpud replace:

.charge_full_design = 1450, to 3000
 .energy_full_design = 1450,    to 3000
that´s correct?

Thanks

static struct power_supply_info battery_data ={
        .name ="PTI PL336078",
                .technology = POWER_SUPPLY_TECHNOLOGY_LION,
                .voltage_max_design = 4200000,
         .voltage_min_design = 2700000,
         .charge_full_design = 1450,
         .energy_full_design = 1450,
         .use_for_apm = 1,
};

jons...@gmail.com

unread,
Dec 13, 2013, 9:35:47 AM12/13/13
to cubieboard
On Fri, Dec 13, 2013 at 9:33 AM, Martín M <mmio...@gmail.com> wrote:
> Hi Jon, thanks for the links. Looking into the code seems that I LiION is
> only a name and there would be no change, correct?

I don't know how to program batteries. I only knew where to point you
in the doc/code.

shogun x

unread,
Dec 13, 2013, 10:15:53 AM12/13/13
to cubie...@googlegroups.com

Another method I use for battery support for the cubie is as follows:  solar array to charge controller to battery bank to 5v regulator (BTW... is this also onboard?) to cubie.  Since I already had the solar gear from previous research, it was pretty easy for me.  If anyone wants further details, let me know.

Martín M

unread,
Dec 13, 2013, 11:08:25 AM12/13/13
to cubie...@googlegroups.com
Understood Jon.

Do you know how to recompile only this part? (just in case I´m right)I havent found those files into source files

I have also followed FirstSteps post for cubieboard and added advanced power option but I´m not able to find those files you pointed out with the link.

Thanks again!!

Michael, can you send some details about it. I dont think it would be helpful to me because I need it for an indoor aplication and also I need to monitor battery status and I think that your battery is not monitoreable through software. I´m wright?

Regards

Martin

Adrian Rupp

unread,
Mar 5, 2014, 3:06:09 PM3/5/14
to cubie...@googlegroups.com, Martín M, support

Adrian Rupp

unread,
Mar 5, 2014, 3:16:33 PM3/5/14
to cubie...@googlegroups.com
"Cubietruck supports power by Li-battery even with 2.5-inch HDD or SSD. The specification of the Li-battery is almost like the one which used in most of cell phones. If you have a free cell phone battery, you can use it to power Cubietruck by soldering two wires. This Li-battery has the following key parameters: Rating voltage=3.7V, Charge voltage=4.2V, Over current>=4A. The capacity of this Li-battery is not important I think, the more the better. But crucially, you should pay lots of attention in the positive and negative pole. You will damage Cubietruck if the Li-battery electrodes are connected in wrong way. You can find out the connection electrodes on the PCB of Cubietruck. Lithium battery is a kind of dangerous goods in transportation, so you need to DIY by yourselves."[1]

1. http://docs.cubieboard.org/faq/faqs
Reply all
Reply to author
Forward
0 new messages