[SOLVED] Battery Low: 0% Warning

'User made' tutorials related to Porteus Kiosk edition.
Official kiosk documentation can be find here: http://porteus-kiosk.org/documentation.html
Forum rules
Porteus Kiosk section of the forum is unmaintained now. Its kept in a 'read only' mode for archival purposes.
Please use the kiosk contact page for directing your queries: https://porteus-kiosk.org/contact.html
Fry
White ninja
White ninja
Posts: 5
Joined: 08 Mar 2019, 01:13
Distribution: Porteus Kiosk 4.8.0

[SOLVED] Battery Low: 0% Warning

Post#1 by Fry » 08 Mar 2019, 01:30

G'day All,

Just installed Porteus Kiosk (4.8.0) on one of our Intel NUC machines and am getting a Battery low: 0%, please connect to a power source.

All good and well ... except these units do not run of battery so the system has obviously detected it as a latop.

Does anyone know if there is any way to disable these warnings?

Thanks

Fry
Last edited by Fry on 19 Mar 2019, 23:03, edited 3 times in total.

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5667
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Battery Low: 0% Warning

Post#2 by fanthom » 08 Mar 2019, 04:10

Hello Fry,

Please try this parameter which should kill the battery check process:

Code: Select all

run_command=killall battery_polling
Please add [Solved] to your thread title if the solution was found.

Fry
White ninja
White ninja
Posts: 5
Joined: 08 Mar 2019, 01:13
Distribution: Porteus Kiosk 4.8.0

Battery Low: 0% Warning

Post#3 by Fry » 08 Mar 2019, 04:30

G'day Fanthom,

No dice I'm afraid it still keeps on showing.

I connected to the console and ran the command manually and received a No Processed Killed response

Perhapse the service has a different name now? I'm not great with linux so I've got no idea here.

Thanks

Fry

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5667
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Battery Low: 0% Warning

Post#4 by fanthom » 08 Mar 2019, 05:02

This scrips is not executable and runs through the shell interpreter (shell is the process).

This one should do:

Code: Select all

kill -9 $(ps | grep battery_polling | tr -s ' ' | sed -e 's/^ //g' | cut -d' ' -f1)
Please add [Solved] to your thread title if the solution was found.

Fry
White ninja
White ninja
Posts: 5
Joined: 08 Mar 2019, 01:13
Distribution: Porteus Kiosk 4.8.0

Battery Low: 0% Warning

Post#5 by Fry » 11 Mar 2019, 22:11

G'day,

Thanks again for your response. Unfortunately this also does not seem to be working.

Perhaps we are talking about different things. This is the battery warning I am getting:
Image

I have also added the following line to my config file:
run_command=kill -9 $(ps | grep battery_polling | tr -s ' ' | sed -e 's/^ //g' | cut -d' ' -f1)

I should probably add that this previously read:
run_command=killall battery_polling

All other items in the config file are working.

Is there something here that I'm missing?

Thanks

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5667
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Battery Low: 0% Warning

Post#6 by fanthom » 12 Mar 2019, 08:11

It works for me.

Please login to your kiosk over SSH and show me an output of following command:

Code: Select all

ps | grep battery_polling
Please add [Solved] to your thread title if the solution was found.

Fry
White ninja
White ninja
Posts: 5
Joined: 08 Mar 2019, 01:13
Distribution: Porteus Kiosk 4.8.0

Battery Low: 0% Warning

Post#7 by Fry » 13 Mar 2019, 00:10

Result:

Code: Select all

10010 root      0:00 grep battery_polling

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5667
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Battery Low: 0% Warning

Post#8 by fanthom » 13 Mar 2019, 08:40

That means the 'battery_polling' process is properly killed by your 'run_command=' parameter (grep process does not count).
You should not receive the 'low battery' notification anymore.

If this is not the case then please contact with support@porteus-kiosk.org and i'll ask you for associating your kiosk with my PK Server so i could debug this problem over SSH and VNC.

Thanks
Please add [Solved] to your thread title if the solution was found.

Fry
White ninja
White ninja
Posts: 5
Joined: 08 Mar 2019, 01:13
Distribution: Porteus Kiosk 4.8.0

Battery Low: 0% Warning

Post#9 by Fry » 14 Mar 2019, 03:27

G'day,

After some further investigations this morning building on what you have suggested I managed to work out my failings and get a solution:

The battery polling can be terminated with your kill command:

Code: Select all

run_command=kill $(ps | grep battery_polling | tr -s ' ' | sed -e 's/^ //g' | cut -d' ' -f1)
The reason I didn't think it was working is because notification remained on the screen. Clicking on the notification would clear it but as this machine is used for Digital Signage it has not input devices.
I took a look at the battery_polling script and noticed it was calling dunstify to create the notification and was wonderfully programmed with a ID which I could target to close.

The resulting run command is used to disable the battery_polling script and close the notification:

Code: Select all

run_command=kill $(ps | grep battery_polling | tr -s ' ' | sed -e 's/^ //g' | cut -d' ' -f1); dunstify -C 333
Thank you so much for your support with this.

On a side note, I did play around with using the following code:

Code: Select all

pkill -f battery_polling; dunstify -C 333
This achieves the same task but as mentioned my Linux skills are next to none so I'm wondering if there is any benefit to either solution?

Thanks again

Fry

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5667
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

SOLVED: Battery Low: 0% Warning

Post#10 by fanthom » 14 Mar 2019, 08:15

Both commands do the same but 'pkill' is easier to understand.

Thanks for sharing.
Please add [Solved] to your thread title if the solution was found.

Locked