Topic: Chumby One on battery with offline firmware

You need to modify the battery system with a patch for working with the offline firmware on battery.
ssh into the chumby in offline mode and then :
mount -o remount,rw /
/mnt/usb/nano/bin/nano /usr/chumby/scripts/power_state_changed.sh
---edit the file as shown below putting the #'s in the correct place---
#!/bin/sh

. /etc/profile
SHOULD_TELL_FLASH=1
if [ "x$1" = "x-n" ]
then
    SHOULD_TELL_FLASH=0
fi

AC_ONLINE=$(cat /sys/class/power_supply/ac/online)

echo "AC online? ${AC_ONLINE}  Telling flash? ${SHOULD_TELL_FLASH}"


if [ ${AC_ONLINE} -eq 1 ]
then
    for bl in $(/bin/ls --color=never /sys/class/backlight/)
    do
#        echo 100 > /sys/class/backlight/${bl}/max_brightness
    done
#    iwconfig wlan0 power off

    # Restore power to port 1.
#    hub-ctrl -h 0 -P 1 -p 1

else
    MAX_BRIGHTNESS=50
    if [ -e /psp/max_brightness_battery ]
    then
        MAX_BRIGHTNESS=$(cat /psp/max_brightness_battery)
    fi

    for bl in $(/bin/ls --color=never /sys/class/backlight/)
    do
#        echo ${MAX_BRIGHTNESS} > /sys/class/backlight/${bl}/max_brightness
    done

#    iwconfig wlan0 power on

    # If the connected device draws more than 200mA, cut it off.
    if [ "$(chumby_version -h | cut -d'.' -f2)" -lt "7" ]
    then
        MP=$(cat /sys/class/usb_device/usbdev1.2/device/1-1.1/bMaxPower | tr -d mA)
        if [ $? = 0 -a ${MP} -gt 200 ]
        then
            # Try multiple times to ensure the port is gone.
            # I'd really rather not do this, but if we want to turn the port off
            # as soon as the device is plugged in, it seems as though it will get
            # turned back on, especially if we're dealing with an ipod.
            for i in 1 2 3 4 5 6
            do
#                hub-ctrl -h 0 -P 1 -p
                sleep 1
            done
        fi
    fi
fi


if [ ${SHOULD_TELL_FLASH} = 1 ]
then
    # Tell flash about the change.
    true
fi
------------------
cntrl X enter to save
sync
mount -o remount,ro /

Re: Chumby One on battery with offline firmware

Zurk, just wondering, are we disabling the auto dimming and the wlan sleeping on battery?  What effect will this have on battery life?

Guess I'll have to check sometime.  Didn't they clock it around 1 hour or so stock?

Re: Chumby One on battery with offline firmware

Zurk, thanks for covering all the details with this transition. I've saved your instructions above, but I'm still pretty backward in altering the files inside the Chumby. It'll take me a while to get up to this point with the battery. What would happen to a Chumby w battery without the modification? Will it just plain not work, or do potential harm?

Off topic, I want to compliment you on your teaching skills. Starting from ground zero, you've taught hundreds of us how to do some very valuable stuff. I think the efforts by you, Duane, and some others show there's still great spirit in open-source projects, as opposed to the "open source with a catch" use like Google.

Re: Chumby One on battery with offline firmware

I did the patch, works fine on USB use when I unplug the chumby from power supply. Unfortunately it crashes when I plug in power supply again. What can I do? Any hints?
Regards, oliaros