Wednesday, February 11, 2015

OpenWRT on Pogoplug Mobile

Booting OpenWRT from internal flash on Pogoplug Mobile

In this tutorial we're replacing the original Pogoplug OS on the internal flash with OpenWRT. OpenWRT is a lightweight but feature rich Linux distribution for embedded devices. 

The Pogoplug is arguably one of the best OpenWRT platform for the price and performance. You can use OpenWRT on the Pogoplug as your main Linux distro skipping the need for a USB flash drive or SD Card, or just use it as a Rescue System (for fixing corrupt disk or reinstallation) if something goes wrong with your ALARM or Debian installation.

This tutorial assumes you have completed my previous tutorial - Hacking the Pogoplug v4 (Series 4 and Mobile) with Linux (Debian or Arch) - and already running Debian or ArchLinuxARM (from a USB drive or SD Card) on the Pogoplug Mobile.

Note that for the Series 4, the USB3 ports does not work properly yet with OpenWRT. Hopefully this will get resolved in the near future. [Edit] - Looks like the USB3 ports work with USB3 devices and if you plug in a USB3 device, the other USB3 port will work with a USB2 device.

WARNING: There is no going back to the Pogoplug OS. You will not be able to use the service. Please proceed at your own risk.


Boot up Debian or ArchLinuxARM on your Pogoplug. All commands below assumes you're running Debian or ALARM.

#Update mtdparts so we have one continuous partition to work with.
cd /tmp
chmod +x fw_setenv

#setup fw_env.config
echo "/dev/mtd0 0xc0000 0x20000 0x20000">/etc/fw_env.config

#1MB for the uBoot, the rest for rootfs (~122MB)
/tmp/fw_setenv mtdparts 'mtdparts=orion_nand:1M(u-boot),-(rootfs)'

#This reboot is important

After rebooting double check the mtdpart is correct.

cat /proc/mtd

#root@debian:~# cat /proc/mtd
#dev: size erasesize name
#mtd0: 00100000 00020000 "u-boot"
#mtd1: 07f00000 00020000 "rootfs"
#mtd2: 00010000 00008000 "spi0.0"

#download firmware/nand utilities
cd /tmp

#make executable
chmod +x fw_printenv fw_setenv ubiattach ubimkvol ubiformat   

#format mtd1 (rootfs)
#Will be prompted for confirmation three times.
/tmp/ubiformat /dev/mtd1

/tmp/ubiattach -p /dev/mtd1
/tmp/ubimkvol /dev/ubi0 -m -N rootfs

#mount ubi rootfs to /tmp/ubi
mkdir /tmp/ubi
mount -t ubifs ubi0:rootfs /tmp/ubi

#Chaos Calmer 15.05
cd /tmp

#Trunk release.
#Note that Barrier Breaker 14.07 doesn't work.
#cd /tmp

#check that zImage and rootfs.tar.gz are OK
md5sum -c md5sums

#extract rootfs.tar.gz to ubi rootfs at 
cd /tmp/ubi
tar xvzf /tmp/openwrt*rootfs.tar.gz

mkdir boot
mv /tmp/openwrt*kirkwood-zImage ./boot/zImage

#FDT from,12096
cd boot


cd /

umount /tmp/ubi

#Setup uBoot Environment

#Cut and Paste this whole section
/tmp/fw_setenv fdt_file '/boot/kirkwood-pogoplug_v4.dtb'
/tmp/fw_setenv loadaddr '0x800000'
/tmp/fw_setenv zimage '/boot/zImage'
/tmp/fw_setenv fdt_addr '0x1c00000'
/tmp/fw_setenv loadubi 'echo Trying to boot from NAND ...;if run mountubi; then run loadubizimage;run loadubifdt;ubifsumount;run bootzubi;fi'
/tmp/fw_setenv mountubi 'ubi part rootfs; ubifsmount ubi0:rootfs'
/tmp/fw_setenv loadubizimage 'ubifsload ${loadaddr} ${zimage}'
/tmp/fw_setenv loadubifdt 'ubifsload ${fdt_addr} ${fdt_file}'
/tmp/fw_setenv bootzubi 'echo Booting from nand ...; run setargsubi; bootz ${loadaddr} - ${fdt_addr};'
/tmp/fw_setenv setargsubi 'setenv bootargs console=${console},${baudrate} ${optargs} ubi.mtd=1 root=ubi0:rootfs rw rootfstype=ubifs rootwait ${mtdparts}'

#Setup boot order.
/tmp/fw_setenv bootcmd 'run bootcmd_usb; run bootcmd_mmc; run bootcmd_sata; run loadubi; reset'

#poweroff Pogoplug and remove SD Card and USB flash drive.

At this point, we're ready to boot into OpenWRT. Note that by default, OpenWRT will default to and will act as a DHCP Server. Plug a network cable from your computer directly into the Pogoplug and power it on. You should now be able to Telnet into the Pogoplug at (username and password not required). Note that SSH is disabled and will automatically start after a root password is set.

