Saturday, September 5, 2009

Android app Hunting Lines has been submitted as an entry into ADC2

Hunting Lines is an app that lets a user select a set of contacts and starts dialing them one after the other until one of them picks up the call. This was inspired by the problem of contacting LPG gas agencies and the like that have many phone lines that are always busy!

This app has been submitted as an entry into ADC2, which is the Android Developer Challenge 2 by Google.

Some problems/challenges we saw while making the app:
* There are internal APIs in the SDK that are invisible to developers like us unless there is a certificate that is the same as the one used by the Android core platform.

* What APIs did this app need: a way to reliably know the different phone states like call started, ringing, connected, disconnected, idle, missed etc. The only ones available are: off hook, idle and ringing. So, that was the first problem. So, how did we figure out if a call we initiated went through or not - a post by someone in Google (Megha Joshi) hinted at using call log for some question came as help. So, the app changed to look at the call log whenver the call state idle event is received. That worked!

* 2 phones had Android on them for testing - one was the openmoko phone and the other being the Android Dev Phone. One the openmoko, we used the alpha release of the cupcake version by Koolu. On this version, the app started to go from one number to the other perfectly until one of them connects.

The same thing did not work on the Android Dev Phone, why - after every call, we would end up seeing the call log screen that prevented the phone state idle event to be posted. So, you have to exit the call log screen to start dialing the next number!!! How dumb can that be specially when you want the app to be completely automatic. Any workarounds here - None!!! Just while searching for a workaround, I saw an email from someone (flohier) to the android developers forum stating the same problem and the failed attempts at getting it to work.

* At times during debugging, I would end up not seeing the app and we figured out that when Android loads, it would kill an app that does not have a certificate. I learnt this only while trying to submit the app and it threw an error saying it needs a self certified certificate.

Anyway, it is now in the contest. We plan to release the source and the apk into opensource in a day or two. We will post an update here. If you plan to use the source or the apk, please send an email to openologyATgooglegroups.com. Oh, and please send us some feedback if you use the app!
Update - here's the source - http://gitorious.org/hunting-lines
New home - http://firstpenguin.org/tiki-read_article.php?articleId=4

p.s: the name was coined by Praveen and the idea comes from Radha.

Thursday, July 9, 2009

InstallShield error 6199 and other errors...

I am posting this here because the forums I have been visiting don't let me post unless I am registered. I don't want to register because this will be the only time I will post. So, I thought why not let Google search land up at this blog entry? That will keep things simple.

I got this unusual error and with the help of a friend, figured out that a "special" character had landed into the Installshield ISM file. Instead of "Author's" it had become "AuthorÉs" (I have used Alt+keypad 400 to generate this character in place the actual one I saw!).

This was figured out by opening the ISM file in the InstallShield editor while all the time, the internal error was showing up in the command line. It turns out that I have seen a lot of people using the ISsaBld.exe to generate the installers. So, the editor said - Line 1549 Col 100 has a special char, while the command line just generated "ISDEV: internal error -6199". Interesting isn't it?

There were other errors like the directory where the output was being generated was open by some process. So, I used SysInternals' ProcessExplorer to figure it out!

-raghav

Thursday, May 21, 2009

Inspired by Dr.Randy Pausch

Landed up at the transcript of Dr.Randy Pausch's 'Last Lecture' and was instantly inspired by him. Ended up reading his book and have had many discussions with Prasad, Radha and Subbu.

Did something interesting with the 'First Penguin' chapter! More information will follow soon. BTW, 'First Penguin' just bowled us out!!!

Thank you Dr.Randy Pausch for everything! And for 'Alice' the 3D programming language!

Someday, we wish to visit CMU, walk on the Randy Pausch bridge and scale the brick walls!!!

More about Dr.Randy Pausch: http://en.wikipedia.org/wiki/Randy_Pausch
The Last Lecture: http://www.youtube.com/watch?v=ji5_MqicxSo
Lecture on Time Management: http://video.google.com/videoplay?docid=-5784740380335567758


Monday, March 16, 2009

Leapfrog - Tag

Imagine this:

You have a pen in your hand, which when touched on a specific word reads the word out for you. Touch it on a picture, it says something about the picture. Touch it on some predefined images and it asks you questions for which you could answer by touching your pen on some figure.

And now imagine what ease of learning would it bring to your kid. Imagine its ability to ease up pronounciation and spelling to the kid.

Now, that's exactly what this 'toy' from LeapFrog is all about. Do check this link:


