The AROS Archives(anonymous IP: 216.73.216.57,401) 
 HomeRecentStatsSearchSubmitUploadsMirrorsContactInfoDisclaimerConfigAdmin
 Menu

 Features
   Markdown composer
 

 Categories

   o Audio (128)
   o Datatype (18)
   o Demo (65)
   o Development (269)
   o Document (70)
   o Driver (20)
   o Emulation (71)
   o Game (625)
   o Graphics (240)
   o Library (24)
   o Network (87)
   o Office (24)
   o Utility (336)
   o Video (22)

Total files: 1999

Full index file
Recent index file

Part of AROS World
 Readme for:  Utility » Hardware » pitopbatt.aarch64-aros.lha

PiTopBatt

Description: Battery monitor for the pi-top [1] laptop
Download: pitopbatt.aarch64-aros.lha       (TIPS: Use the right click menu if your browser takes you back here all the time)
Size: 41kb
Version: 0.6
Date: 10 Nov 26
Author: Rhun
Submitter: Rhun
Email: rafal1982/yahoo com
Requirements: piAROS (AROS AArch64), Raspberry Pi 3 or 4, pi-top [1]
Category: utility/hardware
Replaces: utility/hardware/pitopbatt.aarch64-aros.lha
License: Other
Distribute: yes
FileID: 3609
 
Comments: 0
Snapshots: 0
Videos: 0
Downloads: 54  (Current version)
107  (Accumulated)
Votes: 1 (0/0)  (30 days/7 days)

[Show comments] [Show snapshots] [Show videos] [Show content] [Replace file] 
PiTopBatt
=========

PiTopBatt shows the state of the battery of the pi-top [1] laptop
under piAROS, the AArch64 version of AROS for the Raspberry Pi.

The pi-top [1] battery pack has a "Smart Battery" gauge (SBS standard)
on the I2C bus at address 0x0B. PiTopBatt reads it directly through the
hardware I2C controller of the Raspberry Pi. No driver and no extra
library are needed.

PiTopBatt only READS the battery. It never writes any setting to the
gauge and does not touch the pi-top hub.


Features
--------

 - Charge in percent with a gauge and the time left
   (or the time to full while charging)
 - Power source: on battery, charging, full, on charger
 - Current (mA) and power (W), voltage, temperature
 - Details window: remaining, full and design capacity, battery health
   in percent, cycle count, what the battery asks of the charger,
   decoded status bits and alarms, I2C statistics
 - Warnings: battery low (15 % or less), empty, too hot, over-charged
 - Mini mode: a small strip on the screen title bar, red with "!" on
   a warning; it can be dragged left and right. It shows the charge
   and the time left together ("Bat 77% 10:20"), in turn ("Bat 77%",
   then "Bat 10:20", switching every 1 to 10 seconds), or only one of
   them; without a battery it shows "Bat n/a"
 - Transparent strip: only the text and the gauge stay visible
 - Save report: everything in one text file, RAM:PiTopBatt-report.txt
 - Refresh every 2, 5, 10, 30 or 60 seconds
 - Settings are kept in ENVARC:PiTopBatt.prefs


Requirements
------------

 - pi-top [1] laptop (the first, grey/green model with the keyboard)
 - Raspberry Pi 3 or 4 running piAROS (AArch64)
 - Raspberry Pi 5 is NOT supported (its GPIO and I2C are in the RP1
   chip); the program refuses to start on it
 - pi-top [3], pi-top [4] and UPS boards for the Pi use other chips and
   are not supported


Installation
------------

Copy PiTopBatt and PiTopBatt.info to any drawer, e.g. SYS:Utilities.
To start it automatically, put a copy (or a link) into SYS:WBStartup
and add the tooltype DONOTWAIT to its icon.

Please copy the files to an AROS disk first; do not run the program
directly from a FAT-formatted USB stick.


Usage
-----

Double-click the icon or start "PiTopBatt" from the Shell.

