Monday, May 18, 2009

Putting my hard disk to sleep on Pogoplug

Out of the box, pogoplug doesn't spin down my Maxtor OneTouch Plus hard disk. Like most other hard disk drives out there, my disk is used for relatively short period of time every day. This means keeping it running wastes the electricity and produces unnecessary heat.

That situation changed with Spindown - I just installed it using the source. It requires "sg3-utils" but that's already included in Optware, so a quick "ipkg install sg3-utils" took care of that dependency. Once I've installed spindown, and edited /opt/etc/spindown.conf to manage sda and sdb (I have two disks plugged onto pogoplug), my disk stays cool and silent all day. As is, it's almost perfect - all important bases are covered. 

Of course, there's always something more, and in this case, I'd like to get software RAID 1 working - which would be really awesome. It would be even more awesome if somehow there's a way to get ZFS working but I know that won't happen anytime soon, if ever. Probably it will take less time (and work) to get BTRFS working on my pogoplug :)

Wednesday, May 06, 2009

Finally, the working combo of cups and pogoplug

Finally I got the remote printing working with pogoplug.

As I explained in my previous post, I've installed cups and splix, and created a "raw" printer with the usb printer as the device. However, I couldn't get it working only with those.

Then Google pointed me to http://www.owlfish.com/thoughts/winipp-cups-2003-07-20.html. I've basically followed this all the way, but STILL it didn't work. It turns out the last trick was to use the specific driver for ML1740 instead of Samsung's universal driver. Somehow Samsung Universal driver didn't work on top of cups IPP printer.

I suspect I don't even need splix, since the printer is raw and the driver is on windows side. This probably means any USB printer will work, as long as there's a driver on the client side. All in all, I'm very happy that both samba and cups work now.

Saturday, May 02, 2009

Pogoplug performance

Now that I've hooked pogoplug onto a fully non-blocking gigabit switch, the network shouldn't be the bottleneck anymore (or if it still is, I'd be really happy) and so finally I have the setup to test pogoplug's performance. Feeling lazy about it, I decided to just run some file copy operations :)

Here's what I got:

First, I wanted to see pogoplug + Maxtor OneTouchPlus 750GB disk performance. The disk is formatted in NTFS, and is hooked up to pogoplug through a USB2 hub. 

I first ran a file copy inside pogoplug, that copies a single 1GB file onto the same disk (hence there's 1GB of read traffic and 1GB of write traffic onto the same disk). It took 232 seconds - this is sooooooo slow (only 2GB/232 ~= 8MB/sec). So I measured only the read speed by running "cat file > /dev/null" with the same 1GB file, and it only took 44s -- 1GB/44 > 20MB/s. 20MB/s read speed is quite reasonable :)

Now across the network, I ran "scp" from a windows box - this doesn't really test the pure network copy performance, as scp would require quite a bit of CPU power to encrypt the traffic. With scp, I got only about 2.2MB/s which I thought is somewhat abyssmal (this is on a gigabit network).  However, it turns out it isn't that bad, compared to samba. 

I tried copying over samba and gave up after waiting about a minute (at that point, the copy progress bar said 15 minutes left - this would mean nearly 1MB/s). So I tried pogoplug device (you know, the pogoplug's software that makes any drives on pogoplug show up as windows' local disk). It took 146 seconds to copy 1GB file from pogoplug to a Windows box - that's about 7MB/s. When I asked about samba to pogoplug support, they mentioned that their software is much faster than samba, and now I can believe that :)

While it's still not fast enough to hit 20MB/s disk speed bottleneck, 7MB/s is fast enough to saturate my 802.11g wireless network and probably fast enough to stream HD contents - I'll have to try that later to confirm. So all in all, I'm reasonably happy about the performance - when using pogoplug device directly at least - and looking forward to using it as a media streaming box :)


One good news and one bad news about pogoplug and cups

I've made some progress setting up cups on pogoplug. It's not working yet, but I feel like it's sooooo close. 

I first tried cups in optware packages, but somehow all binaries in the package gave me segfault.
So I downloaded cups-1.3.10 source, and compiled/installed it myself (after installing optware development tools - gcc, make, etc). Then I realized that the kernel has usblp driver, but somehow /dev/usblp0 isn't there (even when the printer is plugged in, and dmesg shows kernel recognizing it as a usb printer). So I created a device myself "mknod /dev/usblp0 c 180 0" - the major number and the minor number was taken from:
bash-3.2# cat /sys/bus/usb/devices/1-1.3/1-1.3\:1.0/usb\:lp0/dev
180:0
bash-3.2#
After this, cups backend recognizes the printer:
bash-3.2# /opt/lib/cups/backend/usb
direct usb://Samsung/ML-1740 "Samsung ML-1740" "Samsung ML-1740 USB #1" "MFG:Samsung;CMD:GDI;MDL:ML-1740;CLS:PRINTER;MODE:GDI;STATUS:IDLE;CODE:10001;"
bash-3.2#
I've installed splix as well. However, I've never setup cups manually before, and I was lost in setting up cups. After many trials and errors, I still don't have successful cups setup - I've tried two different paths, one setting up the printer as "raw", and have my windows box to install the printer driver on its side. And the other was to use splix and have windows recognize it as generic postscript printer. However, I couldn't get either of them working - generic postscript setup didn't work because cups was giving client-error-document-format-not-supported error with a message "unsupported format: application/postscript" or something like that. I don't understand why this is happening, as seemingly correct .ppd file is installed and configured for the printer... Then the raw mode somehow never worked either and I couldn't figure out why, and by the time I got to that stage, it was waaaay to late so had to sleep :/

If you're a cups hacker who can give some advice in this sitation, it would be awesome. It's so close to pogoplug nirvana....