[question] How to prevent charging from USB on Jolla Tablet ?

asked 2016-07-10 19:59:26 +0300

Schturman gravatar image

I know about this two threads:

https://together.jolla.com/question/95476/how-to-prevent-charging-from-usb/
https://together.jolla.com/question/55764/charging-limitation-for-enhanced-battery-life-feature-request/?answer=85249#post-id-85249

but both solutions works on Jolla Phone only... The tablet is a little bit different. The needed files located here:

/sys/devices/platform/80860F41:04/i2c-5/5-0034/dollar_cove_charger/power_supply/dollar_cove_charger
/sys/devices/platform/80860F41:04/i2c-5/5-0034/dollar_cove_battery/power_supply/dollar_cove_battery

When you connect tablet to power supply, then enable_charging and enable_charger changing to 1. If you will change it to 0, nothing happens.. The status still show Charging, and also icon in the status bar is still there.
Any idea how to do the same like on the phone ?
Thanks

edit retag flag offensive close delete

Comments

1

The URL you show suggests to me, you're looking in the wrong place. I see no mention of USB in the URL/path.

Spam Hunter ( 2016-07-10 22:48:21 +0300 )edit

This is a correct place on my tablet...
Also I found a way how to disable charging... If I run this command:

echo 0 > /sys/devices/platform/80860F41:04/i2c-5/5-0034/dollar_cove_charger/power_supply/dollar_cove_charger/present

it stop charging my tablet, but with big delay.. after something like 30-40sec... And now if you will check status:

cat /sys/devices/platform/80860F41:04/i2c-5/5-0034/dollar_cove_battery/power_supply/dollar_cove_battery/status

instead "Discharging", you will see "Not charging"...
Any other solutions ?

Schturman ( 2016-07-10 23:20:15 +0300 )edit

OK, by this 3 commands it work for me (when usb cable connected):

chmod 777 $(find /sys/devices/platform -type f -name present|grep power_supply|grep charger|grep -v alien)
echo 0 > $(find /sys/devices/platform -type f -name present|grep power_supply|grep charger|grep -v alien)
chmod 444 $(find /sys/devices/platform -type f -name present|grep power_supply|grep charger|grep -v alien)

to restore (when usb cable is still connected):

chmod 777 $(find /sys/devices/platform -type f -name present|grep power_supply|grep charger|grep -v alien)
echo 1 > $(find /sys/devices/platform -type f -name present|grep power_supply|grep charger|grep -v alien)
chmod 444 $(find /sys/devices/platform -type f -name present|grep power_supply|grep charger|grep -v alien)

but like I said it can take some time to see the result... something like between 30sec and 1min.
BEWARE - use it on your own risk...

Schturman ( 2016-07-11 02:32:58 +0300 )edit

Here's what I came up with (lol) for Jolla phone, after adding nemo to sudoers file and creating a .sh script to do the business;

> #!/bin/sh
> 
> TOGGLE=$HOME/.toggle
> 
> if [ ! -e $TOGGLE ] then touch $TOGGLE
>     sudo chmod 4777 /sys/class/power_supply/usb/charger_disable
>     echo 1 > /sys/class/power_supply/usb/charger_disable
> else rm $TOGGLE
>     sudo chmod 4777 /sys/class/power_supply/usb/charger_disable
>     echo 0 > /sys/class/power_supply/usb/charger_disable
> fi

Sometimes there is a delay in turning charging back on, but it's only a few seconds, not 30 or 40 secs. (I will learn how to format text here on TJC!)

Spam Hunter ( 2016-07-11 13:30:40 +0300 )edit

@Markkyboy, I speak about Jolla Tablet, not the phone ;)

Schturman ( 2016-07-11 14:03:41 +0300 )edit