Saturday, March 12, 2011

MyApp: Calendar Widget for Android 2.2 (Froyo)

I had been looking for a decent home screen widget for the calendar(s) on my Samsung Galaxy S (currently on Froyo). Could not find one that is free, so wrote one.



Features:
* Includes events from all your calendars on the phone (personal, corporate etc., etc).
* Support for recurring events.
* Separate section for today's events and later events.
* Auto refresh in every 2 minutes (No, it doesn't wake up the phone, if sleeping -- so don't worry about battery).
* Occupies 3 (rows) x4 (columns) cells in home screen.
* Shows up to 6 events at a time.

Note:
* Apparently Google has deprecated the Calendar ContentProvider post Froyo. So this widget may not work post Froyo (including 2.2.1, I suppose). I only have a 2.2 phone and the emulators don't support Calendar (deprecated) -- so no idea.
* Tested only on Samsung Galaxy S on Froyo.

When I get a firmware update to Gingerbread to my SGS next month (hopefully!), I shall try to port this to Gingerbread as well, if possible.

Download the .apk installer here or point your phone to this QR code to download directly



Developed and built using Eclipse Indigo on Ubuntu.

Monday, February 21, 2011

Debugging Android apps remotely via Wifi

Android has tonnes of cool features and this is just one of them. Now I don't need to search for my USB cable to start developing/debugging the apps. Also, poor Samsung, my WinXP BSODs whenever I plug out my phone from adb debugging. This was irritating and that's when I came across this useful tweak.

Requirements:
+ You need a root'ed Android phone. (I suppose, to start/stop services..)
+ You need a terminal emulator software on the phone (preferrably). Android market gives it free.
+ You should already have a working debugging setup from your PC to the phone via USB (I mean all those SDK's, tools, ADT plugin installed).

Connect your phone via Wifi into a n/w that provides access to, from your PC.

On the phone: (either via a 'terminal emulator' OR via 'remote ssh' OR via 'adb shell on USB')

$ su
# setprop service.adb.tcp.port 6666
# stop adbd
# start adbd

All set, now the adbd knows it is suppose to listen on TCP instead of USB.

Disconnect the USB if connected.

On the PC: (example on Windows)
C:\>adb devices

if this shows your device connected, run
c:\>adb disconnect

Then,
c:\>adb connect mobile_ip_address:6666
Connected to device mobile_ip_address:6666
[not to mention, you can use any port other than 6666, but use the same in both places.]

c:\>adb devices
[this should list your device.]

All set. Use Eclipse and debug just like you would on a USB connected device.

Note: This change goes off once you restart your phone. You can automate this in a number of ways.. left to you.

Seeing my apps getting deployed wirelessly onto my phone and debugging and watching those variables remotely is really cool!! :)

Sunday, December 19, 2010

Custom device driver for Linksys USB Wifi on WDTV Live

There is lot of specifics involved, so before I go any further, let me clarify the title more. This post is about using the Cisco (Linksys) USB Wifi G Adaptor WUSB54GC on your WDTV Live for network connectivity. If you need to do this on your WDTV live, you would need to have sufficient understanding of Linux and shell scripting. Also, you need to have Wifi network and with appropriate network shares available via SMB or FTP and understand how you configure stuff.

WDTV Live has wireless network support, however it doesn't work on all USB Wifi network adaptors or chipsets. There is a defined list of USB Wifi adaptors that are compatible -- again this depends on which firmware you use. The stock firmware support (from western digital) might be different from the unofficial firmwares like wdlxtv. I use wdlxtv unofficial firmware but that doesn't support my linksys Wifi adaptor as well. I had bought this wifi dongle before WDTV live, so didn't want to buy another one. The result of trying to make this work on my WDTV is this post.

Apparently, the particular linksys adaptor that I'm talking about (take a look here if you want to know what I'm talking about) is based on Ralink Chipset 3070; in fact there are many other wifi dongles that are based on the same chipset. At least the unofficial firmware supports ralink 3070 chipset, however, it doesn't matter unless the device driver was built to support that particular device. ie., the device driver should have been compatible with the given vendor id and device id. This is where my device didn't work in spite of it being 3070 chipset.

I had to then setup a total cross-platform toolchain for WDTV Live by downloading the appropriate kernel source from Western Digital website. WD has provided beautiful support for building stuff for WDTV live. The source code of device driver for Ralink 3070 chipset is available from Ralink's website. I tampered the source a bit to accommodate this Linksys device too (Vendor Id: 1737, Device Id: 0077), cross-compiled the device driver for WDTV Live on my desktop Linux. Viola, my driver got loaded for that device.

This device driver was built for the kernel 'Linux WDTVLIVE 2.6.22.19-19-4'. Make sure this matches your kernel version too (this should be in line with the WDTV Live official firmware version 1.02.21).

Also, if you have this USB dongle, you should see an entry like this when you do 'lsusb' on your WDTV Live:

Bus 001 Device 003: ID 1737:0077 Linksys

INSTRUCTIONS:
1. Download this zip file that contains (rt3070sta.ko, net.mounts, RT2870STA.dat, resolv.conf, wpa_supplicant.conf).
2. Create a folder named 'wireless' in the root of a pendrive and extract the contents to that folder.
3. Move/copy net.mounts from that folder to the root of your pendrive.
4. Edit the files net.mounts, RT2870STA.dat, resolv.conf, wpa_supplicant.conf and customize with your Wifi's SSID and WPA PSK as necessary. You can use wpa_passphrase on a desktop linux to create a encoded PSK and copy that to these files.
5. More customization is required in net.mounts script as per your network to mount the right share on startup. I use ftpfs, as that seems more robust than smbfs on WDTV live.
6. Plug-in this pen drive to your WDTV live along with your Linksys Wifi dongle and reboot, your WDTV Live should join your network and mount your network share seamlessly.

