Start a new topic

Battery status display on desktop pannel

Right now you can type "pt-status" in a console window, but there is no continuous battery status display while you are on the desktop.


I have therefore created a little program to display the pi-top battery status on the desktop. It displays a small icon on the task bar.


To download, use the browser and navigate to github.com

Then search in github for pi-top-battery-status


Installation instructions are there.


Questions and suggestions for improvement are most welcome.


gtk_battery makes now a log of all activities in /home/pi/batteryLog. I hope this might help to find out what went wrong if the battery fails.

2 people like this
Thanks, Stuart, for your encouraging feedback. Thanks also to Gio from Italy, who fixed a nasty little bug in the install script. It's a pleasure to be able to contribute to the success of the pi-top. Regards, Rene

2 people like this
Many thanks to all the supporters and users of the battery status indicator at github.com/rricharz/pi-top-battery-status and all the positive feedback. More than 1000 downloads last year!

2 people like this

Finally here as requested by many users! A battery icon in the system tray on the right side of the desktop panel for users of pi-topOS.


If you are using pi-top-battery-status on pi-topOS, consider using github.com/rricharz/pi-top-battery-widget instead. It displays the battery icon in the system tray.


The latest version of pi-topOS takes care of low battery warnings and shuts down the pi-top properly if the battery charge gets too low. These functions in pi-top-battery-status are therefore not required anymore. pi-top-battery-widget just displays the battery icon and does not interfere with pi-topOS in any other way.


pi-top will soon release a version of their device manager (see github.com/pi-top/Device-Management) of standard Raspbian. Once this is released, users of standard Raspbian on the pi-top will also be able to use pi-top-battery-widget. 


Your feedback is most welcome.


1 person likes this

There is a new version of the pi-top-battery-status program available at github.com/rricharz/pi-top-battery-status


It solves a problem causing it not to shut down the pi-top at very low battery capacity levels under certain circumstances. You can find an easy procedure how to upgrade your version if you scroll towards the bottom of the page. Sorry for the inconvenience. Please keep reporting any bugs or problems you have with the program.


1 person likes this

Hi Markus,


I have not found a way to do this easily. As far as I know there is currently no easy way to add taskbar plugins, but I have read somewhere that there are plans to change this. All I found is how to rearrange the panel:


Right click on the task bar, choose "Add/Remove panel items". Then select "Panel Applets".

Scroll down to "Task bar (Window List)". You can play here with the various "Stretch" boxes. You can see how they are moved right away.


If you want it more compact, double click on "Task bar (Window List)". If you now select "Icons only", the active tasks will iconize. Select the "OK" button. You can still go with your mouse pointer over any of the taskbar items to see more details.


Have fun!


Rene


1 person likes this

Thanks to Alexandra Crawford we have a new link for the battery firmware upgrade from pi-top. I have updated the detailed step-by-step procedure to diagnose battery problems, which can be found at

  github.com/rricharz/pi-top-battery-status


Scroll towards the bottom and look at the link found in the section "What to do if you have problems with your battery".


Suggestions for improvements of this procedure are most welcome.

The pi-top-battery-status display (gtk_battery) has been expanded:


If you double click the battery status icon, you can now see the actual charging or discharging current. I find this very useful to see how much additional current is drawn in the discharging mode when additional hardware is connected (for example usb devices or hats on the pi-topPROTO board).


Furthermore, the log contains now additional information about the status and health of the battery:


- battery capacity in mAh

- charging and discharging current

- Total voltage

- Individual voltage of each of the 4 cells of the battery


For more details, search on github.com for pi-top-battery-status.


I hope you enjoy the program.



Bruce, sorry that it took a few days to modify and test pi-top-battery-status to work for any user with the proper privileges. You should now be able to install it for other users than pi. Please see the comment at the bottom of the readme.md file about adding the necessary privileges for other users. Please let us know whether it works now for you.

Installation is failing :-( Failed to run command gtk_battery (I've made it executable)

Ok, issue was that the install file had 'bin1' as the bin name.


But now when it runs it reports that it does not have access to the battery pack.

Sorry, it took me some times to figure out how some things are working. Here are the result of the process.


I hope it can help. Nevertheless, Pi-Top Support Team proposes me to change the battery, but maybe we can sorted this thing this way. Otherwise, I'll ask for a new battery.


Thanks!

(1.34 KB)
(923 Bytes)

Thanks for the update, Rene! I'm fiddling with the new version now.

BTW: I'm an experienced Pi user :-)


I've now got the application running, but it still shows 0% battery in the window.


the pt-battery returns:

 (standard_in) 1: illegal character: R

(standard_in) 1: illegal character: O

(standard_in) 1: illegal character: R

(standard_in) 1: illegal character: :

(standard_in) 1: illegal character: O

(standard_in) 1: illegal character: U

(standard_in) 1: illegal character: L

(standard_in) 1: syntax error

(standard_in) 1: illegal character: N

(standard_in) 1: illegal character: O

(standard_in) 1: illegal character: T

(standard_in) 1: illegal character: O

(standard_in) 1: illegal character: P

(standard_in) 1: illegal character: N

(standard_in) 1: illegal character: I

(standard_in) 1: illegal character: L

(standard_in) 1: illegal character: `

(standard_in) 1: illegal character: V

(standard_in) 1: illegal character: I

(standard_in) 1: illegal character: '

(standard_in) 1: illegal character: O

(standard_in) 1: illegal character: R

(standard_in) 1: illegal character: `

(standard_in) 1: illegal character: V

(standard_in) 1: illegal character: I

(standard_in) 1: illegal character: '

(standard_in) 1: illegal character: :

(standard_in) 1: illegal character: N

(standard_in) 1: illegal character: O

(standard_in) 1: illegal character: S

(standard_in) 1: illegal character: U


gtk-battery reports: Unable to init server: Could not connect: Connection refused


So I suspect it's not working correctly.  I'm using a Pi3 with the latest PiTop 0.2.7 Dev version.



Login or Signup to post a comment