Start charging on command line? (Charging doesn't start automatically; SZ 1.53)


hmc

Active Member
Joined
Dec 19, 2011
Messages
787
Location
Bavaria, Germany
Hi guys,

my NAND installation of SZ 1.53 never seems to start charging. That's not a problem in normal usage, because I normally boot from SD, and that installation starts charging most of the times when plugging in the AC adapter (no hardware problem).

But for creating a full backup, I boot from NAND, so I can safely backup the rootfs of the SD, too.

However, having an external hard disk connected via USB,  a full charge is not enough for a ful backup. 

Is there a way to start charging via a command?

I assume that there is just one trigger missing. Maybe the software doesn't know when the AC adapter was plugged in for some reason?...

How to debug that?

Thanks!
 
Charging is normally always enabled, so as soon as you plug the charger it should start charging. If it doesn't, there are /sys/class/power_supply/twl4030_*/enable controls that you can check.
 
that doesn't help.

I plug in AC, the charging LED does not switch on and the battery monitor keeps decreasing the % value.

Then I try to re-enable chariging.


sudo su
Password:
$ cat /sys/class/power_supply/twl4030_ac/enable
1
$ echo 0 > /sys/class/power_supply/twl4030_ac/enable
$ cat /sys/class/power_supply/twl4030_ac/enable
0
$ echo 1 > /sys/class/power_supply/twl4030_ac/enable
$ cat /sys/class/power_supply/twl4030_ac/enable
1
But it's still not charging.

Connecting the same AC adapter to another Pandora, or to the same Pandora booted from SD instead of NAND, charges most of the times flawlessly.

Any more ideas?
 
Have you tried a full reflash(Not OS update) to the latest SZ 1.54?
 
Last edited by a moderator:
Are you absolutely sure it charges when booted from that SD?

One possible problem is outdated bootloader, but you should've got that flashed along with 1.53.
 
I flashed 1.53 (but not 1.54RC via full-flash).
Yes, I know that it charges when booted from SD. It currently does (even if with the charging LED off, but the battery monitor's value increases constantly).

Something is weird with charging. I can't see a pattern there.

I even removed the battery for some minutes and reinserted it. No luck charging with NAND boot.

Will try a full reflash of 1.54RC soon. Just downloading the ZIP.

Oops.

I just rebooted into NAND, plugged in the charger, and the charging LED instantly switched on. So it's even not a permanent software issue. 

Might it be some kind of hardware state, that's influenced by software, so now NAND boot also can charge, after I charged for a while using SD boot? I'm puzzled.
 
Strange.

I just bought another Pandora (1GHz) from ED for a customer of mine. Currently preparing it, preinstalling software etc.

It has the same problem. No charging on NAND boot possible.

This was with freshly flashed 1.54RC plus updates via "Upgrade Pandora OS".

I plug in the AC charger, and nothing happens.

Even after a reboot.

Took out battery and rebooted --> charging worked.

Plugged in USB hub with mouse, keyboard, DisplayLink --> charging didn't work anymore.

Unplugged USB hub again --> charging still didn't work.

Normal reboot --> charging still doesn't work (or at least charging LED stays off).

Took out battery and rebooted --> when connecting charger, the charging LED shortly flashes on and then is off again. Dis- and reconnect doesn't help. 

More tests later, as I now have to leave this alone.

 
 
Just a thought but it may be worth checking if it's actually charging or not with the sysinfo app.  

For some reason the LED triggers don't always work properly the first time they are triggered after power on, so for example if you turn on wifi for the first time since boot via the config button menu the wifi LED doesn't turn on. (though wifi works fine)  Similarly, if you boot the pandora with the charger connected the charging LED doesn't turn on, but it will actually be charging.  (if you then disconnect and reconnect the charger the LED lights up as it normally would)

- Neelix
 
sysinfo app is a good hint, will use that one in future.

This time I can say for sure it doesn't load, because in the meantime (since my last posting) the battery gauge dropped from 20% to 14%, charger connected. :-(
 
Did you use the same charger on both units?


If yes, are you sure the charger is not broken?
 
I tried with different chargers. Both sometimes charge and sometimes don't charge. So I am pretty sure that it's not a charger problem.
 
Sorry for the gravedig but I'm currently experiencing an issue that may be related.
My other machine died a couple of days ago so I've been mostly been using the Pandora as my main machine instead. To that end I connected my mouse, keyboard and an external wifi adapter via a USB hub.

I've discovered that the Pandora won't start to charge if I have these USB devices connected. (and thus drawing power) If I disconnect them the Pandora sometimes starts charging automatically and if it doesn't I can unplug the power cable and plug it back in to trigger charging. Once it's charging again I can reconnect my USB devices and it will happily continue to charge to 100%, but it can't seem to get started if that additional power draw is in play.

Any suggestions for a work-around?

-Neelix

Edit: According to System Info the Pandora is drawing ~5700 mW via the power socket when charging with the USB devices connected.
 
I would also add that when the battery level gets down to about 85% the 'Charging' LED will start blinking irregularly. It will light up, then a second later it goes out again, as if it's attempting to start charging then giving up. System info never actually shows any input wattage when this happens though.

-Neelix
 
How have you calculated that 5700mW number? As I understand it the system info battery monitor only lists numbers in mW on the power line, which indicates how much the system is using minus the current going into the battery, so it normally goes negative if the battery is actually being charged.

5700mW also seems a pretty high power consumption. My Pandora (admittedly with wifi and usb off, and only using ~2% of CPU) used some 800mW of power when I just checked it.

Also, what charger are you using, and what is it's claimed current output? I lost my official one on my travels long ago, so have been using a variety of solutions to charge it since. Currently I'm using a portable battery pack with claimed 2.1A output mainly that can only charge or recharge at the same time - it can't pass through input power. I have noticed the charge light flick on and off when the pandora's drained the battery pack and I plug the battery in to my wall wart - but I put that down to the battery getting confused. It's like it's gone to sleep having discharged, and wakes up going 'what was I doing? Oh, charging that Pandora. But someone's giving me power. Charge or recharge? Recharge or charge? Oh, that currents still coming in, and I guess I am pretty low on charge, I'd better recharge myself'
 
I didn't calculate that figure. When the Pandora is charging it shows a figure in parentheses labelled "input:" measured in mW. That figure fluctuates a fair bit but at the time I posted was hovering around the 5700mW range. (Currently it seems to be bouncing between ~5300mW and ~5700mW) I have no idea how accurate it is.

The power supply is the one that came with my original CC Pandora (which vanished into the ether when I sent it back for an LCD cable replacement and was eventually replaced with a rebirth unit) It's rated for 5V @ 2A, and it does supply enough power to charge the battery with the USB stuff connected as long as the charging has already started when the USB hub is plugged in.

Interestingly, If I also plug in my phone into the USB hub, it tries to recharge from Pandora and that keeps the Pandora itself from charging. the LED will stay lit and system will report that it's charging, and System info will show an input figure, but system info will also show the battery as discharging. However I don't actually need to connect my phone to the Pandora most of the time, so that isn't really an issue for me.

-Neelix
 
Ah, thanks. I'd evidently not run it very often while charging, and didn't test it then, so wasn't aware of that extra label.

Hmm, that would suggest the light isn't using the total power stat to decide to illuminate or not, it's using a separate input metric it has access to. I didn't know that before, thanks!

And it would suggest your official CC charger puts out a little over an amp assuming it's a 5V supply. Not bad but it might explain why the system discharges when you hook too much stuff up to it. It doesn't explain why the light doesn't light in your situation though.

I don't have anything that both charges off some form of 5V supply and can take enough juice to simulate this. I know it doesn't happen with my wifi nub switched on, but I suppose that's not taking enough power or something to do this. Or maybe it needs a hub between the USB port and the device(s) somehow?

Just to check, I assume you updated to SZ 1.75 when it became available? That has some power tweaks in it that might affect this behaviour. Can you run system info when it's plugged into the charger but apparently not charging, to see if that thinks it's getting any charge from the charger?
 
I'm still running 1.74 actually. I'll run an upgrade and see if that makes a difference.
When it apparently tries and fails to start charging (LED lights up for a second or so and goes out) there is no indication in system info that it even tried to draw any power, it just keeps discharging.
[doublepost=1481663587,1481661685][/doublepost]I was still running 1.74 actually. I just upgraded to 1.75 update 5 though. Currently the Pandora is in a charge cycle, so I'll see what happens when the next cycle comes around.

As I mentioned earlier, when the battery level was 85% and the system was apparently attempting to start the charge cycle (the Charging LED lit up briefly from time to time then went out after a second or so) there was no change in the system info display to indicate that it was even trying to charge.

-Neelix
 
Well the charger tends to misbehave like that in certain situations. You can force restart it in software by writing "0" to /sys/class/power_supply/twl4030_ac/enable and then "1" again after a short while, then it comes back to it's senses in some cases (pndevmapperd does it from time to time too, but only when battery is low).
(edit: just noticed I've already posted that advice in this very thread, ohwell)

You should also ensure you have good contact to the battery, for example if there is bad contact to thermistor pin the system will work fine but refuse to charge.
Any output in dmesg?
 
Now that was interesting...
Updating the OS does not seem to have solved the problem.
cycling /sys/class/power_supply/twl4030_ac/enable to 0 and back to 1 did in fact trigger the charging process to activate and remain active, however it was only drawing ~1100mW as input, and the battery continued to discharge. As soon as I unplugged the usb hub though the input shot back up to ~5700mW.

The entire time it was discharging the dmesg log was filled with messages like this:
Code:
[ 6330.595581] twl4030_bci_interrupt: 8 callbacks suppressed
[ 6330.595611] twl4030_bci twl4030_bci: battery temperature out of range
[ 6330.644439] twl4030_bci twl4030_bci: battery temperature out of range
The messages stopped once the charge cycle began.
System info seems to have no trouble reading the battery temperature though which hovered around 21 degrees while discharging and is currently hovering at around 31 degrees.

-Neelix
 
That's not good, the message is printed when twl4030 fires an interrupt, not by some software decision. The temperature sysinfo reports is from a different chip, so the connection to that monitoring chip is fine, but perhaps not to the charger. If your pandora works without a battery, you may try that, otherwise you'll probably need a powered hub.
 
Back
Top