#####Initial Boot via Telnet######
#set passwd and enable ssh

#Reconfigure Network to DHCP Client

#disable dhcp server on lan
uci set dhcp.lan.ignore=1
uci commit dhcp
/etc/init.d/dnsmasq restart

#set wired ethernet interface to dhcp client
uci set network.lan.proto=dhcp
uci commit network

Plug the Pogoplug and your computer back into your network. Check your router for the IP Address assigned to your Pogoplug. You should now be able to SSH into the Pogoplug.

Note that since we're using the daily snapshot trunk build of OpenWRT, you'll need to install your kernel packages right away (kmod-xxx), otherwise it will get out of sync.

#####Initial OpenWRT configuration#####
opkg update

#Install some essential packages
opkg install nano wget luci uboot-envtools pciutils usbutils 
kmod-usb2 kmod-usb3 kmod-mmc kmod-usb-storage block-mount kmod-fs-ext4 kmod-fs-vfat kmod-fs-ntfs kmod-nls-cp437 kmod-nls-iso8859-1 e2fsprogs fdisk 

#SAMBA - configure via luci web gui
opkg install samba36-server samba36-client luci-app-samba

Major credit goes to @moonman on the ArchLinuxArm Forum -


  1. Would this also work on Pogoplug E02?

    1. No. This tutorial is designed specifically for the Pogoplug V4. I'll publish a OpenWRT on E02 tutorial in the future there is interest.

    2. Yeah, that would be great. Thanks!

    3. Qui, any plans to release a guide similar to this for the E02 soon? I purchased a E02 a while back, and it's been laying in my storage collecting dust. I'm now wanting to install OpenWRT on it, but there aren't any comprehensive guides available. I tried (, but many of the commands aren't found, such as mtdparts & fw_setenv. Thanks, and much appreciated.

    4. I'll work on this in the near future. Currently the uBoot for the E02 is in a little bit of a flux. My preference is Jeff's uBoot, but it's a little outdated and the archlinuxarm uBoot has some issues.

    5. Hello Qui, did you ever get a chance to work on the tutorial for the Pogoplug E02?
      Seems like there is definitely some interest for it.

    6. Bumping to request a tutorial on the Pogoplug E02 or the Seagate Dockstar. I'm curious to see if the OpenVPN performance is better than my consumer grade routers running OpenWRT since these two appear to have faster CPUs.

    7. Since had already done the mods to boot Debian off a USB drive, I was able to install the relevant OpenWRT files from using the instructions at the end of

      The Pogoplug boots up with the Ethernet port as a DHCP client and you can add USB Ethernet and WiFi interfaces if desired.

  2. thankyou, this works perfectly with Chaos Calmer RC2

    1. Thank you for letting me know. Once CC is final, I'll give it a test and update the tutorial as appropriate.

  3. Did you try an USB wireless adapter? I cannot get any of mine to work. Never have wlan0.

    1. Yes, I've successfully used the RT5730 USB Wireless Adapter. From my other blog -

      #Pogoplug has 128MB flash
      #No need to be stingy on the packages
      opkg install nano wget luci uboot-envtools pciutils usbutils htop wireless-tools kmod-rt2x00-pci kmod-usb-storage block-mount kmod-fs-ext4 kmod-fs-vfat kmod-fs-ntfs kmod-nls-cp437 kmod-nls-iso8859-1 e2fsprogs fdisk kmod-usb2 samba36-server samba36-client luci-app-samba kmod-rtl8187 wireless-tools kmod-usb-net-asix-ax88179 kmod-rt2800-lib kmod-rt2800-usb kmod-rt2x00-lib kmod-rt2x00-usb kmod-usb-serial-pl2303 kmod-usb-serial-cp210x kmod-usb-serial-ftdi picocom screen

      #Assume you're using the USB RT5370 Wi-Fi below
      #Regenerate Wi-Fi configuration
      #Verify if Wi-Fi is working properly
      rm -f /etc/config/wireless
      wifi detect > /etc/config/wireless

      #If wireless is working properly, you should see something
      cat /etc/config/wireless

    2. Thanks, I was almost there but need the extra packages. My PCUSBW1150 USB Wireless Adapter needed kmod-rtl8192cu to work. Now my Pogoplug is an AP for my network. I'm working on making eth0 (WAN) and wlan0 (br-lan) . I have a TL-WR841N V9 with OpenWRT so the Pogoplug will be a great learning tool.

      This is a great tutorial on make the pogoplug v4 and wireless router!

      Thanks again,

  4. learnt today that running mtd -r erase rootfs is not a good idea

  5. With a dockstar booting to pogoplug original nand, I successfully followed your guide for installing debian to usb, changing file names as necessary.

    Now I'd like to install openWrt to nand on the dockstar following this guide. My flash layout looks as follows.

    cat /proc/mtd
    dev: size erasesize name
    mtd0: 00200000 00020000 "u-boot"
    mtd1: 00300000 00020000 "uImage"
    mtd2: 00300000 00020000 "uImage2"
    mtd3: 00800000 00020000 "failsafe"
    mtd4: 07000000 00020000 "root"
    mtd5: 00010000 00008000 "spi0.0"

    What do I do to use this guide to install to nand (changing openWrt filenames to "kirkwood-dockstar" as needed?

  6. Hi,Thank you first.
    I was stuck at
    #poweroff Pogoplug and remove SD Card and USB flash drive.
    when i powed off ,Pluged a network cable from my computer directly into the Pogoplug and powed on. I saw my computer ip was , i was used mac and turned the wifi off, i don't konw telnet what ip.
    If you know,please help me. Thank you for you time.

    1. Hi Yang, I'm having the exact same problem. I diagnosed with serial console and it looks that cannot connect to ubi0:rootfs and hangs. I'll post later the exact error message since I was not able to capture the console output yet. Is it possible that the current trunk of OpenWRT could have introduced incompatibilities? (Since these instructions are way back from earlier 2015). Maybe somebody has stored the old trunk version that worked.

    2. Sorry for the late reply.

      Try setting a static IP Address on your computer. Something like and then try telneting into the Pogoplug at

  7. Though the problem not resolved after i did it as you said, but thank you for your reply.

  8. This comment has been removed by the author.

  9. I broke my nand installation of openWrt 15.05 that I had made following these instruction (from a debian SD). I decided to replace it with trunk. I followed these instructions three times, but each time it failed with this:
    [ 1.450182] UBI: background thread "ubi_bgt0d" started, PID 778
    [ 1.456509] VFS: Cannot open root device "ubi0:rootfs" or unknown-block(31,1): error -2
    [ 1.464500] Please append a correct "root=" boot option; here are the available partitions:
    [ 1.472836] 1f00 1024 mtdblock0 (driver?)
    [ 1.477873] 1f01 130048 mtdblock1 (driver?)
    [ 1.482923] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,1)
    [ 1.491236] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,1)
    I was able to install CC 15.05 again. Any idea why the trunk installation would have failed?

  10. Great tutorial! Is there a way to boot openwrt sd card or hard drive? I tried booting from sd card with the openwrt rootfs and uImage and I tried to get bootz working with the openwrt zImage but it just will not start. Thanks for the help!

    1. I'm sure it's possible, but it's not something I care to do or research.

  11. Thanks for this tutorial - I was trying to setup openwrt on my zyxel nsa320 for couple of days and it really was so easy. The only difference was different dtb file.
    Last thing - can you paste your uboot config - my is so messed up that I don't even know where to start fixing it ;)

  12. Wow that's a wonderfull blog having all details & helpful. Saa Power Cord

  13. This comment has been removed by the author.

  14. Hi,

    Just updated the uboot to 2016.05 U-Boot Kirkwood
    Anyone has experience with installing OpenWRT onto the PogoPlug E02's nand flash or external USB?

    I've tried to follow this instructin, by replacing the rootfs, zImage and dtb file using the Pogoplug E02's one,
    it seems to boot fine but I can't get access to the box either via dhcp or static ip.
    Here's the boot log:

    Trying to boot from NAND ...
    invalid partition number 2 for device nand0 (orion_nand)
    no such partition
    ubi0: attaching mtd1
    ubi0: scanning is finished
    ubi0: attached mtd1 (name "mtd=1", size 127 MiB)
    ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
    ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512
    ubi0: VID header offset: 512 (aligned 512), data offset: 2048
    ubi0: good PEBs: 1014, bad PEBs: 2, corrupted PEBs: 0
    ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
    ubi0: max/mean erase counter: 3/1, WL threshold: 4096, image sequence number: 1535965568
    ubi0: available PEBs: 0, total reserved PEBs: 1014, PEBs reserved for bad PEB handling: 18
    Loading file '/boot/zImage' to addr 0x00800000...
    Loading file '/boot/openwrt-15.05-kirkwood-pogo_e02.dtb' to addr 0x01c00000...
    Unmounting UBIFS volume rootfs!
    Booting from nand ...
    Kernel image @ 0x800000 [ 0x000000 - 0x181e40 ]
    ## Flattened Device Tree blob at 01c00000
    Booting using the fdt blob at 0x1c00000

    Starting kernel ...

    Thanks in advance.

    1. I'm encountering the same problem. Pogoplug v4 appears to boot from sdcard or USB and using most current Bodhi uBoot and turns green but no access. Not sure which combo to use to get the zImage to work correctly.

  15. Downloads links are down ?

    cd /tmp

    1. Yes seems down, is there a way to get this working again?

    2. You guys can get the nand tools here:,27280

    3. MeesterWu

      Thanks for the link however

      these are still mising ?