To get into the technicalities a little, the pen consists of a infrared image sensor that is used to identify the words. The books are special - they are printed with a special technology that will enable the infrared sensor to recognize the words by checking 'em against a dictionary of words and generate appropriate sounds by mapping them to a dictionary of sounds. These dictionaries need to be uploaded to the pen through a USB connection to a PC. The pen uses AAA batteries for its power. The books can be purchased separately - that's how Leapfrog makes money.

Got to experience it firsthand when Keya, my neighbor's kid, brought it home to show me her new toy that her uncle gifter her. And must admit, was totally fascinated. 

Obviously, its on my shopping cart. Just waiting for some friend to tell me that he is returning from US.

Me.

Monday, March 9, 2009

Touchbook - Netbook based on ARM

Came across this 'Touchbook' - a netbook based on ARM platform - recently.

So what, you might ask? Well, one - its OpenSource - based on OpenHardware and ofcourse, Opensource software. Hardware - specifically, the Beagleboard and software - Angstrom distro. More on this here.

The Touchbook has a plethora of features:

Dimensions: 9.4" X 7" X 1.4"
Weight: 2 lbs with keyboard
Storage: 8GB micro SD Card
Display: 1024 X 600; 8.9" Touchscreen
3D Accelerometer
Wifi 802.11 b/g/n
10 to 15 hrs of battery life
speakers, microphone and headphone slots
6 USB slots
Formfactor capable of using the device in multiple ways: as a laptop, handheld gaming device, video player etc.
Two modes of operation - one that uses keyboard and the other that uses the touchscreen.

More about the features - here.

In Me's opinion - this is one helluva device. Needless to say, one that Me'll target to buy in the recent future.

--
Me.

Thursday, February 26, 2009

My first deb

Yes, am done with my first deb creation! All it took was a simple control file to be under the directory containing all your files needed for installation and a simple command: dpkg -b . first_all_0.1.deb.

Somehow, first_all_0.1.deb comes up as a hidden file. Need to read more.
But, am feeling good.

p.s: first_all_0.1.deb is not the actual name of the deb I made ;-)

Friday, February 13, 2009

14 Mokos at once!!!


Pictured at Karlsruhe openmoko meeting by Joachim Breitner http://www.joachim-breitner.de/blog/ :)

Monday, February 2, 2009

Tag Cloud

One thing that Me found very useful with blogs, e-mails etc., was tags and tag clouds. Irrespective of the volume of the blogs/ e-mails, tags provide a easy way of categorizing and accessing data.

A tagcloud, elaborated more in this article on Wikipedia, is a cloud full of words, the font size of each word and/ or color indicating how importance of the tag. Each tag, typically is a hyperlink that lists out all the items with that tag on them.

Now, Me really wished google provided a gadget for generating tag clouds on blogs hosted on www.blogger.com. Nevertheless, Me found this link, containing good instructions about how to create tag clouds on blogger hosted blogs. 

Me liked his implementations so much, Me had to leave a note on this site, to give him his due credit, hence this blog post.

Further reading:
Developing a tag cloud using PHP: http://www.lotsofcode.com/php/tag-cloud-v2.htm

--Me.

Sunday, February 1, 2009

wget -P /path/to/alternate/dir something.ogg

I found out that one could use the -P option to download to an alternate location in wget. That's really neat. There's a python script sitting in the /srv/www/cgi-bin folder which downloads to a share in the openfiler here.

In the open source, we begin by putting all the blocks together! Think of something and its probably already there in the open source!

Thursday, January 29, 2009

web programming in python

A while back, Prasad and I managed to do some web programming in Python using the tutorial: http://webpython.codepoint.net/. We dived directly into mod_python and hacked up a python script that took a link it and downloaded it to the home folder. We used wget -c to do that.

When we wanted to download torrents, we came across aria2c that could handle all kinds of downloads. We tried putting it in place of wget, but somehow, it did not work. It is been quite a while since we got back onto that.

From 2 days, I have been trying to get the openfiler to give me the same functionality, but could not succeed using mod_python (though I downloaded it from the openfiler conary repository; Apache complains of a version mismatch). So, I went the CGI way and got some basic scripts working.

Have multiple ways to do web programming is a big boon! What next?

Tuesday, January 20, 2009

WebDAV in openfiler


I could get the WebDAV working on openfiler to view the share thanks to Nautilus, the gnome file manager.
Here's how it looks:

To access a WebDAV share from Nautilus, goto File, Connect to server, choose WebDAV in the combo box on the top and enter your settings like:

openfiler configuration from forums.openfiler.com

