Monday 28 March 2011

Customising your Pogoplug

or, "How to turn your Pogoplug into a BitTorrent, file and web server!"

Please note: Follow the instructions below at your own risk.  Please do not blame me if your Pogoplug breaks :)
11/01/2012 - Please note that a number of users appear to be having issues completing the steps described below on the latest incarnation of the Pogoplug (v4).  Unfortunately I do not own v4 of this device, so I cannot experiment/resolve this issue.  If you have any information to help get users working with this version, please post in the comments section below.

Pogoplug is a small embedded Linux device sold to enable personal cloud computing.  If you have never heard of Pogoplug, check it out here.  

If you have one already and would like to add support for 100s of different applications, including a BitTorrent client, Samba, Apache Web Server, CUPS etc, then read on!

The great thing about the Pogoplug is that it allows root access via SSH, and also includes an unused internal flash drive, perfect for tinkering with. In this tutorial I am going to describe the steps I took to install a package management system which gives access to a whole host of useful applications that can run directly on your Pogoplug (and lots of other packages, a list of available ones can be seen here).  

1. PREPARING YOUR POGOPLUG

First, make sure you have setup your Pogoplug correctly and it is accessible from my.pogoplug.com.

  • Log in to my.pogoplug.com with your username and password
  • Go to “Settings” > “Security Settings" page and tick “Enable SSH access for this Pogoplug enabled device"
Now you need to find the IP address of your Pogoplug in your local network.  There are lots of different ways to do this, probably the most straightforward is to login to your router and look through the list of connected Ethernet devices.  Once you have found your Pogoplug's local IP address, you can SSH to it using a terminal application.

  • Open up a terminal (instructions for Windows, Linux and Mac)
  • Once you have your selected terminal open, type the following (replacing “123.456.789.100” with your Pogoplugs IP address:
    • ssh root@123.456.789.100
  • When prompted for a password, use “ceadmin” and hit enter
Congratulations!  You are now connected to your Pogoplug.


2. INSTALLING A PACKAGE MANAGEMENT SYSTEM

Now it’s time to install a lightweight package management system on the unused internal flash drive – this will enable us to install a whole host of useful packages that are not included on the Pogoplug as standard.  

  • Copy and paste the following into your connected SSH session to prepare your Pogoplug for installing applications (it may be worth copying and pasting a line at a time and checking for any errors before continuing with the next step):
mount -o remount,rw /
mkdir /opt
mount /dev/mtdblock3 /opt
cd /opt
wget http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/ipkg-opt_0.99.163-10_arm.ipk
tar -xOvzf ipkg-opt_*_arm.ipk ./data.tar.gz | tar -C / -xzvf –
mkdir -p /opt/etc/ipkg
echo "src cross http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable" > /opt/etc/ipkg/armel-feed.conf
echo "src native http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/native/unstable" >> /opt/etc/ipkg/armel-feed.conf
/opt/bin/ipkg update
Now you have the package manager installed, congratulations, there are a whole host of applications available at your disposal! You can see a list here, or by executing “/opt/bin/ipkg list” from the command line of your Pogoplug.

Future posts will cover installing a BitTorrent client, SAMBA and a webserver :)

