Bugzilla – Bug 12598
Battery Charging
Last modified: 2009-10-05 14:36:54 UTC
Charging must be complete by MP.
Chris and Micky state: we should really test this feature before we ship to thousands of customers.
r6471 makes charging work well enough for MPQ build.
Reset priority before triage.
First whack checked in to r6880, non-MP branch. Works on PA5 and later boards. Earlier boards won't work right, but will still charge at about 1/2 rate and will die early. it should not overcharge or over drain the batteries on any boards, but this has not been fully tested. ymmv.
== Auto-comment from SVN commit #6351 to the player repo by ccrome == == https://svn.slimdevices.com/player?view=revision&revision=6351 == Bug 12598. Fixed much of battery charging. Should properly terminate by temperature and timeout. May still need tweaks, but is basically there.
== Auto-comment from SVN commit #7214 to the jive repo by ccrome == == https://svn.slimdevices.com/jive?view=revision&revision=7214 == Bug 12598. Fixed much of battery charging. Should properly terminate by temperature and timeout. May still need tweaks, but is basically there.
== Auto-comment from SVN commit #7215 to the jive repo by ccrome == == https://svn.slimdevices.com/jive?view=revision&revision=7215 == Bug 12598. Fixed much of battery charging. Should properly terminate by temperature and timeout. May still need tweaks, but is basically there. Added some new devices to the /sys interface: battery_charge_rate is a RW variable that allows the host to read/modify how fast (in seconds/mAh) charging happens. battery_discharge_rate is a RW variable that allows the host to read/modify how fast the MSP thinks discharging is happening. This is how the host can tell the MSP how much power is being used. I think this will need to be modified however, to allow for finer grained control. units are seconds/mah. charger_event: tell which charge events happened: like battery inserted, charging started, stopeed, etc. see msp430 i2c.h for definitions. charger_state: tells what state the device is in: whether charging is idle, charging, discharging, etc. cbattery_charge tells the state of charge. This is a read/write variable, in case the host needs to update the value for some reason. battery_capacity: made read/write in case the host needs to modify. (For example, to manage multiple battery packs.)
== Auto-comment from SVN commit #7236 to the jive repo by ccrome == == https://svn.slimdevices.com/jive?view=revision&revision=7236 == Bug #12598. Added thermal limiting so the packs don't get too hot.
Application changes for battery status and low power are in at r7368. I've found the following issues so far: 1. unplug the ac, and the charger_state is reported as 2 (idle) for a few seconds before switching to 3 (discharge). this means that an "on ac" icon is incorrectly shown. 2. quickly reviewing the msp code, charger_state 4 (low battery) does not appear to be implemented. 3. if you power off (i simulated low battery state in the app), then you can't power on at all. the msp has to be reset.
I let a battery run out over night. Now it's not detected. 2 of my 4 batteries are not completely flat, so we at least need a backdoor to start charging these. If it helps, this is the mcu state: # for a in /sys/devices/platform/i2c-adapter\:i2c-1/1-0010/*; do echo $a; cat $a; done /sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_0 1023 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_1 363 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_10 450 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_11 680 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_12 4 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_13 4 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_14 4 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_15 4 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_2 56 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_3 426 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_4 901 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_5 0 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_6 727 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_7 258 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_8 902 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/adc_9 488 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/alarm_time 4294967295 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/ambient 477 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/battery_capacity 2000 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/battery_charge 0 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/battery_charge_rate 10 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/battery_disable 7 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/battery_discharge_rate 11 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/battery_temperature 639 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/battery_vmon1_voltage 0 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/battery_vmon2_voltage 1129 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/battery_voltage 5203 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/bus cat: read error: Is a directory /sys/devices/platform/i2c-adapter:i2c-1/1-0010/charger_event 0 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/charger_state 1 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/driver cat: read error: Is a directory /sys/devices/platform/i2c-adapter:i2c-1/1-0010/flash cat: can't open '/sys/devices/platform/i2c-adapter:i2c-1/1-0010/flash': Permission denied /sys/devices/platform/i2c-adapter:i2c-1/1-0010/fw 965 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/gp_register 283686952306183 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/input:input2 cat: read error: Is a directory /sys/devices/platform/i2c-adapter:i2c-1/1-0010/ir 1234 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/kill 238 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/modalias i2c:msp430 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/msp_buffer 283686965740782 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/name msp430 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/power_mode 3 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/rtc:rtc0 cat: read error: Is a directory /sys/devices/platform/i2c-adapter:i2c-1/1-0010/subsystem cat: read error: Is a directory /sys/devices/platform/i2c-adapter:i2c-1/1-0010/sys_voltage 17686 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/test_1 7 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/test_2 1543 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/test_4 67438087 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/test_8 283686952306183 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/time 160 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/uevent DRIVER=msp430 PHYSDEVBUS=i2c PHYSDEVDRIVER=msp430 /sys/devices/platform/i2c-adapter:i2c-1/1-0010/wall_voltage 18173 #
I'd left that battery plugged in for a while, and just notice that the mcu has not detected the battery. It's not fully charged but appears as AC power on the status bar.
== Auto-comment from SVN commit #6370 to the player repo by ccrome == == https://svn.slimdevices.com/player?view=revision&revision=6370 == Bug #12598. Implemented low battery state + fixed some broken on/off behavior.
== Auto-comment from SVN commit #7405 to the jive repo by ccrome == == https://svn.slimdevices.com/jive?view=revision&revision=7405 == Bug #12598. Implemented low battery state + fixed some broken on/off behavior.
== Auto-comment from SVN commit #7407 to the jive repo by ccrome == == https://svn.slimdevices.com/jive?view=revision&revision=7407 == Bug #12598: The 'power failing' flag is 1<<5, not 1<<4.
Battery charging seems to be in pretty good shape. All functionality is there, but It really requires testing. We have the 7 QA babies all stuffed with batteries, charging now. We need to play with them and get some hours on them to look for any corner cases we missed.
I'm going to call this one fixed since all functionality is implemented. Any new problems should just go under a new bug.
This bug has been marked as fixed in the 7.4.0 release version of SqueezeBox Server! * SqueezeCenter: 28672 * Squeezebox 2 and 3: 130 * Transporter: 80 * Receiver: 65 * Boom: 50 * Controller: 7790 * Radio: 7790 Please see the Release Notes for all the details: http://wiki.slimdevices.com/index.php/Release_Notes If you haven't already, please download and install the new version from http://www.logitechsqueezebox.com/support/download-squeezebox-server.html If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.