Thursday, January 31, 2008

USB in ITOS 2008





Initially posting this via Maemo Blogger on osgiliath.

One of the most useful improvements in ITOS 2008 is the proper support for USB Host mode. Unlike previous versions where one had to jump through hoops to even get USB devices recognized, Host mode is now as simple as sending a value over to the appropriate /sys entry.

Here's a quick-and-dirty script which I simply call usb (compiled from various sources) that not only allows you to select between Host and On-The-Go (OTG) modes, it even allows for USB networking.

#!/bin/sh

MODE=$1
if [ "$MODE" == "net" ]; then
LOADED=`lsmod | grep g_ether | grep -v grep`
if [ "$LOADED" == "" ]; then
insmod /mnt/initfs/lib/modules/2.6.21-omap1/g_ether.ko
ifup usb0
fi
IP=`getip usb0 2>/dev/null`
echo "IP is $IP"

elif [ "$MODE" == "file" ]; then
ifdown usb0
rmmod g_ether

elif [ "$MODE" == "host" -o "$MODE" == "otg" ]; then
if [ "$MODE" == "otg" ]; then
echo peripheral > /sys/devices/platform/musb_hdrc/mode
fi
echo $MODE > /sys/devices/platform/musb_hdrc/mode
echo USB mode set to $MODE

else
echo "Specify 'host', 'otg', 'net', or 'file'"
IP=`getip usb0 2>/dev/null`
if [ "$IP" == "" ]; then
CUR=`cat /sys/devices/platform/musb_hdrc/mode`
echo "Current mode is $CUR."
else
echo "Current mode is net, IP $IP"
fi
fi
The helper script getip is just
#!/bin/sh

DEV=$1
if [ "$DEV" == "" ]; then
DEV=wlan0
fi
IP=`ifconfig $DEV |head -2 |tail -1 |awk '{print $2}' |cut -d: -f2`
echo -n $IP

Basically, you just call it as usb host or usb otg; or as usb net or usb file. I haven't fully tested these scripts, but they work for me. YMMV.

Here's a shot of an N800 xterm showing my 12GB Devant HD, and the 2GB SD from my camera in a card reader. The df command was typed from a USB keyboard connected to the same powered hub. I used a cheap CA408 AF/AF USB adaptor from CDR King to connect the hub.


more > | full >>

Wednesday, January 30, 2008

It's my birthday, and I'll geek out if I want to...



Nokia 770

Nokia N800

Stowaway Keyboard

inMotion iM4
Today, having two birthdays, I turn 68. Halfy birthday to me! :-P

It's a long story, like I mentioned, one that begins with, Once upon a time, a slightly deaf functionary at the National Statistics Office jotted down the birthday of one Alex... Boring.

I'm not doing anything special today, having maxed out my celebrations over the weekend.* So, I'm introducing you to my two Nokia Internet Tablets (NITs), with which we'll hopefully have lots of fun in future posts.

Here's orthanc, a Nokia 770 running ITOS 2006 booted from its 2GB RS-MMC. Got it for about PHP 9K at Infomax in Megamall. It's currently with bro Togz for "one week", hehe.

And here's osgiliath, a Nokia N800 running ITOS 2008. It boots from the third partition of its internal 8GB SD; it also has a 16GB SD in its external slot. I've paired a ThinkOutside Stowaway Universal Bluetooth Keyboard with it (not shown). It's sitting on my Altec Lansing inMotion iM4, and is running KDE in the screenshot.
I got it for about 16K via TipidPC.

Will I be getting an N810? Probably not, though the integrated GPS and keyboard are really tempting.

All for now.

* Eyan and sis Lea did treat me to a tasty and spicy hottttt Thai dinner last night. Thankeeee!

more > | full >>

Tuesday, January 29, 2008

Globe DSL up-down-upgrade

I upgraded my Globelines DSL a couple weeks ago, but yesterday(?) it went back to 512Kbps. Wat fa duck happened, a bad DB restore? :-( After three calls (tech->CS->tech), I was told to monitor the connection within the next 24 hours.

A few minutes ago, I tested it again:


Not shabby at all. Happy happy, joy joy!

Para nga lang akong yoyo.

more > | full >>

Sunday, January 27, 2008

Woohooo!



We're back! The bus ride to Uacon "only" took about four hours, but seemed like forever. The return trip was 6.5 hours but didn't seem to take as long.

Great weather, fantastic beach, excellent company, good food... everything I could wish for in a post-pre* birthday vacation, and my first real out-of-town trip in years.

Pucha pare
, mucho thanks for suggesting Uacon!

I asked the bros to give me two digits each, strung those into a single number, and took the last floating point digit of its square root. Bro Gari was pre-assigned the winning digit ("1"), so he made off with the Diggnation shirt. Talk about geeky raffles, heheh.

Public pics are up at my Picasa gallery and in the sidebar, currently. There are actually waaay more... over 250, in fact, including some only possible with my new Canon WP-DC15protecting my IXUS 950 IS(aka Powershot SD850 IS). Only friends will get to see them all, though. :-P



* Long story.

more > | full >>

Friday, January 25, 2008

Putt-putting to Putipot*


So. My bros and I are off to Uacon, Candelaria, Zambales** tonight. We're staying at the Dawal Beach Resort, then heading over to Putipot Island (that's the small island in the map) in the morning. Jay's pics of his trip there are here.

Can't wait!

I got some swag off Jinx: a couple Diggnation tees and a Carpe Noctem Sweatshirt-- a good thing, since bro Eyan tells me it's gonna be real cold in the bus at night. I'm raffling off one of the tees to the bros.


* I'm pretty sure we're not gonna be on a steamboat, but hey... :-)
** EarthSearch.net rocks!

more > | full >>

Thursday, January 24, 2008

I'm baaaack!

Oist. Been a few years, hasn't it?

I started blogging in 1997, when the word blog was just about to be coined. Then I lost my domain in 2004 mainly due to the domain registrar not accepting any Philippine credit card. I couldn't renew it -- I even tried sending money via a bank -- and it got snapped up by a domain speculator who still has it up to now. Since I wasn't about to pay £1000 for it, I got fed up, let it go, and my blogging days came to an end.

Anyway, my bro over at Pucha Pare inspired me to blog again by the sheer exhuberance of his crazy posts... so here I am again.

Hello World!

more > | full >>

meanwhile, over at alexandr...