Friday, January 07, 2011

Pogoplug and WDTV sharing via NFS

Finally I get Pogoplug and WDTV linked. Yahoo!!

NFS Server (Pogoplug)
Reference to 'Running an NFS Server' in http://openpogo.tumblr.com/

ipkg install nfs-server
vi /opt/etc/exports
# add following line 
/tmp/.cemnt/mnt_sdb1/download 192.168.1.0/255.255.255.0(rw,async,no_root_squash) 
 
Because nfs-server depends on the portmapper, we must verify that portmapper is running before start nfs-server.

# start nfs server
/opt/etc/init.d/S56nfsd

# make sure nfsd started
ps -w


NFS Client (WDTV)
Devices I have:
* WDTV: gen 1 with B-Rad's unofficial firmware WDLXTV 0.5.8.1
* Wireless adapter: Rosewill RNX-EasyN1 (Chipset Ralink 3070)
* USB drive: a very old timer -- Apacer 32M. Yes, and don't laugh. It is 32M. You read it correctly. It came back to life again. :)

- Config network with Wireless adaptor

Fortunately Pogoplug has web interface wireless support in my.pogoplug.com. So I first plug RNX-EasyN1 into pogoplug and set it up in the web interface. Then simply copy /etc/Wireless/RT2870STA/RT2870STA.dat out from pogoplug to root of the start up USB drive.

Download wireless app wireless-mod-rt.app.bin (search in WDTV Forum) and put in root of usb drive.

- Add NFS app
download nfs.app.bin-0.3 and copy to root of USB drive.

-Config NFS Client
Edit net.mounts and put into usb drive root.
xmount 192.168.1.3:/tmp/.cemnt/mnt_sdb1/download Pogo nfs udp,soft,rsize=32768,wsize=32768


Evertything is ready now. 'Restart' WDTV.
There are 2 ways to restart WDTV:
- Pull out power adaptor and wait a while (let's say 20 sec) and plug in
or
- Telnet/SSH into WDTV if you have network setup successfully already. Run reboot.

Check if NFS share is success from your WDTV GUI. If there is problem, telnet/ssh into wdtv and check mount, /etc/fstab... My link is not stable at first, after several reboot, it's there finally. Cheers!

Thursday, January 06, 2011

[Pogoplug] Install Transmission

Based on Installing OpenPogo + Transmission on dockstar

- SSH into Pogoplug.
        
    # makes filesystem read-write
    mount -o rw,remount / 
    ipkg install nano transmission
    # Run the following 2 commands to generate a configuration file for Transmission
    transmission-daemon --config-dir /opt/etc/transmission-daemon 
    killall transmission-daemon
    # modify the settings.json file
    # go to line 44 and make “rpc-whitelist-enabled”: false, save it
    vi /opt/etc/transmission-daemon/settings.json
    transmission-daemon --config-dir /opt/etc/transmission-daemon 
    mount -o r,remount /


Now you should be able to browse the web interface with http://pogoplug_ip-addr:9091 and change settings in the preference page. You can also go into the setting.json and modify any of the other settings.

To set an init script to make transmission run on boot create a script:

vi /opt/etc/init.d/S88transmission 

#!/bin/bash
# Starts up transmission
#

start() {

 echo -n "starting up transmission:"
 if [ -n "`pidof transmission-daemon`" ]; then
  killall `pidof transmission-daemon`
 fi

 /opt/bin/transmission-daemon --config-dir /opt/etc/transmission-daemon --blocklist

}

stop () {

   echo -n "stopping transmission:"
   killall transmission-daemon

}

restart () {

   stop
   start
}

case "$1" in

   start)
   start
   ;;

   stop)
   stop
   ;;

   restart)
   restart
   ;;

   *)
   echo "usage: $0 {start|stop|restart)"
   exit 1
   ;;

 esac


Be sure to set the downloads directory from the interface to the real directory identified by the pogoplug ie. '/tmp/.cemnt/mnt_sdb1/downloads' you should see the field getting populated in the setting.json file, now whenever you reboot transmission should start up too.

[Pogoplug] Install/Uninstall PlugApps to a USB flash drive

- Make sure all the wires are linked ( network, power, usb )
- Get IP address of pogoplug from router/modem
- Log into my.pogoplug.com to enable SSH access and set a password.
- SSH into pogoplug as root with putty.

- Partition/format the USB Drive on which you will install PlugApps
cd /tmp
wget http://plugapps.com/os/pogoplug/mke2fs
chmod 755 mke2fs
killall hbwd # This will turn off my.pogoplug.com functionality temporarily and unlock the USB drive for PlugApps installation.
/sbin/fdisk /dev/sda # delete all existing partitions and create a new one
./mke2fs /dev/sda1
/sbin/reboot


