| Welcome, Guest |
You have to register before you can post on our site.
|
| Forum Statistics |
» Members: 29,984
» Latest member: cherybomb
» Forum threads: 16,335
» Forum posts: 117,444
Full Statistics
|
| Latest Threads |
Star64 Irradium (based on...
Forum: Getting Started
Last Post: mara
04-19-2026, 12:56 PM
» Replies: 13
» Views: 14,678
|
Pine Time dead
Forum: General Discussion on PineTime
Last Post: chris.burmajster
04-18-2026, 10:08 AM
» Replies: 0
» Views: 101
|
Booting Issues
Forum: PineNote Software
Last Post: vlagged
04-17-2026, 04:17 PM
» Replies: 24
» Views: 19,070
|
App launcher shows tiny i...
Forum: PineNote Software
Last Post: vlagged
04-17-2026, 04:12 PM
» Replies: 1
» Views: 1,058
|
Freezes and kernel panics...
Forum: Linux on RockPro64
Last Post: prahal
04-15-2026, 06:48 PM
» Replies: 4
» Views: 1,316
|
Looking for engineer for ...
Forum: PinePhone Pro Hardware
Last Post: Andrey_voce
04-06-2026, 08:44 AM
» Replies: 0
» Views: 249
|
StarPro64 Irradium (based...
Forum: Getting Started
Last Post: mara
04-05-2026, 03:03 AM
» Replies: 19
» Views: 9,054
|
Finally got Kali working ...
Forum: General Discussion on Pinebook Pro
Last Post: qingss0
04-04-2026, 08:00 AM
» Replies: 0
» Views: 355
|
Charging problem
Forum: General Discussion on Pinebook Pro
Last Post: RicTor
04-04-2026, 07:30 AM
» Replies: 0
» Views: 152
|
Latest firmware for PineP...
Forum: PinePhone Software
Last Post: baptx
04-03-2026, 08:37 AM
» Replies: 106
» Views: 218,513
|
|
|
| Improve the life of your Pinebook battery by setting charger's voltage limits |
|
Posted by: wlad - 06-11-2019, 02:27 PM - Forum: Linux on Pinebook
- No Replies
|
 |
It is a good practice for lithium battery powered devices to briefly think about the charging configuration which can significantly influence the health and usable capacity over time of a battery. Typically, a LiPo battery -- as is also used in the Pinebook -- has a minimum voltage of 3.0 volts (falling below quickly damages the battery) and a maximum voltage of slightly above 4.2 volts (further charging can destroy the battery and even ignite a fire).
The higher the difference of the battery voltage to these two extremes is, the longer it will keep its initial capacity and the less stress it has to withstand (temperature as another dimension can be critical also, but will be ignored for now). So, quite good voltage limits for charging your Pinebook may be 3.2 to 4.0 volts. The more tentative these limits are set, the less actual battery capacity will be usable, thus less time your Pinebook will be working on battery before it needs to charge.
Luckily, the power management unit AXP803 of the Pinebook allows you to configure, how you wish to set the voltage limits for your actual use case. To this end, you can use the virtual sysfs files in '/sys/class/power_supply/axp20x-battery/' which allow read and write access. I tested this on the current Armbian 5.86, but other distros may offer similar functionality, as they might use the same "axp20x" kernel module for accessing the AXP803 power management unit.
With read access, you can find out how the limits are currently set. By echoing values into the virtual files, you can persistently write settings to the unit (yes, written values reside on the AXP803 and keep changed even after reboot or shutdown). As the AXP803, for instance, supports only four possible maximum voltages (4.10v, 4.15v, 4.20v, or 4.35v), invalid values as write attempts are caught by the operating system.
Code: cat /sys/class/power_supply/axp20x-battery/voltage_max_design
cat /sys/class/power_supply/axp20x-battery/voltage_min_design
Charging voltage limits (example with a range of 3.2v ... 4.1v) can be set with:
Code: echo 4100000 > /sys/class/power_supply/axp20x-battery/voltage_max_design
echo 3200000 > /sys/class/power_supply/axp20x-battery/voltage_min_design
It seems that the maximum voltage is handled by AXP803 (or the kernel driver) with precaution so that my Pinebook battery only charged to up to 4.0 volts with this configuration. The capacity value that is provided in '/sys/class/power_supply/axp20x-battery/capacity' is adjusted automatically to the min and max settings.
I hope, some of you can use these hints to improve the endurance of your Pinebook's battery. Please post a message on your findings relating to practical observations or a different OS.
See for reference on more internals on the power management unit as investigated by xalius:
AXP803 Battery Charger Support
|
|
|
|
| Adding coherent_pool to boot.cmd on Xenial Mate by Ayufan causes boot loop |
|
Posted by: k_mp - 06-11-2019, 01:36 PM - Forum: Linux on Pinebook
- No Replies
|
 |
Hi,
Due to my external WiFi driver, I added,
in /boot/boot.cmd at the end of
and ran
Code: $ sudo mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr
But after a restart, the Pinebook didn't load up anymore and stuck in the boot loop (hangs on the logo). I'm using the Xenial Mate by Ayufan (the original factory distribution). Is there any solution to solve it? I know how to restore it. But to get my external WiFi works, I also need to have coherent_pool.
Unfortunately, since the Pinebook stuck in the boot logo, I can't see any logs.
|
|
|
|
| How to use dts or other setup to declare gpio pin Interrupt (e.g. a button)? |
|
Posted by: dkebler - 06-11-2019, 01:11 PM - Forum: Pi2, Euler and Exp GPIO Ports
- Replies (1)
|
 |
Using armbian bionic mainline kernel on A64-v1.1 board
Linux pine64 4.19.38-sunxi64 #5.83 SMP Fri May 3 21:02:31 CEST 2019 aarch64 aarch64 aarch64 GNU/Linux
In RPI bionic could just set values in boot.txt. Is this possible in armbian bionic mainline?
I know that one can use device tree overlays but can't find any examples specific to the A64.
Anyone have a dts file or otherwise know how to declare a pin as an interruptible input? I've come across nothing in any A64 docs.
|
|
|
|
| HDMI out not working on Pine64 11.6" XFCE |
|
Posted by: Fox7799 - 06-11-2019, 12:23 PM - Forum: Linux on Pinebook
- Replies (3)
|
 |
This is the software that came with my Pinebook 11.6" laptop but HDMI out doesn't work with XFCE or Plasma so I can't display on external screens. Everything else works well. Xubuntu is my preferred software so I don't want to install something else. How soon can this be fixed? Thanks
|
|
|
|
| Display battery charge value with LXDE and lxpanel |
|
Posted by: wlad - 06-11-2019, 09:56 AM - Forum: Linux on Pinebook
- Replies (1)
|
 |
In my opinion, Armbian with LXDE as window manager is a good fitting combination for the limited power of the Pinebook. LXDE provides only few visual effects, so the system can be used with acceptable performance. Unfortunately, I had an issue with the battery plugin of the lxpanel (the bar where all current windows/processes are stacked into).
Indication: Battery plugin (batt) of lxpanel does not show the current "capacity" (charged value in percent) of Pinebook's battery. Instead, it displays "0% charged" and continuously fires the low-battery alarm.
Reason: The integrated functionality of the battery plugin calculates the charged value by using the coulomb-based counters "charge_now" and "charge_full" (or alternatively "energy_now" and "energy_full"). These counters are usually provided by the power management unit's Linux kernel module. The kernel module (axp20x) for the AXP803 power management unit of the Pinebook does not provide "charge_now" and "charge_full" information. Instead, a percentage value for the current charge is provided as "capacity" (try 'cat /sys/class/power_supply/axp20x-battery/capacity').
Solution: I have changed the source code for the batt plugin with respect to the above mentioned reasons. Now, the percentage value is directly read from the corresponding sysfs file and not longer calculated indirectly.
The original code (lxpanel version 0.10.0) that you can find in 'lxpanel-0.10.0/plugins/batt/batt_sys.c' looked like this:
Code: battery* battery_update(battery *b) {
gchar *gctmp; int promille;
/* [...] */
/* read from sysfs */
b->charge_now = get_gint_from_infofile(b, "charge_now");
b->energy_now = get_gint_from_infofile(b, "energy_now");
b->current_now = get_gint_from_infofile(b, "current_now");
b->power_now = get_gint_from_infofile(b, "power_now");
if (b->current_now < -1)
b->current_now = - b->current_now;
b->charge_full = get_gint_from_infofile(b, "charge_full");
b->energy_full = get_gint_from_infofile(b, "energy_full");
b->charge_full_design = get_gint_from_infofile(b, "charge_full_design");
b->energy_full_design = get_gint_from_infofile(b, "energy_full_design");
b->voltage_now = get_gint_from_infofile(b, "voltage_now");
gctmp = get_gchar_from_infofile(b, "type");
b->type_battery = gctmp ? (strcasecmp(gctmp, "battery") == 0) : TRUE;
g_free(gctmp);
g_free(b->state);
b->state = get_gchar_from_infofile(b, "status");
if (!b->state)
b->state = get_gchar_from_infofile(b, "state");
if (!b->state) {
if (b->charge_now != -1 || b->energy_now != -1
|| b->charge_full != -1 || b->energy_full != -1)
b->state = g_strdup("available");
else
b->state = g_strdup("unavailable");
}
if (b->charge_now != -1 && b->charge_full != -1)
promille = (b->charge_now * 1000) / b->charge_full;
else if (b->energy_full != -1 && b->energy_now != -1)
/* no charge data, let try energy instead */
promille = (b->energy_now * 1000) / b->energy_full;
else
promille = 0;
b->percentage = (promille + 5) / 10; /* round properly */
if (b->percentage > 100)
b->percentage = 100;
/* [...] */
return b;
}
This code has been changed to the following:
Code: battery* battery_update(battery *b) {
gchar *gctmp; int promille;
/* [...] */
/* read from sysfs */
b->charge_now = get_gint_from_infofile(b, "charge_now");
b->energy_now = get_gint_from_infofile(b, "energy_now");
b->current_now = get_gint_from_infofile(b, "current_now");
b->power_now = get_gint_from_infofile(b, "power_now");
if (b->current_now < -1)
b->current_now = - b->current_now;
b->charge_full = get_gint_from_infofile(b, "charge_full");
b->energy_full = get_gint_from_infofile(b, "energy_full");
b->charge_full_design = get_gint_from_infofile(b, "charge_full_design");
b->energy_full_design = get_gint_from_infofile(b, "energy_full_design");
b->voltage_now = get_gint_from_infofile(b, "voltage_now");
// changed to direct read of percentage value (supported by pinebook)
b->percentage = get_norm_gint_from_infofile(b, "capacity");
gctmp = get_gchar_from_infofile(b, "type");
b->type_battery = gctmp ? (strcasecmp(gctmp, "battery") == 0) : TRUE;
g_free(gctmp);
/* [...] */
if (b->charge_now != -1 && b->charge_full != -1)
promille = (b->charge_now * 1000) / b->charge_full;
else if (b->energy_full != -1 && b->energy_now != -1)
/* no charge data, let try energy instead */
promille = (b->energy_now * 1000) / b->energy_full;
else
promille = 0;
// percentage was indirectly calculated, this has changed to direct read of value
//b->percentage = (promille + 5) / 10; /* round properly */
if (b->percentage > 100)
b->percentage = 100;
/* [...] */
return b;
}
As this requires a new function for reading the numerical value as provided by '/sys/class/power_supply/axp20x-battery/capacity', I introduced the following function which was inserted below the existing function "static gint get_gint_from_infofile(battery *b, gchar *sys_file)" in the same source code file "batt_sys.c":
Code: /* get_norm_gint_from_infofile():
* If the sys_file exists, then its value is converted to an int,
* and returned.
* Failure is indicated by returning -1. */
static gint get_norm_gint_from_infofile(battery *b, gchar *sys_file) {
gchar *file_content = parse_info_file(b, sys_file);
gint value = -1;
if (file_content != NULL)
value = atoi(file_content);
g_free(file_content);
return value;
}
The most time consuming part of this change was building the plugin's shared library file 'batt.so' because of all the required dependencies. But finally, it worked and I could replace the original file in '/usr/lib/aarch64-linux-gnu/lxpanel/plugins/'. The charge indicator now works as it should (except that I see no practical way how to predict the remaining power-on time).
I provide to you my build of 'batt.so' here (together with the changed 'batt_sys.c'), so that you do not need to build it by yourself:
lxde-lxpanel_batt-plugin.zip (Size: 39.15 KB / Downloads: 697)
I use it on Armbian 5.86 Debian stretch with LXDE 9.9 and lxpanel version 0.9.3. It may also work with other versions of LXDE/lxpanel and in combination with different Armbian versions. Please post your message on whether it worked for you by mentioning your system configuration. Thanks!
|
|
|
|
| Udev rule for gpios for non root access |
|
Posted by: dkebler - 06-11-2019, 09:06 AM - Forum: Pi2, Euler and Exp GPIO Ports
- Replies (2)
|
 |
Using armbian bionic mainline kernel on A64-v1.1 board
Linux pine64 4.19.38-sunxi64 #5.83 SMP Fri May 3 21:02:31 CEST 2019 aarch64 aarch64 aarch64 GNU/Linux
Need to allow non-root access to gpio pins (i.e. gpio group with access to export and unexport etc) via udev. I've done this successfully before on an RPI but no matter what I try the gpio group and permissions are not set. Maybe it's something specific to Pine64 so asking here.
here is one version of rules I've tried. using udevadm I've confirmed the file is read and loaded but the changes are not made
Code: SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c 'find -L /sys/class/gpio/ -maxdepth 2 -exec chown root:gpio {} \; -exec chmod 770 {} \; || true'"
Any suggestions? Anyone have a successful udev rules for this board? If so please share
|
|
|
|
|