41 comments:

  1. thank you. please explain how to install torrent client.

    ReplyDelete
  2. Hi Jin,

    Sorry, I haven't had a chance to write a guide for that yet - I should be able to in the next week or so.

    If you are interested in having a look yourself, running the following will show you all torrent-related packages available through IPKG:

    /opt/bin/ipkg list | grep -i "torrent"

    I used the following to install Transmission (a BitTorrent client):

    /opt/bin/ipkg install transmission

    From there you will probably need to edit the "settings.json" file found in the freshly installed Transmission folder. Hit Google if you get stuck (or wait for me to write a guide :D).

    Cheers,

    Aaron

    ReplyDelete
  3. Hi Jin,

    I've (finally!) got round to documenting the steps required to install Transmission BitTorrent client on a Pogoplug; you can see the post here:

    http://aaronrandall.blogspot.com/2011/07/installing-bittorrent-client-on.html

    Cheers,

    Aaron

    ReplyDelete
  4. Works a treat, I installed an Apache webserver. Didn't take very long to install either.

    S

    ReplyDelete
  5. Since Pogoplug only has 128MB NAND, how much space do you have to install these packages ? Do you install them on an external drive ?

    ReplyDelete
  6. Hi Asim,

    The spare drive (/dev/mtdblock3) is ~90 MB in size; I install my applications on that disk and then configure them to point to my attached USB HDs.

    For example, in my tutorial documenting the installation of a BitTorrent client (http://aaronrandall.blogspot.com/2011/07/installing-bittorrent-client-on.html), the BitTorrent client is installed on the internal drive, but all files are downloaded to my external HD.

    I have a BitTorrent client, Samba client and a few other applications, and still have a reasonable amount of space left on the internal drive.

    Hope that helps :)

    Aaron

    ReplyDelete
  7. Just ran through your tutorial - very nice, much easier than the old optware way, using a separate usb thumbdrive.
    I did have some trouble untarring the ipkg tar. The reason, i think is that the end of line is an em dash not a minus.

    This worked for me
    tar -xOvzf ipkg-opt_0.99.163-10_arm.ipk ./data.tar.gz | tar -C / -xzvf -

    Thanks!!

    ReplyDelete
  8. Sounds really good. And if I install this the pogoplug still works as normal? I still can connect to my drives true my.pogoplug.com?

    Thanks a lot!!

    ReplyDelete
  9. Hi Anonymous :)

    You sure can, my.pogoplug.com continues to work just fine.

    Enjoy!

    Aaron

    ReplyDelete
  10. Can you help me?I have a pink POGO B01 When I type mkdir /opt I get an error
    mkdir: can't create directory '/opt': File exists
    Thanks.

    ReplyDelete
  11. I'm a programming noob, but tried to follow these directions. This seems perfect for my needs, but I have a new Pogoplug V4, and it doesn't seem to work with the instructions you've laid out. The early line about mounting dev/mtdblock3 fails. My guess is the PPv4 doesn't have the same file structure? Maybe there's not an "mtdblock3" available?

    Any ideas on navigating this new device? Thanks!

    ReplyDelete
  12. Can you help me? When I type in mkdir /opt I get error mkdir: can't create directory '/opt': File exists

    ReplyDelete
  13. Hi @Fixsony,

    Did you run the steps above multiple times?

    Please could you run "ls -la /opt" and post the output of the command here?

    Thanks,

    Aaron

    ReplyDelete
  14. Hi @awhilliard,

    I haven't tried this on the latest PogoPlug, but as you say, perhaps the disk structure has changed.

    If you post the output of the following commands, we can try and work out what the issue is:

    "df -h"
    "ls /dev/*"

    Cheers,

    Aaron

    ReplyDelete
  15. After run "ls -la /opt"


    drwxr-xr-x 2 root root 160 Jan 10 03:38 .
    drwxr-xr-x 15 root root 1064 Jan 10 03:38 ..

    ReplyDelete
  16. Hi @Fixsony,

    Ok, so it looks like that folder already exists. What do you see if you run the following?

    "mount /dev/mtdblock3 /opt"

    and then

    "df -h"

    ?

    ReplyDelete
  17. Aaron Here are the results for the Pogo V4 you gave to awhillard...truncated a bit to fit
    ~ # df -h
    Filesystem Size Used Available Use% Mounted on
    ubi0:rootfs 96.9M 12.9M 83.9M 13% /
    none 57.9M 12.0K 57.9M 0% /tmp
    /tmp/.cemnt/sda1 931.5G 752.3G 179.2G 81% /tmp/.cemnt/mnt_sda1
    /tmp/.cemnt/sdb1 465.8G 270.1G 195.7G 58% /tmp/.cemnt/mnt_sdb1
    /tmp/.cemnt/sdc1 1.8T 967.3G 773.4G 56% /tmp/.cemnt/mnt_sdc1
    /tmp/.cemnt/sdd1 1.8T 377.5G 1.3T 22% /tmp/.cemnt/mnt_sdd1
    ~ # ls /dev/*
    /dev/atibm /dev/ptya3 /dev/sda10 /dev/sg3
    /dev/console /dev/ptya4 /dev/sda11 /dev/sg4
    /dev/ejectbutton /dev/ptya5 /dev/sda12 /dev/sg5
    /dev/fb0 /dev/ptya6 /dev/sda13 /dev/sg6
    /dev/fb1 /dev/ptya7 /dev/sda14 /dev/sg7
    /dev/fb2 /dev/ptya8 /dev/sda15 /dev/sg8
    /dev/fb3 /dev/ptya9 /dev/sda2 /dev/sg9
    /dev/fb4 /dev/ptyaa /dev/sda3 /dev/smpte0
    /dev/fb5 /dev/ptyab /dev/sda4 /dev/smpte1
    /dev/fb6 /dev/ptyac /dev/sda5 /dev/smpte2
    /dev/fb7 /dev/ptyad /dev/sda6 /dev/smpte3
    /dev/full /dev/ptyae /dev/sda7 /dev/sndstat
    /dev/fuse /dev/ptyaf /dev/sda8 /dev/sr0

    ReplyDelete
  18. after "mount /dev/mtdblock3 /opt" I got this:


    mount: mounting /dev/mtdblock3 on /opt failed: No such device or address

    ReplyDelete
  19. @Fixsony,

    Do you have Pogoplug V4?

    @BarneysBurgers,

    Thanks for the info. Unfortunately it looks like the latest Pogoplug is using UBIFS (http://en.wikipedia.org/wiki/UBIFS), which I have no experience with. I'm sure I could work it out, but unfortunately I don't have access to a V4 Pogoplug to experiment :( Maybe someone would like to donate one :D

    I'll add a note to this post so others don't get stuck half-way through following the instructions.

    Thanks for all your feedback,

    Aaron

    ReplyDelete
  20. Aaron..On my POPG V4 I decided to experiment around a bit since it said the /opt directory already existed when I tried to create it I skipped ahead to the cd /opt and it changed to that directory I proceeded from there and was able to download the tar, un-tar it(using the command posted by"Anonymous said...") and then make the directory "-p /opt/etc/ipkg" (..what does the -p do?....) Then when I tried to do the update I got this error message:
    Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/Packages
    wget: unrecognized option '--passive-ftp'
    BusyBox v1.16.1 (2011-09-28 14:52:05 PDT) multi-call binary.

    Usage: wget [-csq] [-O file] [-Y on/off] [-P DIR] [-U agent] url

    Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/native/unstable/Packages
    wget: unrecognized option '--passive-ftp'
    BusyBox v1.16.1 (2011-09-28 14:52:05 PDT) multi-call binary.

    Usage: wget [-csq] [-O file] [-Y on/off] [-P DIR] [-U agent] url

    Any Ideas???

    ReplyDelete
    Replies
    1. Hi Barneysburgers,

      Apologies for the delay; I'm not actively monitoring this blog as it has moved to http://aaronrandall.com/blog/customising-your-pogoplug/

      Anyway, this comment (http://aaronrandall.com/blog/customising-your-pogoplug/comment-page-1/#comment-304) could potentially fix the issue you are seeing. Particularly the following commands (to install the required version of wget):

      cd /tmp/
      wget
      http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/stable/wget_1.12-2_arm.ipk
      tar xvzf wget_1.12-2_arm.ipk
      tar xzvf data.tar.gz -C /
      mv /usr/bin/wget /usr/bin/wget.old
      ln -s /opt/bin/wget /usr/bin/wget

      Let me know if you try it and have any success (over on the linked page).

      Regards,

      Aaron

      Delete
  21. I've the same problem executing 3rd line here on my Plug Model: POGO-B01 Pink (v3.2.4.2).

    "mount: mounting /dev/mtdblock3 on /opt failed: No such device or address"

    Yes, the File System on mine is UBIFS as well.

    Appreciate any help.

    Thanks.

    ReplyDelete
  22. Hello Aaron,

    Thanks for the guide but i have the same problem as Fixsony. When i ran

    mkdir /opt

    I get

    mkdir: can't create directory '/opt': File exists

    so i ran ls -la /opt and df -h as asked and got

    lrwxrwxrwx 1 root root 17 Jul 24 2011 /opt -> /tmp/mnt_opt/.opt

    Filesystem Size Used Available Use% Mounted on
    ubi0:rootfs 101.8M 12.4M 89.4M 12% /
    none 61.4M 16.0K 61.4M 0% /tmp

    I have the pogoplug pro so version 3

    Thanks for your help.

    ReplyDelete
  23. Hi, Aaron,

    Have you heard of a case where mtdblock3 won't mount on a V2 pogo? I'm getting invalid argument whenever I try to mount it.
    It was previously running Arch Linux ARM, and since been restored to the full pogo OS and regained access to my.pogoplug.com - could some of the ALARM stuff have touched mtdb3, making it unmountable?

    I have no problems installing ipkg to USB drive though, although using that flash inside the plug would give me back an extra USB port!

    Thanks

    ReplyDelete
    Replies
    1. I too am getting the error:

      mount: mounting /dev/mtdblock3 on /opt failed: Invalid argument

      Delete
    2. To resolve this, I had to run the following command:
      flash_eraseall /dev/mtd3 ****NOTE: mtd3 instead of mtdblock3****

      Then the standard:
      mount -t jffs2 /dev/mtdblock3 /opt

      This let me mount the internal spare flash and use it.

      Delete
    3. Thankyou soooo muck to the above poster.... freed up my usb port! Yeah!

      Delete
  24. Regarding the 'wget' issue (after ignoring the mtdblock3 issue), I made a short-lived wrapper:

    #File /opt/wget
    wget "$2" "$3" "$4" "$5" "$6" "$7" "$8"


    and followed by:
    PATH=/opt:$PATH

    This will suppress the '--passive-ftp' option in a pretty dirty, but acceptable short-term manner.

    Then you can do a:
    /opt/bin/ipkg install wget

    to get a fuller version of wget.

    After that you can remove '/opt/wget' and make sure that your path points to '/opt/bin:$PATH'.

    ReplyDelete
    Replies
    1. This is more effective


      /opt # vi wget
      busybox wget "$2" "$3" "$4" "$5" "$6" "$7" "$8"
      [ESC]wq!

      where [ESQ] means pressing the escape key to change to vi command mode.

      Change the path as above.

      Delete
    2. This is more effective


      /opt # vi wget
      busybox wget "$2" "$3" "$4" "$5" "$6" "$7" "$8"
      [ESC]wq!

      where [ESQ] means pressing the escape key to change to vi command mode.

      Change the path as above.

      Delete
  25. In case anyone else encounters a Permission Denied error while trying to execute ipkg (as I did), I found a solution here (first comment): http://www.pogoplugged.com/forum/thread/21862/ipkg-Permission-denied-error/

    The issue was that I let the Pogoplug mount the USB drive on reboot (I'm not sure how to mount it manually -- "mount /dev/sdb1 /opt" and "mount /tmp/.cemnt/mnt_sdb1 /opt" don't work), and as shown in the SSH session above the Pogoplug was mounting the USB drive with the "noexec" option. I had to remount the USB drive with exec rights for the ipkg executable on the drive to be able to run ("mount -o exec,remount /tmp/.cemnt/mnt_sdb1").

    ReplyDelete
  26. I am still not completely clear on how to supress the --passive-ftp option anonymous. can you clarify?

    ReplyDelete
  27. Did anyone ever figure out the problem:
    mount: mounting /dev/mtdblock3 on /opt failed: No such device or address"

    ReplyDelete
  28. Has anyone anyone solved the problem
    mount: mounting /dev/mtdblock3 on /opt failed: No such device or address

    ReplyDelete
    Replies
    1. flash_eraseall /dev/mtd3 ****NOTE: mtd3 instead of mtdblock3****

      Then the standard:
      mount -t jffs2 /dev/mtdblock3 /opt

      Delete
  29. Worked great on my Seagate Flex Net (which also uses PogoPlug software): I was expecting to have to do some tweaking, but it does have a 219MB /dev/mtblock3 available

    ReplyDelete
  30. Don't forget to add a line like the following to /etc/fstab, so /opt is mounted automatically on reboot:

    /dev/mtdblock3 /opt auto defaults 0 0

    ReplyDelete
  31. Thanks, adding "busybox" in front of some commands helped me through the first part. Now trying to get samba working.

    ReplyDelete
  32. /opt # /opt/bin/ipkg update
    Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/Packages
    wget: unrecognized option '--passive-ftp'

    Seems that the wget on Pogoplug 4 doesn't has --passive-ftp. How can I workaround this?

    Thanks!

    ReplyDelete
  33. For everybody who is struggling to install SAMBA on Pogoplug 4, Pogoplug Pro and Pogoplug Office here's a very comprehensive step-by-step idiot-proof tutorial: http://www.razva.ro/how-to-install-samba-on-pogoplug-4/ :)

    ReplyDelete
  34. Everytime i try to get use of WGET i got the sollowing error m. :
    -bash: /usr/bin/wget: Permission denied

    Has anyone an idea ?

    Thanks !

    ReplyDelete