- Unplug usb and reboot and plugin usb when restarted

- Install PlugApps

On your PC navigate to the Pogoplugged Development download page http://www.pogoplugged.com/download/list?cat=36 and download the "opt.tar.gz" file to your computer. Then upload it into the root of usb drive via my.pogoplug.com.

SSH again.

cd /tmp/.cemnt/mnt_sda1
# wget http://openpogo.com/base/openpogo-usb.tar.gz
# tar -xzvf openpogo-usb.tar.gz
tar -xzvf opt.tar.gz
mount -o rw,remount /
ln -s /tmp/mnt_opt/.opt /opt

# When booting the mount_opt script looks for openpogo on any of the 4 usb ports and then creates another link to the physical device as /tmp/mount_opt/.opt. So a link pointing to a link pointing to a physical disk because we do not know what order the drives get mounted after reboot.

cp /etc/init.d/rcS /etc/init.d/rcS.original
echo '# code added below for OpenPogo /opt on USB with init on boot' >>  /etc/init.d/rcS
echo '/etc/init.d/mount_opt' >>  /etc/init.d/rcS
echo '/opt/etc/init' >>  /etc/init.d/rcS

echo '#!/bin/bash' > /etc/profile
echo '# New profile added for OpenPogo /opt on USB' >> /etc/profile
echo '#' >> /etc/profile
echo 'export PATH=/opt/bin:/opt/sbin:/usr/bin:/usr/sbin:/bin:/sbin' >> /etc/profile

cp /tmp/.cemnt/mnt_sda1/.opt/mount_opt /etc/init.d/
rm /tmp/.cemnt/mnt_sda1/openpogo-usb.tar.gz
chmod 755 /etc/init.d/mount_opt

/sbin/reboot


- SSH again after restart

Change to the original repository


Since OpenPogo is no longer maintained you should change to the original repository:

Change to the ipkg configuration directory
cd /opt/etc/ipkg

Check the name of the conf file
ls

You should see some filename with .conf in the ending, then edit this file
vi or nano filename.conf (probable armel-feed.conf)

Comment out current repo
"src cross http://openpogo.com/repo" 
to 
"#src cross http://openpogo.com/repo"

Then add the new repo underneath
src cross http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/stable

Exit from your editor, then reboot your system
sync
sync
reboot

Once rebooted, log back in to your system and do an update
ipkg update


Congratulations! OpenPogo should now be successfully installed and you are all ready to go. Just log back in using ssh again.

UNINSTALL

In case you need to uninstall PlugApps, SSH into pogoplug first:
mount -o rw,remount /
mv /etc/init.d/rcS.original /etc/init.d/rcS
rm /etc/profile
rm /etc/mount_opt
rm /opt
mount -o r,remount /
rm -r  /tmp/.cemnt/mnt_sda1/.opt
/sbin/reboot

Reference:
How-to-Install-or-remove-OpenPogo-on-Your-Pogoplug-Attached-USB-Drive/

[Pogoplug] Hacking Pogoplug Gray version

Around 2 months ago, I got a Pogoplug gray version when BB had it on sale.

The exciting thing about this box is:
- It's linux based which means you can hack in it and add on packages you want.
- It's small, low noise, energy saving.

I've been looking for a low budget NAS for a long time. So the chance is here.

The software with this box provides online access and Windows/Mac/Linux drive driver. But it's not enough for me. I also need it to be able to download, and link to my WDTV as a media center. To modify this pogoplug into my ideal NAS, I searched online and read a lot articles about it. PlugApps is the most complete and successful one I found so far. Here is what I did.

First I installed PlugApps to a USB flash drive based on
OpenPogo:Installing Base Package - USB
and
How to Install (or remove) OpenPogo on Your Pogoplug-Attached USB Drive.

It provides additional features to the existing Pogoplug software by creating an opt folder on the USB drive that allows installation of Optware ipkg applications.

** Since Pogoplug disabled ssh by default, ssh must be enabled from the settings page of my.pogoplug.com before starting this installation.

What I used:
- I downloaded putty to my Asus EeePC (Windows XP) to SSH into pogoplug and execute all the commands;
- a 8GB Kingston USB flash drive formatted to ext2 attached to pogoplug.

When the basic stuff are in place, I added more packages such as: Samba (file sharing), Transmission(BT download), Lighttpd Web Server with PHP , MySQL and PHPMyAdmin ...

Then the most important part, install NFS server to share media to WDTV.

OK. That's it. I'll put more details in later posts.