The main window shows the charge, the power source and the main values.
"Details..." opens the second window. "Mini" (or menu Project ->
Mini mode) replaces the window with the small strip on the screen title
bar; click the strip to get the window back. The right mouse button
over the active strip opens its menu: Full window, Transparent, Show
gauge, About and Quit. The same two settings are also in the menu
"Mini" of the main window.

"Transparent" (on by default) cuts the strip to the shape of the text
and the gauge, so the title bar (or whatever is behind) shows through.
When the strip opens, it may flash once while it finds the text. Untick
"Transparent" in the menu for the plain strip.

Only one PiTopBatt runs at a time: starting it again brings the
running one to the front.

If "Start in mini mode" is ticked, the next start goes straight to the
strip.

"Strip:" in the main window chooses what the strip shows:

  Charge and time        "Bat 77% 10:20"
  Charge, time in turn   "Bat 77%", then "Bat 10:20"; "every" sets how
                         long each part stays (1, 2, 3, 5 or 10 s)
  Charge only            "Bat 77%"
  Time only              "Bat 10:20"

On the charger the time is replaced by "chg", "full" or "AC". When the
time is not known yet, the charge is shown.


Tooltypes / Shell arguments
---------------------------

The icon contains these tooltypes, switched off with brackets. Remove
the brackets to use one.

  MINIX=75          left edge of the strip, percent of the screen width
                    (if set, a dragged position is not remembered)
  MINIY=0           top edge of the strip, pixels
  MINIH=16          height of the strip, pixels (default: title bar)
  MINICOLOR=000000  background colour of the strip, RRGGBB
  MINIBAR=NO        no gauge in the strip, only the text
  MINISHOW=BOTH     what the strip shows: BOTH, TURN (in turn),
                    CHARGE or TIME
  MINICYCLE=3       seconds for each part when MINISHOW=TURN

From the Shell:

  PiTopBatt [MINI] [MINIX=n] [MINIY=n] [MINIH=n] [NOBAR] [MINICOLOR=RRGGBB]
            [MINISHOW=BOTH|TURN|CHARGE|TIME] [MINICYCLE=n]


Status and known limits
-----------------------

This is the first public version.

 - Reading the battery was tested on a real pi-top [1] with a Raspberry
   Pi 3: all values are read correctly; the gauge sometimes needs a
   second or third attempt, which the program handles by itself.
 - The pi-top [1] exists with two hub versions (v1 and v2). The battery
   is read the same way on both, but only one of them has been tested
   so far.
 - Warnings are shown in the window and in the strip only; there is no
   requester and no sound yet.
 - PiTopBatt uses the I2C bus on GPIO 2 and 3 only for a moment at each
   reading and frees it again, so other programs can use the bus in
   between. Two programs reading the bus at exactly the same moment
   could still disturb each other.

If something does not work, please use "Save report..." and send the
file RAM:PiTopBatt-report.txt to the author.


History
-------

0.6 (01.11.2026)  Transparent strip works on newer AROS builds and
                  is on by default; only one copy runs at a time.
0.5 (27.10.2026)  The strip shows charge and time together, in turn,
                  or only one of them ("Strip:" in the window,
                  MINISHOW, MINICYCLE), the text sits closer to the
                  gauge, transparent strip,
                  no "x" on the strip (Quit is in its menu), "Bat"
                  in front of the values, "Bat n/a" without battery.
0.4 (18.10.2026)  First public version, Zune window and mini mode.
                  (0.1 - 0.3 were text-only test programs.)


Licence
-------

Copyright (c) 2026 rhun. All rights reserved.
Freeware: free to use and to pass on, unchanged and together with this
readme. Provided "as is", without warranty of any kind; use at your own
risk. The author is not liable for any damage resulting from its use.

Written with help from Claude (AI). Facts about the pi-top battery
come from the public pi-top documentation and software; no code of
other projects is used.



Copyright © 2005 - 2026 The AROS Archives All Rights Reserved