I found this pretty useful to configure the openfiler: https://forums.openfiler.com/viewtopic.php?id=2491

Monday, January 19, 2009

NFS up and running on Openfiler.

today morning, I was able to setup a client on my laptop running ubuntu to connect to the NFS server running on the Openfiler.

A while back, I had created a share on the Openfiler from the shares tab. I had to give access to the share using the network configuration. I tried giving 192.158.0.* so that all machines on my network could access the share, but don't know why it did not work. So, I created a specific entry with my laptop's ip address, gave it rw access for NFS.

Then, I used the configuration specified on the ubuntu forums for NFS and could copy a big video into the share after i 'mount'ed the share on my laptop.

I seem to have a problem on my laptop with the version of libc it is running, so, I had to manually pick up the nfs-common and the related debs and install them via dpkg.

So, this looks good so far.

Sunday, January 18, 2009

OMAP - in brief

OMAP and DaVinci Software For Dummies - THE book for beginners:

omap_dummies_cover

Since a couple of weeks (or probably more), www.beagleboard.org has had a mention about a book called "OMAP and DaVinci Software For  Dummies". The companion website was pretty impressive too. Especially since Me was an absolute novice when it came to OMAP or any of TI's products, excepting the recent experiences with Beagle. Proceeded to order it thru myTI, expecting that it might cost me, that too in dollars. Was pleasantly surprised to see that the order went through without a mention of any charge at all.

A couple of weeks later, this nice little book dropped into my mail box. About 106 pages in all, it was written for absolute novices - who knew nothing about OMAP or DaVinci. And that, precisely, is what Me needed at this juncture.

The reading experience was a cruise. Took about a couple of hours of my train journey from Bangalore to Hyderabad. Apart from covering all major aspects of OMAP and DaVinci, this book also featured a good set of cartoons at few places - my fav one being "The 5th Wave" by Rich Tennant - "Oh come on... how fatal can it be?". Here's a copy of the cartoon - all credits to Rich Tennant. The authors - Steve Blonstein and Alan Campbell - did a pretty good job at striking a right balance between keeping the language simple and yet driving home the point about how sophisticated this stuff is. Worthy of mention are the icons that draw the attention of reader to some specific tit bits of information. There are a lot of TLA's dispersed around in the book - but are just right in volume - atleast Me didn't get driven away mad. ;-)

The book has three parts:

The first part starts with a good discussion about how multi-core architectures have come to be of such prominence in today's world, introduces the OMAP and DaVinci platforms, discusses the operating systems and kernels available, the various standards that TI had come up with to make the lives of developers easy and the software frameworks in place for these platforms.

The second part walks the reader through a hands-on. If followed through, the reader can end up with software that utilizes the video and audio parts of OMAP processor.

The last part - gather that this is a standard feature of all For Dummies books - gives very useful information - TI's recommendations for Codecs and pointers to resources that will help developers.

OMAP and DaVinci Platforms:

OMAP and DaVinci SOCs are hybrid in nature - they typically contain a GPP (General Purpose Processor) and a DSP (Digital Signal Processor). The task scheduler for the DSP is a lightweight scheduler called DSP/ BIOS. The For the GPP the SOC leverages the wonderful world of Linux (other operating systems can also be ported though.)

DSP/BIOS - there is apparently a perennial discussion about if this is actually an operating system or if it is a scheduling kernel - is ideal for the real time DSP task scheduling due to its key attributes - high scalability, high speed and low latency. The book prescribes Linux - community based or the commercial ones - as the right platform that can leverage the GPP in these SOCs to the best possible extent.

TI seems to have done tremendous work in the world of Codecs and addressed a lot of problems related to inter-operability, packaging and deploying quite efficiently. XDAIS, XDM, RTSC etc., seem to give a system integrator the freedom to try various Codecs and the scalability to switch between platforms easily.

TI apparently also has a whole lot of supporting software for these platforms - various VISA codecs, DVSDKs, Code Composer Studio, QualiTI, packaging tools - that make the lives of a system integrator far easier that what it was before. The best part, most of these software are available free for the community. The platform specific packages, Me gathers, leverage the potential of open source communities to a good extent.

All in all, a wonderful book for beginners. A perfect ten on ten for the way the material is presented - simple and interesting. Gave me a good list of things to try on Beagle. A must for everyone starting off on OMAP or DaVinci platforms.

Me's never bothered to check, so far, what TI has been upto with its products, in detail. The more Me learns about their products and their passion towards keeping things open - Me's becoming quite a fan of TI.

Me.

Further reading:

Dummies Book online: www.ti.com/dummiesbook

