• itek powered Raspberry Pi runs for over 7 hours

    by  • March 31, 2013 • guide, hack, hackers, presentation, security, technology • 9 Comments


    I tested a model B Raspberry Pi (512 MB) using an itek power bank (5600 mAh), with Internet enabled. It pinged my server every minute, and ran for about 7 hours 22 minutes.

    Raspberry Pi & iTek battery pack

    Raspberry Pi & itek battery pack

    Set Up

    1. Raspberry Pi Model B (512 MB RAM), running latest updated Raspbian Wheezy build (with no additional background services running) on an 8 GB class 4 SD card
    2. itek power bank (5600mAh)
    3. Internet connectivity through Ethernet

    I wrote a shell script to call a web based PHP script on my server. I set a cron to run this shell script every minute. What happens is the shell scripts passes the client side timestamp, and server writes it, along with sever side timestamp to a file.
    The source code of both scripts is provided below.

    rawurlencode() {
    local string="${1}"
    local strlen=${#string}
    local encoded=""
    for (( pos=0 ; pos<strlen ; pos++ )); do
        case "$c" in
            [-_.~a-zA-Z0-9] ) o="${c}" ;; * )  printf -v o '%%%02x' "'$c"
        echo "${encoded}"
    CLIENT_TIME=`date +"%c"`
    URL=http://example.com/ServerSideLoggerPHPScript.php?t=$(rawurlencode "$CLIENT_TIME")
    /usr/bin/wget -qO- $URL &> /dev/null


    • The script started at 4:45:12 AM client time and ended at 12:07:01 PM client time. That’s almost 7 hours 22 minutes
    • The reason to attach the device to Internet was because I don’t see the point of testing a bare naked Raspbery Pi. Most real life applications would require network connectivity
    • That brings me to another realization: I should have used my WiFi adapter instead of Ethernet to test real world situation. I plan to do this soon.
    • I was fortunate not to lose Internet connectivity, but I should have logged the timestamp locally as well
    • 7 hours is all hunky dory but itek is a fairly heavy device, and takes eon to recharge. I don’t see it a very likely companion to my Raspberry, if I intend to shoot them in air sometime.

    As mentioned, I’ll test the setup again with a WiFi adapter, and update the results.

    9 Responses to itek powered Raspberry Pi runs for over 7 hours

    1. Johnny Jacob
      March 31, 2013 at 2:44 PM

      Can you run a similar test offine?

      • March 31, 2013 at 3:08 PM

        I could, but what would be the use? Unless of course, we raise the CPU usage all through out.
        Do you want me to do that?

        • Johnny Jacob
          April 1, 2013 at 1:19 PM

          Yup. That makes sense.

    2. Jay
      July 16, 2013 at 3:50 PM

      hey.. Bipin.. try doing a UPS thing… if mains go out, your battery should start powering your pi. How is that for an idea? 🙂

      • September 2, 2013 at 3:52 PM

        That’ll definitely work! But I’m looking at something portable, something which can fly along with my Pi.
        Even itek is actually a little heavy for this.

    3. troller
      May 5, 2014 at 9:05 PM

      Dude – your categories don’t work

    Leave a Reply

    Your email address will not be published. Required fields are marked *