I've this setup successfully working for almost 3 months now. Every time I start my WDTV live it joins the wifi network in around 30-45 seconds and the network shares are instantly available. You also don't have to worry about network interruptions, WDTV Live takes care of remounting the shares if the ftpfs breaks for some reason (note the 'xmount' in the script).

Here is the net.mounts script that I use at home (with specifics removed):
#
# Original Author: Gerald Naveen A (http://geraldnaveen.blogspot.com)
#
# WDTV Live! net.mounts to use my custom built device driver for WUSB54GC
# on WDTV Live firmwares. This script uses the wpa_supplicant to configure
# WPA based authentication.
#
# Refer : http://geraldnaveen.blogspot.com/2010/12/custom-device-driver-for-linksys-usb.html
# for more info.
#
# COPY THIS FILE TO THE ROOT FOLDER OF YOUR USB DRIVE ON WDTV LIVE!
#
# License:
# You are free to modify/distribute/use for commercial/non-commercial/
# personal applications. Any modification to this code needn't be published.
# However, any publication of this code or the derivative of this code, should
# include the original author and this license text.
#
logger -t GERALD "$0 starting..."
if [ -f /tmp/gerald ]; then
# make sure this script doesn't run more than once. Sometimes, net.mounts
# gets called multiple times.
logger -t GERALD "$0 already ran."
else
touch /tmp/gerald
config_tool -c DISABLE_ETHERNET_ON_STANDBY=NO
config_tool -c USB_POWER_OFF=NO