Friday, January 16, 2009

Openfiler...got it installing!

Yes, the first time I thought I am expert and went right ahead, but I missed the instructions in the installation guide. Radha pointed out to me what the problem could be, so, I tried the install a second time with free space left out after /boot, / and swap. It installed neat and I could create a share out of the free space :-)

So, I have a 100MB for /boot, 10GB for / and 4GB for swap and the rest of 198GB is being used as share. I need to see how to setup NFS/Samba/LDAP/FTP now. This is perhaps the time for me to lookup the v1.1 manual though dated but surely of some help (http://wwwold.openfiler.com/docs/manual/).

So, onto the configurations! I have added a group and a user for a start.
-raghav

Thursday, January 15, 2009

Synergy works!

Me had worked around the problems Me was facing with getting the keyboard to work.

  • Me could log into angstrom from the serial connection. Realized that this would be just another login session as far as Angstrom was concerned.
  • Ethernet was working without any problem, so could run opkg install commands.
  • Installed Synergy and started it as a client.
  • Configured Synergy on my PC as a server.

 

Voila! Now, Me can use my keyboard and mouse connected to my PC to work with beagle!

The first thing Me did was to enable autologin in Angstrom, and add the synergy client to startup.

Alleviates some pain till Me gets a USB keyboard to check with the USB hub and beagle.

-Me.

Keyboard problems!

Once Me got my USB A to Mini-AB cable done, my next task was to get a minimal set of peripherals working with the Angstrom demo distribution.

So, this is what my setup looked like.

USB-A to mini-AB connected to a female-USB to female-USB adapter, which was connected to a self powered USB 2.0 hub. Connected to the hub were a USB to ethernet adapter and a USB to PS2 adapter, to which a PS2 keyboard and mouse were connected.

When angstrom booted in, Me couldn't log in - neither the keyboard and mouse were working. Had to go about the elimination way to figure out what was happening.

When Me had only a USB mouse connected to the hub, Angstrom booted with mouse enabled and Me could log in. Connected the USB to ethernet adapter and was glad to see the ethernet work too.

However, the moment Me connected the USB to PS2 adapter, the USB to ethernet was disabled, and neither did the mouse work. Noticed a bunch of statements on the serial port - which indicated that the corresponding USB ports were disabled.

Looks like the USB to PS2 adapter is the culprit. Can't exactly figure out what was happening, but Me thinks its drawing too much power off the hub due to which the hub was disabling the other ports. Or its probably that the hub itself was faulty. What perplexes me is that the USB to PS2 adapter to keyboard-and-mouse works fine on my Windows laptop without these problems.

Can't quite explain or pin down the problem to a particular component. However, the next immediate steps would be to:

  1. Check if a USB keyboard works fine along with the mouse and USB to Ethernet connected to the hub.
  2. If that doesn't work, then check with a different USB hub.

 

-Me.

USB-OTG - A brief

Dealing with the USB OTG on Beagle has been quite a learning experience, especially, since my knowledge of USB was very minimal. This is Me's attempt at providing a brief about USB OTG.

USB was first introduced to address desktop's connectivity with various peripherals - printer, mouse, keyboard, serial, parallel, PS2 etc. It was quite successful - so much so that almost all peripherals and devices that need PC connectivity these days use USB.

USB has further been extended to other devices, mobile phones in particular and the functionality has been extended from mere PC connectivity to include charging, transferring video etc.

The USB master/ slave architecture that USB generally used - where a host acts as a protocol master and a USB device (peripherals) act as the slave - were sufficient to address most usage scenarios. The host always initiated the configuration/ data transfer from the peripherals in these cases.

Specifically, a usage model started emerging - the one where a device needed to either act as a host or a peripheral based on the situation. A typical example would be when two mobile phones could be connected for data transfer - where one would act as a device and the other as a peripheral. The same mobile also needed to act as a peripheral when connected to a PC. A need to have one connector on the mobile for all purposes - charging, to connect audio headsets, for data transfer - also played an important role in the introduction of USB OTG during late 2005 - early 2006 timeframe. The miniature nature of these devices also resulted in mini USB connectors to suit their form factors.

USB On The Go - USB OTG in short - introduced  two new protocols: SRP - Session Request Protocol and HNP - Host Negotiation Protocol.

SRP allows both communicating devices to control when the link's power session is active. This was not available in the standard USB spec - only the host was capable of doing so. This fine control over the power consumption resulted in significant power savings in battery operated devices like cameras and mobile phones.

HNP allows the two devices to exchange their Host/Device roles, provided both are OTG dual-role devices.

USB OTG protocols cannot pass through a standard USB hub - since they are based on physical electrical signalling.

USB OTG defines two roles of devices: OTG A-device and OTG B-device. The terminology defines which side supplies power to the link, and which is initially the host.

OTG A-device is a power supplier, and an OTG B-device is a power consumer. The default link configuration is that A-device acts as a USB host and B-device is a USB device. The modes may be exchanged later by using HNP.

USB OTG standard introduces a new plug receptacle called mini-AB. It can accept either a mini-A connector or a mini-B connector. USB OTG also adds a fifth pin to the standard USB connector called the ID-pin.

The mini-A connector has the ID pin grounded (connected to GND), while the ID in the mini-B connector is floating (non-grounded).

A device that has a mini-A plugged in becomes an OTG A-device and the one that has mini-B plugged in becomes a OTG B-device. The type of the plug inserted is detected by the state of the ID pin.

Beagle Context:

Beagle has a mini-AB connector and has both modes of operation. When connected to a PC it is a peripheral and when it is connected to other devices like a USB hub, keyboard, mouse, USB Ethernet etc, it playes the role of a host. When Beagle is required to play the role of a host, the cable that is required would need to be in the OTG-A mode.

In the market, almost all USB cables with a mini-AB connector are of OTG-B configuration. Me had scourged the local markets in Bangalore and Hyderabad, and couldn't find a cable that was made in a mini-A configuration. What makes matters worse that none of these cables had any indication about whether the cable has OTG-A or OTG-B configurations. The shopkeepers would hardly understand OTG, complicating things a little further.

2009-01-10-32267

So, to get USB on my Beagle working, Me had to choose between meddling with the board and modifying a cable. For obvious reasons, Me choose to modify the cable. Lucky for me the connector opened up pretty easily. But unfortunately, unlike the other pins, the ID pin was trimmed off making it very challenging to connect it to the GND pin.

After a whole lot of struggle, ended up with a connection as shown in the picture here. Had to take a small strand from a USB cable that Me had opened up earlier, use the solder to firm it up, and then put up a struggle to connect it between the ID and GND pins, making sure that it didn't touch any of the other pins.

Me's opinion - USB standard or atleast the cable manufacturers should come up with a standard way of indicating the OTG configuration that the USB A to mini-AB cables are made of. If not anything, that'd save some time and effort for folks who scourge the markets for specific cables.

-Me.

Further reading:

USB OTG on Wikipedia: http://en.wikipedia.org/wiki/USB_On-The-Go

USB OTG on the USB.org website: http://www.usb.org/developers/onthego

Maxim's app note on USB On-The-Go Basics: http://www.maxim-ic.com/appnotes.cfm/an_pk/1822

Sunday, January 11, 2009

Openfiler...NAS in Linux

We were looking for a NAS in Linux and we came across Openfiler. Looks quite interesting. I have it installed on a system here at home. I was looking to administer it and ended up with my first ever chat on IRC. #openfiler on irc.freenode.net.

Here's the chat script:
(07:41:26 IST) The topic for #openfiler is: ..::openfiler::.. - A place to talk about openfiler and SAN, please use a pastebin instead of flooding http://openfiler.com - Non openfiler? #san
(07:48:39 IST) raghav_n1: hi folks. i have just installed openfiler and was looking for some documents to manage/administer the system. but, i am unable to find them on http://www.openfiler.com/learn. is there some other place i need to look?
(07:49:30 IST) rafiu: raghav_n1: forums is a very good place to start
(07:49:34 IST) rafiu: https://forums.openfiler.com
(07:50:42 IST) raghav_n1: thank you! i am looking at the forums now.
(07:54:13 IST) Stanlin: raghav_n1: it is going to crash
(07:54:41 IST) rafiu: Stanlin: what's up with you?
(07:55:45 IST) raghav_n1: Stanlin: sorry, i did not understand what you meant
(08:01:53 IST) Stanlin: raghav_n1: OF is amazing.. keep using
(08:03:16 IST) Stanlin: rafiu: joking man
(08:06:46 IST) raghav_n1: Stanlin: i am beginning to get a feel of OF. looking into the forums to get my OF up and running. OF looks good to me!
(08:07:11 IST) Stanlin: raghav_n1: its so easy, boot it, open the web interface, click here there... voila
(08:10:10 IST) raghav_n1: Stanlin: i am sure it is. just that i need to get used to it a bit.
(08:15:24 IST) Stanlin: well depends on your experience, was like 5 mins for me

Got to get this working!
-raghav