Page 1 of 1

[SOLVED] Battery Low: 0% Warning

Posted: 08 Mar 2019, 01:30
by Fry
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

Battery Low: 0% Warning

Posted: 08 Mar 2019, 04:10
by fanthom
Hello Fry,

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

Code: Select all

run_command=killall battery_polling

Battery Low: 0% Warning

Posted: 08 Mar 2019, 04:30
by Fry
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

Battery Low: 0% Warning

Posted: 08 Mar 2019, 05:02
by fanthom
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)

Battery Low: 0% Warning

Posted: 11 Mar 2019, 22:11
by Fry
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

Battery Low: 0% Warning

Posted: 12 Mar 2019, 08:11
by fanthom
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

Battery Low: 0% Warning

Posted: 13 Mar 2019, 00:10
by Fry
Result:

Code: Select all

10010 root      0:00 grep battery_polling

Battery Low: 0% Warning

Posted: 13 Mar 2019, 08:40
by fanthom
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

Battery Low: 0% Warning

Posted: 14 Mar 2019, 03:27
by Fry
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

SOLVED: Battery Low: 0% Warning

Posted: 14 Mar 2019, 08:15
by fanthom
Both commands do the same but 'pkill' is easier to understand.

Thanks for sharing.