# NOTE: change below line to cp from your USB wireless device
cp /tmp/mnt/64BA-4243/wireless/* /tmp/
cp /tmp/resolv.conf /etc/resolv.conf

WIFI_DEV=ra0
insmod /tmp/rt3070sta.ko
ifconfig $WIFI_DEV up
sleep 5 ; # let the radio come up before scanning
#discover the current channel number
CHANNEL_NUMBER=`iwlist $WIFI_DEV scan | grep YOUR_WIFI_SSID -A 2 | grep Channel | cut -d\( -f 2 | cut -d\ -f 2 | cut -d\) -f 1`
logger -t GERALD "Configuring $WIFI_DEV to Channel $CHANNEL_NUMBER"
iwconfig $WIFI_DEV channel $CHANNEL_NUMBER

wpa_supplicant -i$WIFI_DEV -c/tmp/wpa_supplicant.conf -B
# DHCP client has some issue and is inconsistent.
#udhcpc -i $WIFI_DEV
logger -t GERALD "Configuring IP Address for $WIFI_DEV"
ifconfig $WIFI_DEV STATIC_IP_ADDRESS_OF_WDTV_LIVE netmask 255.255.255.0
route add default gw YOUR_NW_DEFAULT_GW_IP

sleep 15 ; # let the n/w settle before mount
logger -t GERALD "Pinging NAS via LAN..."
ping -c 1 -W 2 NAS_IP_ADDR_HSPEED | grep -q "bytes from"
if [ $? -eq 0 ] ; then
logger -t GERALD "Ping successful for NAS via LAN. Now xmounting..."
xmount "ftp://NAS_IP_ADDR_HSPEED" NAS_1Gbps ftpfs "-o user=movies:password"
logger -t GERALD "xmount done for NAS."
else
# could not reach NAS via high speed n/w.
# try to reach via Wifi.
logger -t GERALD "Pinging NAS via Wifi..."
ping -c 1 -W 2 NAS_IP_ADDR | grep -q "bytes from"
if [ $? -eq 0 ] ; then
logger -t GERALD "Ping successful for NAS via Wifi. Now xmounting..."
xmount "ftp://NAS_IP_ADDR" NAS_Wifi ftpfs "-o user=movies:password"
logger -t GERALD "xmount done for NAS."
fi
fi
fi ; # if already ran
logger -t GERALD "$0 complete."

In case you find issues, check /tmp/messages.txt file on your WDTV Live for the relevant log messages to troubleshoot.

Monday, December 06, 2010

Video cable for Samsung Galaxy S

Disclaimer: Although this should just apply for any other SGS, this has been tested only on SGS Vibrant, India model.

If you didn't know how this cable looks, here it is. Note the 4 terminal stereo plug (stereo plug normally has only 3 terminals).

Although one can build a cable from scratch, it is usually cheaper or same to get a read-made cable like this, instead of trying to build our own cable with just the plugs. Ok, so what is there to be done if I get the ready-made cable -- the reason is that, all cables aren't compatible with SGS video output. This post anyway has all the info to build your own cable, if you are interested.

The common confusion that prevails in the forums is that some cables work and some don't; so how do we buy the right cable. The answer is that, you don't have to worry as long as the terminals are exactly these (ie., 4 pin stereo on one end, RCA on the other end). I had bought one such cable from ebay India for just Rs. 100. You can search for "Camcorder RCA cable" and you might end up on one such item.

If you get a camcorder cable, it most likely won't work. If it doesn't work in the normal configuration (ie., Yellow to Video, Red/White to Audio), try connecting the White to Video, and Yellow/Red to Audio. This should just work.

Why?


This is how a 4-terminal stereo plug looks. Lets name the terminals as T1..T4 as in figure. The camcorder cables send T4 to Video, but the SGS sends out video on T2. On Camcorder cables, T2 is the Left/Mono Audio (White) -- thus swapping that for Video works.

T1 is the Ground. As long as the ground is not changed, you should be able to convert any cable to be compatible with SGS video out. T1 usually gets in contact with the case/body of the device, so I would think it would be always ground on any such cables for consumer devices. I also don't see any reason for a cable to insert the video terminal between the two audio terminals. Going by these rules, it is most likely that, it is either T4 (T2, T3 are audio) or T2 (T3, T4 are audio) which is the video terminal.

If you have a multimeter, just connect this cable to your phone, turn on Video out on settings and measure the DC voltage (0-20V range) on each of the RCA plugs (make sure the phone isn't playing any audio). Only the video plug will sense a voltage of ~1.5V at this point. This should identify the video plug safely without having to try out various plugs on the TV directly.

To summarize, so you can build one if required. The SGS video output pin out is:

T1: Ground
T2: Video
T3: Left/Mono
T4: Right

Monday, November 29, 2010

Getting over problems

Courtesy: Pravs World

If you can't get through the mountain, Go around it. If you can't go around it, Go over it.

If you can't go over it, sit down and ask yourself, if getting to the other side is all that important? If it is, set about digging a tunnel.

For every problem, there are many solutions. Whatever the problems in life are, you have to find ways to get over it.

Saturday, November 13, 2010

MyApp: Spb Wallet to KeePass convertor

Spb Wallet is one of the best wallet applications that I've used across various mobile platforms. However, it isn't available on all mobile platforms and it isn't free either. Once I moved on to Android, I hit a road-block because Spb Wallet isn't available for Android (yet). I'm sure you would understand how painful it is to not have a wallet app, once you are used to.

KeePass is the alternate. KeePass is an open-source software for password management. To be fair, KeePass isn't as great as Spb Wallet, but does its job. Being open-source, it is available on almost all platforms including desktops.

The pain here is the conversion. I have tonnes of data on Spb Wallet that manually entering them on KeePass is a no-go. Unfortunately, and mostly intentionally, Spb Wallet doesn't export to any well known format for import into KeePass. There weren't any handy tools to convert either. Thankfully Spb Wallet had a text export and KeePass had many import options. But it isn't directly compatible, because Spb Wallet doesn't have any proper structure to the exported TXT file and the grammar is quite ambiguous. KeePass has a well defined XML structure for import (found it by doing a sample XML export from KeePass). I wrote this python script to convert the Spb Wallet TXT export file into the XML format that KeePass can understand. In reality, Spb Wallet has more "specific" fields than KeePass, so there isn't always a direct mapping. Any non-mappable field (Account Number for example) will be appended in the notes section of KeePass so no information is lost.

This script is a simple parser that understands and converts the Spb Wallet TXT export file. It maintains the internal state of parsing and learns dynamically about what the current token is -- some times even looking ahead into the file to resolve ambiguities.

This script is probably not so robust on errors. But this did the job for my Wallet export which is reasonably big.

If you find any bug on this script that you want me to fix, report here. I *MAY* fix it for you.

Here is the source:
#
# Code to Convert Spb Wallet TXT export file to KeePass XML import file.
#
# Original Author: Gerald Naveen A (http://geraldnaveen.blogspot.com)
#
# License:
# You are free to modify/distribute/use for commercial/non-commercial/
# personal applications. Any modification to this code needn't be published. 
# However, any publication of this code or the derivative of this code, should 
# include the original author and this license text.
#
import sys

def mywrite(f, str):
f.write("{0}\n".format(str));
def main():
print "\nSpb Wallet to KeePass Convertor v 1.0 by Gerald Naveen\n";
print "Report bugs at http://geraldnaveen.blogspot.com/2010/11/myapp-spb-wallet-to-keepass-convertor.html\n";
if len(sys.argv) < 3:
 print "Usage: spb_wallet_to_keepass.py <spb_txt_export_file> <keepass_xml_import_file>";
 print "\nWhere,\nspb_txt_export_file: path to the TXT file exported from Spb Wallet.";
 print "keepass_txt_import_file: path to the output XML file, that shall be imported into KeePass.";
 return;
try:
 ifile = open (sys.argv[1], 'r');
except:
 print "Could not open input file", sys.argv[1];
 return;

try:
 ofile = open (sys.argv[2], 'w');
except:
 print "Could not open output file", sys.argv[2];
 return;

FOLDER_NAME_TOKEN=1;
ENTRY_NAME_TOKEN=FOLDER_NAME_TOKEN+1;
BEFORE_NOTES_TOKEN=ENTRY_NAME_TOKEN+1;
NOTES_TOKEN=BEFORE_NOTES_TOKEN+1;
INVALID_VALUE='invalid';

next_token=ENTRY_NAME_TOKEN;
folder_name = INVALID_VALUE;
entry_name = INVALID_VALUE;
user_name = INVALID_VALUE;
password = INVALID_VALUE;
url = INVALID_VALUE;
notes = INVALID_VALUE;
valid_entry = False;

mywrite(ofile, '<?xml version="1.0" encoding="utf-8" standalone="yes"?>');
mywrite(ofile, '<pwlist>');
try:
 for line in ifile:
  line = line.strip('\r\n');
  if len(line) == 0:
   # empty line
   if valid_entry == False:
    # entry name found after folder name
    folder_name = entry_name;
    entry_name = INVALID_VALUE;
   else:
    # found the last line of the entry..dump
    mywrite(ofile, '<pwentry>');
    if folder_name != INVALID_VALUE:
     mywrite(ofile, '<group>{0}</group>'.format(folder_name));
    mywrite(ofile, '<title>{0}</title>'.format(entry_name));    
    if user_name != INVALID_VALUE:
     mywrite(ofile, '<username>{0}</username>'.format(user_name));
    if password != INVALID_VALUE:
     mywrite(ofile, '<password>{0}</password>'.format(password));
    if url != INVALID_VALUE:
     mywrite(ofile, '<url>{0}</url>'.format(url));
    if notes != INVALID_VALUE:
     notes=notes.replace('\n', '&#xD;&#xA;');
     mywrite(ofile, '<notes>{0}</notes>'.format(notes));
    mywrite(ofile, '</pwentry>');
    user_name = INVALID_VALUE;
    password = INVALID_VALUE;
    url = INVALID_VALUE;
    notes = INVALID_VALUE;
   valid_entry = False;
   next_token=ENTRY_NAME_TOKEN;
  else:
   if next_token == ENTRY_NAME_TOKEN:
    entry_name = line;
    next_token = BEFORE_NOTES_TOKEN;
   else:
    valid_entry = True;
    if next_token == BEFORE_NOTES_TOKEN:
     if line.startswith('User Name:'):
      user_name = line[len('User Name:'):].strip(' ');
     elif line.startswith('Password:'):
      password = line[len('Password:'):].strip(' ');
     elif line.startswith('Web Site:'):
      url = line[len('Web Site:'):].strip(' ');
     elif line.startswith('Notes:'):
      if notes == INVALID_VALUE:
       notes = line[len('Notes:'):].strip(' ');
      else:
       notes += '\n' + line[len('Notes:'):].strip(' ');
      next_token = NOTES_TOKEN;
     else:
      # any unknown params should go as notes.
      if notes == INVALID_VALUE:
       notes = line;
      else:
       notes += '\n' + line;
    elif next_token == NOTES_TOKEN:
     # any thing from the notes section.
     notes += '\n' + line;
except:
  print "Unknown error occured while processing the input file.";
mywrite(ofile, '</pwlist>');    
ifile.close();
ofile.close();
print "Success. Now import {0} in KeePass as KeePass XML".format(sys.argv[2]);
if __name__ == "__main__":
   main()
Download spb_wallet_to_keepass.py

Update [26-Nov-2010]:

If the script ran successfully, but the output XML file didn't work on import, it could most likely be a CRLF issue. Try this in such cases:

Lets assume your file is test.txt.

1. Open test.txt in Notepad
2. "Save as" another file, say test2.txt (Note: select Utf8 as Encoding).
3. Use test2.txt as input

Monday, October 11, 2010

Asus RT-N16 -- my new home Wifi router

This is a long pending post. I had bought this router for my home a month back and never got to write about it.

Picture first:


I had been looking for a Wifi router at my home before I could narrow down on this. Here were my requirements:
  1. Good range: The current wifi router that came with my Internet connection can barely cover 25% of my house. I needed something that can cover every corner of my duplex flat. Otherwise the exercise is of little use.
  2. Thirdparty-firmware: I was mainly eying at dd-wrt for the firmware. It *has* to be dd-wrt compatible so I can play around with the firmware and add services to it. dd-wrt has multiple versions of the firmware based on the flash size available. Most routers these days have <=4MB flash (some of them only 2MB). Those will need to run mini or micro versions of dd-wrt which have limited capabilities and extensions. I was looking at a router with at least 8MB flash, so the mega version of dd-wrt fits.
  3. 802.11n: I wanted 802.11n draft support. I was actually more inclined towards simultaneous dual-band vs just dual-band. Also, I was fine with 2.4GHz 'n' if 5.8GHz 'n' isn't available.
  4. USB mass storage: I wanted the router to also be my NAS. So I can just attach a USB HDD to the router and can access it anywhere else in the house. Currently my EEEBox does this for me, but that's one more device to run.
Selecting a good range was the difficult task because there is no benchmark that fits all for this. When some one says *good* it is relative and not absolute. That doesn't help me in anyways to select mine. As it was an important factor me, I had to overshoot my expectation and get a really good one.

Eventually, I narrowed down on 2 routers:
  1. Cisco Linksys WRT610N
  2. Asus RT-N16
Both seem to claim very good range. WRT610N has 3 internal antennas, whereas the RT-N16 has 3 external antennas. Anytime, the external ones are more powerful. The Cisco one looks really cool though. No, but range was more important. Both are of similar price range (~10K INR). Both have USB support. Both are supported by dd-wrt. The biggest differentiating factor between these two that helped me decide, is the hardware. RT-N16 has an awesome processor at 533MHz, 128MB of RAM and more importantly 32MB of flash. The Cisco one has just 8MB flash. 32MB flash is too good that I don't have to worry about space while enhancing the router for other tasks. The powerful processor should also come in handy to support multiple operations in parallel. There are more comparisons on the specifications, but that's too much to be here.

Went ahead and bought RT-N16. Even though I didn't intend to use the official firmware, the Asus official firmware for RT-N16 is pretty good (except for the NAS part). In fact the official firmware supports 1TB disks and NTFS file system. Even the dd-wrt doesn't have proper support for NTFS (yes, ntfs-3g driver is available, but is still error-prone on large partitions, that I had to move to ext3 for my NAS). Any time a journal'ed file system like ext3 is better for NAS. Anyways, in 2 days, I upgraded the firmware to the unofficial dd-wrt. It's very handy, specially as it exposes the whole Linux underneath. The extra flash memory can be mounted via JFFS2 file system and that's the place to make wonders.

This router has served all my purposes. It has terrific range that my earlier mobile (ASUS P320) which is the weakest Wifi client I have, connects from the farthest point within the house. Before I could wink, I already have 8 wifi devices at home -- enjoying the n/w all around my house. It's an useful luxury!

Sunday, September 19, 2010

Installing WDTV Live Unofficial Firmware

As of this writing, the latest stable official firmware version for WDTV Live is 1.02.21.

There is also an unofficial firmware for WDTV Live that opens up the whole linux underneath along with several other services. The unofficial firmware 0.4.2.2 is based on the official firmware 1.02.21 and is around 80MB while the official firmware is just around 32MB. The difference in size includes a whole bunch of additional services like SMB server, FTP, telnet, dropbear (ssh), torrents, apache etc., to name a few. But not to worry much, the unofficial firmware provides total control to us to configure not to start any of these services that aren't of interest to us.

The unofficial firmware can be downloaded from WDTV Forums. (you need a registered account, its free).

Upgrading to the unofficial firmware isn't really a big deal; I am writing about this only to complete the context for a lot more posts that I intend to write over the unofficial firmware (I've already done quite a bit of things on this, including building a custom device driver for WDTV Live, modifying their scripts etc). With little bit of caution, one can safely upgrade to the unofficial firmware. Most importantly, the unofficial firmware is totally safe in terms of the functionality (I mean the media player functionality..) because, the unofficial firmware hasn't re-written the complete functionality -- rather it is just an extension to the existing firmware. Someone smart out there, has just unpacked the cramfs image of the official firmware and customized/extended the scripts, added more apps etc., and made it a full-fledged linux box that can do much more than just media playing. I felt very comfortable going ahead with the upgrade when I read about this. Not just theory, but I upgraded the same day I unboxed my WDTV Live; ever since I've been running on the unofficial firmware without any issues -- playing heavy full-HD with DolbyDigital / DTS. It is also possible revert back to the official firmware in case it didn't workout for you, nevertheless.

Tip: WDTV doesn't upgrade to a firmware, if the new firmware's version is not greater than the current firmware version. So, if you are already on official 1.02.21 (like I was), you cannot theoretically upgrade to the unofficial firmware (in spite of it being very different). Fortunately, the version of the new firmware is read from a separate .ver file that comes with the firmware update pack, which can be easily tweaked around. This tip is also important specially when you want to downgrade your firmware or revert to the official firmware.

The firmware has generally 2 files : wdtvlive.ver, wdtvlive.bin. The .ver file has the version of the firmware and the also points to the wdtvelive.bin. It looks something like this:

VERSION='1.02.21'
LOCATION='wdtvlive.bin'

Sometimes you might need to play around with the version string as pointed out earlier. Put these two files (.ver, .bin) in the root directory of your USB drive attached to the WDTV and start it. Once started, WDTV should show you a menu item for 'Firmware upgrade'. It's straight-forward from there on.

IMPORTANT: The upgrade itself doesn't take very long, but make sure the power doesn't go off during the upgrade. If possible, run the player on UPS during the upgrade. However, the first boot after the "unofficial" firmware upgrade takes pretty long (actually many minutes) and there won't be any video signal to your TV during that time -- so don't panic (until later :P) that you had bricked your device.

Friday, September 03, 2010

Jump for Challenges

Courtesy: Pravs World

Instead of avoiding challenges, jump into them.
Beat the heck out of them. Enjoy the game.
If your challenges are too large, do not give up.

Failing makes you tired. Instead, reorganize.
Find more determination, more knowledge and more help.
And then, Just go for it!

Sunday, August 29, 2010

WDTV Live - HD Media Player

WDTV Live! is the new entry into my home.

It is a full-HD (High-definition, 1080p) Media Player that can play most Video/Audio formats and codecs available today. My EEEBox was in this place earlier to me but EEEBox (B202) struggles to play anything more than 720p video (some frames in even 720p video also stutter if there is too much of a change from the previous frame). I really couldn't enjoy the half/full-HD videos using that. Also, I had to control my EEEBox from my mobile phone via VNC -- this did the job, but wasn't as comfortable as a TV remote. So decided to buy this player.

The choice was between XStreamer and WDTV Live! but I was convinced that I should go with WDTV Live for my needs (Why? is a different topic altogether, that I'm not touching right now).

This is how it looks:

Although small, this is a real monster. I did realize its power only after I played the full-HD (high data rate) version of Avatar (11 GB for 2 hours of video with DTS audio). It flawlessly played the full-HD movie without any glitch, while my EEEBox would hardly render a frame of it. It is connected to my home-theatre receiver via the optical digital audio connectivity (S/PDIF). It transmits the digital audio via the optical interface and the home theatre plays it well (Dolby-digital or DTS). Watching Avatar full-HD with DTS sound was a new experience at home! For those who don't have a home theatre or that doesn't support Dolby Digital or DTS, WDTV Live has a down-mixing support that converts high-end audio to Stereo.

WDTV Live uses the Sigma 8655 chipset, which gives it all its power. Btw, the most interesting thing is that it runs on Linux, but for you to enjoy a Linux node, you need to mod it to the unofficial firmware that exposes telnet. From then on, it's a whole linux box that one can play around with.

It can play media from a USB storage attached to it (no, it doesn't have built-in storage) or from a network. It supports Wired Ethernet and some fixed set of Wifi adaptors. I currently have a Linksys Wifi-adaptor, but that's not supported :(. Due to the lack of Wifi, I had to do some network-bridging to transparently connect my WDTV to my home network, so other devices also can access my WDTV and vice-versa (eg., I can remote-login into my WDTV's linux from my laptop). Media via network was the key thing to me. However, it supports only SMB (samba) based network shares (the unofficial firmwares do support other types; I'm already playing via a FTP share from my NAS).

The remote looks a bit less responsive to me. The UI looks really cool. A cold boot takes around 20-25 seconds (official firmware) and a warm boot takes less than 5 seconds (actually only the UI goes down when the device is powered off via remote).

This device has redefined my TV experience at home! Although I had Dolby Digital/DTS setup earlier, lack of full-HD was definitely a setback. Ah, that's past :)

Sunday, August 15, 2010

Heavy rain in Bangalore

Heavy rain lashed eastern Bangalore today noon. I was driving on the Marathahalli outer ring road then. Visibility was terribly low. My car's wiper could barely manage even at its full speed swing. I could barely see anything beyond 50 meters. Every car was crawling at 30kmph while the normal speed would be around 70-80kmph (the speed limit is 60kmph btw).

See the photoes. It was shot near Kadubeesanahalli junction, Marathahalli Outer Ring Road, Bangalore (15-Aug-2010, 2.10 pm.).





It was fun!! I've never driven earlier in such a heavy rain. It lasted at least 20 minutes like this.

Thursday, July 22, 2010

Dual boot Meego with Windows XP

After quite a bit of hesitation, last week I managed to install Meego onto my hard disk on EEEBox along with Windows XP. The success stories on getting dual boot on Meego aren't many (in fact none that was satisfactory to let me confidently try). Anyways, it was a pain to boot the live version on USB and reconfigure every time.

This wasn't smooth. There were at least 2 times when I thought I just lost one or more Windows partitions!! I wasn't sure how good is Meego's installer's partition manager, so did all the partitioning on Windows.

/boot -- primary partition; better to keep this primary (ext3)
/home -- logical partition (ext3)
/ -- logical partition (btrfs) - recommended by Meego for /
swap -- logical partition (swap)

Obviously, formatting was done during the Meego installation. The first time I started the install and configured all the mount points, filesystems etc., and let the installer to proceed. The installer failed half-way while formatting my / partition! Not sure if that's related to btrfs or whatever. But it failed and the installer exited. Huh! The first thing I did then was to boot into Windows and check my data (and they were in tact). Although I was actually hopeless to retry, the second try just worked! This time, I didn't have to format /boot, /home, swap as they were already formatted in the previous try - not sure if that means anything here.

Okie, the Meego install was super-fast. Takes less than 5 minutes. I believe they just copy the live image as-is to the disk and just do some post configuration. The post configuration has the boot loader part. It detected my Windows and asked about the default option etc., Sadly there is no option to configure the boot loader timeout. I purposely let Meego as my default boot, so I can fix the boot loader if some thing goes wrong (it helped). Renamed the "Other" option to "Windows" and completed the install.

When EEEBox restarted, I couldn't have even a glimpse of the boot loader. Meego was quickly on its way. I had read about this timeout issue earlier in other forums. The boot loader does not wait enough by default. The boot loader config file is in /boot/extlinux/extlinux.conf. Edit the file as root and fix the 'timeout' configuration to 100 (means 10 seconds). Also comment the "menu hidden" line by prefixing with #.

timeout 100
#menu hidden

I didn't know that a shocker was waiting. I rebooted the EEEBox and tried entering into Windows, just to see the notorious error : "NTLDR missing". I was quite scared if Meego just blew up my Windows partition. Thankfully, I vaguely remembered that during the boot loader configuration (in install), I noticed that my Windows partition was identified as /dev/sda2. I had doubted that right at that time, but I hoped Meego would do it right. Actually my Windows was on /dev/sda1 (and most Windows installations would be). But the extlinux.conf file doesn't have any mention of /dev/sda2; for that matter even "sda2". The Windows boot is done by chain.c32 and the boot partition is an argument to this image.

# this is how the conf file looked
kernel chain.c32
append boot 2

Here, the boot parameter means /dev/sdx2. As it doesn't say the disk id, it looks to me if Meego can detect only other OSes on the same disk as where Meego is installed. Hmm..

Changed the config to 'append boot 1' and got into Windows successfully. Sigh!

Though there were hickups, Meego didn't make any damage beyond repair - Happy about that at least. Now Meego automatically logs into my home Wifi without any additional config. Installed gcc, cpp, kernel-headers, kernel-source etc., It has been a week since then; never got back to it :D

Keep Moving In Life

Courtesy: Pravs World

He who is silent is forgotten.
He who does not advance falls back.
He who stops is distanced, crushed.
He who ceases to grow becomes smaller.
He who leaves off, gives up.

When you decide to stand still in life,
you mark the beginning of your end.

Monday, July 05, 2010

Meego on my Asus EEEBox

I've been planning to do this for a while, at last managed to do it this weekend -- installing Meego on my Asus EEEBox.

Meego is primarily a Linux platform for the handhelds. While Meego is under rapid development for the smartphone sector, the Netbook version 1.0 of Meego has been out for a while (more than a month). The interesting thing about Meego is that it supports two hardware architectures: ARM and IA32 (the x86). As you might have guessed, ARM is mainly for the smartphones and x86 is for the notebooks -- primarily targeting the Intel's Atom processor series. In fact, x86 Meego is supported only on Intel's Atom and Core 2. My EEEBox is Atom N270, so didn't have any issues with it.

As any other modern linux distros, Meego needn't be installed, but could be run live from USB (or whatever). One can download the image file from Meego's official website (Note: there are two versions for Notebooks, one with Google Chrome browser and the other without Chrome -- due to the need for a separate EULA from Google). The image file is a standard img file and can be burnt on to a USB stick. One can use win32diskimager on Windows or use the well-known 'dd' (dd bs=4096 if=imgfile of=usbdevice) on Linux.

Note: Burning the image file onto USB disk, will messup with the existing file system on the USB disk; so be ready to lose those files, if it wasn't obvious.

Once the USB image is burnt, it was flawless. Here are some screenshots (you are seeing my TV, as my EEEBox is connected to my TV):

Boot loader:



Boot splash screen:



From the time, I selected 'Boot Meego' at the boot loader, it did not take more than 15-18 seconds to boot and get to the Home screen. It was impressive. For a handheld, I guess this is a big plus. A quick boot and a bunch of features at the finger tip, makes sense. Unless you know it already to be a Linux variant, it is difficult to predict by its appearance.

The Home screen:



Actually once I opened a bunch of applications, this home screen has more items. It acts like a task bar to switch between various running apps. All my devices were detected and Meego had its drivers: Display, Audio, Ethernet, Wifi. The first thing I wanted was to bring it on to my Wifi network and run VNC so I can play with it remotely. My EEEBox is just a computing node with no input devices (so I had to borrow it from my desktop for a while). Setting up Wifi was easy as any other OS. It detected all the wifi networks. Key-in the password as necessary and it just connects!

Wifi Configuration:



Once connected, I was so excited to play around with the network stuff. With Google Chrome browser handy, it wasn't any different than any other OS. I wanted to try out a video from youtube, to test the graphics capabilities. I was only stunned. I even ran the video in full screen and it was hassle free. See for yourself.





I am seriously considering to use Meego when I need to use my EEEBox as a media center PC -- which is what I do most times with it connected to my TV. Primarily because it is much faster to load and light-weight. Presumably, given that it is a Linux variant, it may not be difficult to port any non-UI services to Meego (the UI framework is specific to Meego, I could see that right at first look -- in Meego terms it is called UX, User eXperience). Btw, I did install the VNC server (vino) on Meego and was able to control it from my network. There is a Linux Shell available in the menus, which is a native linux shell opening up the beast behind. 'rpm' is the package manager. It was fun!

Wednesday, May 19, 2010

Logitech Harmony 525

I bought this cool gadget last week. It should ideally be part of every household that has more than 2 remotes -- but due to the technical complexities involved in configuring it for their devices, it is not actually meant for every one. But for those with little techy background, this is a bliss.

This is how it looks



This is basically an universal remote, which can be used as a single replacement for all the remotes in your drawing room. What is unique about this product is that it can be configured for an activity instead of a device. To be more clear, the functionality of the remote is not based on which device you choose to operate on; instead it is based on which activity that you want to operate on. For example, in a typical home with a TV, home theatre (HT) and a set top box (STB) for digital TV, when you watch TV, you need to change volume on the HT, change channel on the STB, program guide on the STB etc., etc., Basically there are a number of actions that you would perform while watching TV and each belong to its own appliance.

After proper configuration, this is what my remote does when I say 'Watch TV' (on a single button press)
1. Powers on my TV, Home Theatre (HT), Tata Sky Plus - SetTopBox (STB)
2. Waits for 3 seconds (for the devices to load)
3. Sets the TV's input to Component1
4. Sets the HT's input to AUX
5. Changes the channel in the STB to 'NatGeo' (to avoid the irritating ad-channel at the start on tata sky).

all at a single click. Now when I change volume, it sends out the volume up/down to the HT and when I change channels it sends out the channel up/down to the STB. This is what I called 'activity-based' against 'device-based'. Pretty useful and cool.

There are few things that I don't like about it: I hate their configuration mode. It should have been better. You need to have internet connection to configure your remote at home (horrible). Every page in the configuration wizard sends out HTTP requests via the internet to their servers (even worse) -- this makes it too slow. And the justification they provide is: the remote configuration is available at any place at all times!! WTH!!

For configuration, the remote needs to be connected to your comp via USB..Hmmm, soon a wall clock might have a USB port to sync with your outlook calendar! I hate the fact that there is no way to alter any configuration of the remote, without a comp (and yuck, an internet connection too). Some times this makes me postpone a configuration that I would love to have then. Also, the remote's LCD display is always ON; that makes me feel the power is wasted all the time -- I'm surprised why isn't there a power button for the remote itself! No wonder it runs on 4 AAA batteries. Not sure how long it runs.

Anyways, while configuring the devices it controls, they have a huge collection of devices for you to choose from. The software identifies the correct device for you based on various inputs (make/model/type etc); sometimes it asks you to press one or more keys from the original remote and compares it against their database to disambiguate. This was impressive to watch. I had to get used to 'thinking in harmony' before I got comfortable. I should say it wasn't a easy thing to get started immediately -- but given the task, not sure if this could have been any simpler.

But once configured, it rocks! I'm starting to forget that there are 3 devices involved while I watch TV -- there it wins, silently!

Monday, May 17, 2010

Never Give Up On Anything

Courtesy: Pravs World

Its Madness -
To hate all roses, because you got scratched by one thorn.
To give up all your dreams, because one did not come true.
To lose faith in prayers, because one was not answered.

To give up on your efforts, because one of them failed.
To condemn all your friends, because one of them betrayed.
Not to believe in love, because someone was unfaithful.

Remember that, another chance may come up.
A new friend, A new love, A new life.

Never give up on anything!

Sunday, May 02, 2010

Jakkuboys

A funny play, describing an IT office :) In tamil though; subtitles still can't bring the original effect!

Jakkuboys - The Movie from Scube Productions on Vimeo.

Wednesday, April 28, 2010

Digital shredding

Everyone who runs a business or those who are concerned about their confidential documents, make sure they shred their documents when they realize that they no longer need it. Shredding old bank documents, telephone bills etc., are common things. There is a strong need for this, undoubtedly.

In this revolutionary digital world, we should also realize the bigger danger that we have. Many do not know or realize that deleting a file from a comp, does not really delete the file's contents. Based on the size of the file, the fragmentation on the physical storage, the amount of free space left, the number of files written later to the disk (etc., etc.,), a portion or even the whole file may not get over-written at all -- thus facilitating the recovery of the file. The odds of recovery is higher on magnetic disks (unfortunately, the typical HDD medium so far) -- it seems to have a (fairly) non-zero success rate even on an over-written file. This is why the digital shredders usually write various unique patterns over and over again to completely shred the file from recovery.

To quote just one example, it is a common practice, to write down username and passwords on desktop temporarily and deleting it after use -- well it's not over then. It is a bitter truth that someone who gets hold of your hard disk today can retrieve quite some "deleted" confidential data. The odds of losing a disk is pretty high when it is a laptop or when it is a portable hard drive -- these devices aren't uncommon anyways.

There are so many free file shredders available to choose from. Most of them integrate an option to the Explorer's right click menu on the file, so it is easy to use. You can even choose the shredding algorithm to use based on the size of the file and the extent of confidentiality. The stronger the algorithm, the slower it is in shredding. I use this File Shredder, but that's just one among many.

In the digital world, it is so risky that when the damage occurs it is faster than we could react. If you are thinking about shredding your files when you sense a danger, you might most likely fail to do so successfully. It would rather be a good idea to shred (instead of just deleting) the files as when you are done with it. It should come as a practice so we leave less footprint of confidential information overall.

But beware, you can't ever recover the file if you accidentally shred it!! everything comes at a price, ain't it?

Thursday, April 01, 2010

Microsoft Windows Mobile - an interesting bug

Bugs aren't rare; that too on Windows.

But this bug on my Windows Mobile phone, was a bit too much. See this snapshot:



The SIM card was very much present in the phone. That isn't the strange part here -- but note the signal-strength meter and the EDGE-support symbol at the top. While WinMo had connected to my service provider and registered itself successfully, some WinMo component still thought that the SIM card was missing! To add to it, I was even able to make/receive calls and the status was still adamant that it was 'missing'.

The well known Microsoft fix worked finally...yes, 'restart'.

btw, this isn't an april-fool hoax ;)

Thursday, March 25, 2010

Cisco (linksys) wifi client

I recommend reading my earlier post on my home network before reading this one.

I need to agree that my use case was a bit uncommon, but the impact was a bit too much. The first thing that I had to do after installing the Cisco Wireless Client (called CWC from now on) was to uninstall it. This is why:

I bought a USB wifi dongle from Cisco (was a linksys product) to use it on my EEEBox.

As explained in my earlier post, the idea was to use this wifi dongle as an end-point for internet/intranet access in my home. I connected from my laptop to my EEEBox via VNC over the existing wifi connection. The dongle's box insists on installing the software first before I plug in the hardware into the comp -- possibly for simplicity and to avoid user errors. I remotely mounted the CD (remember? EEEBox doesn't have a CD drive) and started the install. As I started, I was starting to think about how this software is going to handle an existing wifi card which doesn't belong to Cisco. The software didn't show any sign of detecting such a card. At this point, I was calling that as 'seamless' integration!! but that thought didn't last so long. The installation proceeds and reaches the end and my VNC viewer closes!! I was a bit shocked with this behavior, but was hoping that the new wifi client will initialize and get back, and I should soon see my EEEBox back on my wifi network -- but it never happened. As I have static mapping (MAC->IP) on my DHCP server, I knew the IP that it would get every time. Clearly it had gone for a toss!! Then I rebooted the EEEBox using the hardware button on the case and watch the display on my TV. I realized there was an issue (Note: I haven't plugged in my cisco wifi dongle yet). The CWC started up but it was not able to connect to the network -- and the reason: authentication failure. CWC had only picked up my SSID from Windows but not any other credentials (WEP key in my case). This is half-baked migration. If it was not possible to read such credentials from Windows client, it should have at least warned me that it couldn't do so or have asked me for the credentials again! Ok, I forgave and reconfigured the settings on CWC and got it connected to my network. As I thought, I was all done but just plug in the USB dongle, I had a surprise waiting. The moment I connected the USB dongle, the CWC detects the new interface, installs the required drivers and brings it active. BUT, disables the old wireless connection!!! This sucks! defeats my whole purpose. I later realized that CWC doesn't allow two wifi connections (for that matter, any two network connections) at the same time -- at least that software that I got with this dongle didn't! Simplicity at the cost of functionality? I didn't have to think again, just uninstalled CWC instantly. Thankfully, this time, the software did what I expected. It didn't uninstall my wifi dongle drivers, but only the client software. So, one reboot, the Windows wireless client takes over, with both my wifi network interfaces active! Sigh!! Windows resurrected me from something else, for the first time ;)