Tuesday, December 7, 2010

Document Scan and OCR - On a Phone!!!

Those who have come across my rants blog might have noticed that I like to snap amusing images and post those on my blog.  More often than not they end up looking something like this:


I just came across an application called "frontview" and the idea is that it can "unskew" pictures and basically make the camera work more like a scanner.  To test this out I snapped a picture of a book page from my Kindle:


After I snapped the picture, I started up frontview and selected the picture.  Frontview immediately detected the part of the picture like this:


Click scan and then rotating the result and it looked like this:


Here's the resulting image:


That is not too bad actually.  The final experiment was to see what Google OCR could get out of that.  A while back I created a pixelpipe service that upload to Google, so uploading the image from the phone was a "two click" process:


And:


My first attempt failed miserably.  Apparently Google did not appreciate the black border that was left in the image.  As a test I tried to remove the "border" so the image looked like this:


It is the same image as before - just cropped a bit.  This time the result was far more convincing.



That is pretty awesome really.  As far as I can see it made one mistake only.

Friday, October 29, 2010

PR 1.3

In the Maemo forum there seems to be a lot of bitching about the new PR 1.3 release.  I am not quite sure why because to me it works great.  The changes are subtle and only bug fixing as far as I can see but the effects in a few areas are dramatic.

First of all email.  The email application has for me been absolutely useless ever since I got my N900, but with PR 1.3 it has gone from useless to actually working pretty well.  Before when I started up email it would present me with a list of accounts.  I only got one (Nokia Messaging) so tapping that - and waiting about 10-15 seconds until a list of Nokia Messaging email accounts would show.  Select account and another 10-15 seconds.  Select inbox and another....  All in all - before I could read an email it would take well over 30 seconds - each time.  Now it's instant - so I actually do check my emails again :)

Second the browser.  It just works much much faster than before.

I haven't noticed any change in battery usage.  It is still for me acceptable as long as I am on Wifi OR GPRS and it still suck badly when on 3G.

Wednesday, February 17, 2010

Battery Life

The battery life of my N900 is actually pretty good:



The above graph show a day where my N900 has been online on Wifi all the time (I have configured automatically connect to any connection and switch to Wifi if available) and online on SIP, MSN, Yahoo, 3 Jabber Accounts during the hours I was awake.  As can be seen it should run just about 24 hours online.

Hiding your porn

I remember a while back there was some questions on the Maemo mailing list on how to "hide" certain images or videos from showing up in the media player or image library. Good news is that it would appear there is a bug feature in the media scanner making this possible.

I used rsync to copy my own image library to my N900. I created a directory on the memory card called images/ and the whole directory structure was copied into this directory. This resulted in a reasonably deep directory tree with directories like:

./images/Malaysia/Xmas2006

Images in the above Malaysia directory show up, while images in Xmas2006 does not. Same goes for videos. It's still possible to browse the images using a customised folder.

A bug? Yeah I reckon, but one which could have some fortunate side effects.


I now think I got the original post completely wrong.  It's not the directory depth that matters but naming.  It would appear that the tracker avoid directories named "Private".  It is however not immediately obvious why this is the case since there is no mention of this in the configuration file.  So

./images/Malaysia/Xmas2006

does indeed show up, whereas:

./images/Private/Xmas2006

does not.

There you go - still possible to "hide" private pictures from accidental view.

Monday, February 15, 2010

No Sense of Direction

Well - for a short while there I was under the impression that Nokia was getting serious about Maemo and then they just announced some kind of merge with another Intel project:

http://news.bbc.co.uk/2/hi/technology/8516368.stm

When is Nokia going to realise that it is not about their bloody platform it is about applications and who the fuck is going to develop anything for Maemo now.  The way I see this Nokia effectively "flip the bird" to all early adopters and developers for the Maemo platform.

I browsed around at some blogs and saw lots of attempts to soften the blow: "Maemo6 is just the first instance of the new MeeGo platform".  BS!  It's an entirely different beast based on an entirely different platform.  It might use the same api's but the underlying OS is quite different (rpm/deb for one).

This is a bad idea and I for one will take another look at Android - at least Google seems to have a firm sense of which direction they are heading.

Friday, February 12, 2010

New version of ipcheck

I just uploaded a new version of ipcheck. This one no longer use external check to get ip address but check the actual interface address. Whether that's better or not I'm not too sure but for me personally it works better.

Wednesday, February 3, 2010

Free up space on rootfs

After enabling testing and dev I was running a bit low on free space on the root file system.  I started digging around and most is in /usr/bin and /usr/lib - but there was in fact about 30-40 MB of apt/dpkg related stuff in /var.  This part was quite easy to free with a few commands:

# mkdir -p /home/var/lib
# mv /var/lib/apt /home/var/lib && ln -s /home/var/lib/apt /var/lib
# mv /var/lib/dpkg /home/var/lib && ln -s /home/var/lib/dpkg /var/lib
# mkdir /home/var/cache
# mv /var/cache/apt /home/var/cache && ln -s /home/var/cache/apt /var/cache

That's about it - 30-40 MB freed on the root.

Tuesday, January 26, 2010

New Site

Years back I bought the domain my-handphone.com. I never really got anything put on to that site, but now I finally managed to put some pages up regarding the N900. Check: here.

Sunday, January 24, 2010

N900

I finally managed to get hold of a Nokia N900 a device I have wanted to get since it was announced some 6-7 month back (released in November 2009 or so).

Why?


First of all - why did I want this one. I have generally not liked Nokia's devices for the past decade or so, but most of my problems have been with Nokia's attempts to make Symbian do stuff it was never meant to do. Symbian is a dog - fine for small devices but not good enough for anything approaching a "Smart Phone". While Nokia is still cautious to call the N900 a phone it is nevertheless the first Nokia device with phone capabilities that run Maemo instead of Symbian.

Why is Maemo interesting. Well - obviously because Maemo is not only based on Linux - but in fact based on Debian - which is my favorite Linux distribution. Yes there has been phones before that ran Linux, but those could roughly be categorized into two groups: 1. Not ready (there was a few attempt at development handsets - forgot the names) or 2. Just a Linux kernel with one fat proprietary application on top of it. Maemo is the first production handset that actually run a true UNIX operating system and on top of that it uses Debian's excellent package handling system (dpkg/apt).

It even comes with a xterm:




Granted, that will only attract the most nerdy of us, but then again - I must be a nerd.

Expectations


Before venturing into what the device actually is - let me clarify my expectations. My previous phone was a Nokia 5800 Xpress Music - which I have owned since that was a brand new buggy device - and I definitely did not expect the N900 to be perfect in any way. I expected the hardware part to be pretty Nokia standard - that means not sexy at all but rugged and capable. I definitely expected high end quality and performance from the hardware. As an internet device I also had high expectations but up front my expectations for this device as a phone was definitely that it would be fairly buggy and lagging in certain aspects. And since this was the first Maemo release - I was/am quite prepared to deal with a number of bugs and problems (come think of it - that's sad really - but that should be the topic of another article).

First Impressions


Hardware


First reaction - ouch - it's a bit too big. And it's HEAVY! In reality it's only about 6-8 mm wider than the 5800 and perhaps 3-4 mm thicker - but damn it does feel bulky. However - it's hard to imagine it being much smaller if the screen have to be readable and the keyboard usable, so after a while it sort of feels OK. After a few days it went from what I said before to - well - I would have liked it to be slightly thinner but the height and width is OK - pretty spot on in fact.  My eyesight definitely couldn't deal with a screen much smaller and my thumbs also require a keyboard of a certain size.

It should also be said that the initial reaction on the display can be summarized in one word: AMAZING! The keyboard a bit cramped but the keys are nice and I have no doubt I'll get used to it and be pretty quick on that keyboard.

Operating System


The basic operating system in the N900 is Maemo - and Maemo in turn is pretty much the first UNIX based operating system for a smartphone. Let me elaborate a bit on that. Yes, Android is based on a Linux kernel but everything "above" that is proprietary (mostly open source but still proprietary) so it does not have a traditional UNIX environment. Maemo is different - it is also based on a Linux kernel but it start up a traditional UNIX environment all the way up to a slim X server. Only the Window manager and applications are optimized especially for the small screen and finger pointing. That Window/GUI environment is called Hildon.

So how does it work. Well it is still young but in reality it works just fine. It's quick and it feels rock solid.

The greatest difference between Maemo and other smartphone operating systems is the "desktop":



This image show one of my four desktops with a few widgets added.  A RSS feed viewer, a load view, a dataplan monitor (monitors the traffic) and finally a small widget that show the current IP address.

Applications


The applications is where Maemo shows that it is young. Many of the applications - even the built-in ones still feel a bit unpolished and feels like they are still lacking features. But I have no doubt it will catch up very quick since most of these applications are open source.

Usage


Battery


Battery life is as far as I am concerned a major problem with portable devices. 10 years back in the dot-com haydays my mobile phone was glued to my ear and yet it would easily run a whole day - if not several days. But as displays got bigger, coloured and brighter and mobile phones changed from being a phone with a bit of messaging (SMS only) to full blown computers the battery life have suffered. My previous phone - the 5800 XM - wasn't all that bad. With my normal use it would run a few days, but two things would kill it: the Display and the Internet connection. Anything that caused the phone to be online or keep the display lit (like GPS turn-by-turn navigation) would suck the battery dry in 3 hours or so.

Nokia have marketed the N900 as a device that is meant to be online - more or less 24x7 (Online As it Happens - Nokia N900) but compared to my 5800 the Nokia got 4 times as many pixels, a much faster processor, faster Internet connection and more possibilities and guess what - it runs on exactly the same battery as the 5800. So, to be honest my expectations were not all that great.

So how is reality? Well - I still need a bit more time and experience with the device to make up my mind - but I would say at the moment it is so-so. Or put in another way - it's not brave new world as Nokia had promised but it is not as bad as I had feared.

Wish List

  1. Portrait mode
    This is in my opinion by far the most important. Not having portrait mode makes it almost impossible to use the phone in one hand.
  2. Auto Internet
    My 5800 connects to the Internet when needed and disconnect when it's done. That way it can run 2-3 days on a charge. Sure I would like to have the option of leaving it always on - but it should be a choice and I should not have to connect first before I can go online on chat.
  3. More Input Options
    This one is not overly relevant at the moment but once - if ever - the N900 get proper portrait mode an alphanumeric input mode ala 5800 will be appropriate and necessary.
  4. Navigation
    This one is a bit of a let down by Nokia actually. The N900 was advertised having Nokia Maps - so I think it's fair to assume it got the same features as the ones on cheaper phones.
  5. Email Client
    In short - the email client is rubbish. I got a massive IMAP repository but neatly sorted into folders none of which are subscribed - and it is slow and take ages. In short - in it's current form it's not really usable.

Conclusion

I have been using my N900 for about 2 weeks now and I'd say my conclusion based on the device as it is right now (meaning current software would be this). As a general communications and internet device it is unsurpassed. There is nothing out there that offer the possibilities that the N900 has got. As a phone however there are better and smaller options out there. As a phone even my 5800 beats it hands down. But because it's such a great hackers device it has got great potential and I have no doubt that within 6 month the software on N900 will beat everything.

Monday, January 18, 2010

Dynamic DNS Update on N900

I've created a maemo package to do Dynamic DNS updates each time the N900 connects to the Internet.

Install file here.

I am not sure if automatic install works yet - but do check it out (It does not work right now - need to change section from net to user/net - I will do that tonight).

It does however work by adding the repository and to and "apt-get install ipcheck".

Configuration needs to be created in a terminal (yes - I should do a gui config - but I can't be bothered - any volunteers?).

$ cat /etc/ipcheckrc >.ipcheckrc
$ vi .ipcheckrc

Fill in data for DYNDNS_HOSTNAME, DYNDNS_USER and DYNDNS_PASSWORD.

That's about it.

Sunday, January 17, 2010

Configuration files

I have been messing around on the filesystem of the N900 to figure out where Nokia store data for the various applications and it is not easy to figure out. However - I just found a very simple way:

Create a backup!

The backup is simply a few zip files that contains the configuration files - with full path ;) There you go.

Busybox 1.1.15 for N900

As mentioned in the earlier post I wanted to get some experience building packages for the N900 and since the busybox version in the device was rather old, I decided to give it a shot on the latest version.

I am pleased to announce that it went well. Was struggling for a while - specially checking all the patches that Nokia had made to the original, but I finally managed to make it and it's available in:

Catalog Name: Netcom Partner Maemo Unstable
Web Address: http://svn.netcompartner.com/svn/debian
Distribution: fremantle-unstable
Components: free

However - not all is well. It would appear that the package conflicts with

The following packages will be REMOVED:
mp-fremantle-002-pr
The following packages will be upgraded:
busybox busybox-symlinks-busybox busybox-symlinks-console-tools busybox-symlin
busybox-symlinks-net-tools busybox-symlinks-procps busybox-symlinks-psmisc bus
11 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Need to get 224kB of archives.
After this operation, 102kB disk space will be freed.
Do you want to continue [Y/n]? y

I think the mp-fremantle-002-pr package is used as a meta packaged controlling the dependencies during upgrade, so it would appear that Nokia is depending on the exact version of busybox. I don't get this. They choose to base Maemo on debian - a Linux distribution with a great package handling system - and they use a meta package to ensure that it becomes one big massive upgrade instead.

Anyway - I went ahead with the upgrade and so far I haven't noticed any problems. Everything is running as expected. Time to add some applications :) Which ones to enable?

Oh - and be warned - this is a test. If it bricks your device don't come crying to me :)

Saturday, January 16, 2010

Package Building

One thing that strike me as odd is that the Nokia maintainers have omitted the "ip" command from busybox. Since that showed up I have hardly used "ifconfig" and "route" - so it's pretty essential in my opinion. Anyway - that gives me an absolutely brilliant little project. Port the latest busybox to maemo, package it neatly and put it in a debian repository so that the phone will update automatically. Stay tuned :)

Right now I am at a point where I got the first compile - but still got some testing to do.

Monday, January 11, 2010

N900 Hack: Dynamic DNS Update

I just discovered that my 3G provider is actually issuing me a public IP address (the previous one I had gave me a private 10.something address). That is pretty cool since it means I can SSH into the device via the Internet and run all kinds of services on it - if I ever got that desire (yes yes I know it's pretty pointless but who cares).

The N900 got python installed already so I googled around a bit for a python script that could update dyndns service. I found one at: http://ipcheck.sourceforge.net/.

The download is a single file ipcheck.py so I created a directory /opt/ipcheck and copied the ipcheck.py into this directory.

Now I ran a check to see if it worked - something along the line of:

cd /opt/ipcheck
./ipcheck.py --makedat -l -r checkip.dyndns.org:8245 username password domain

Where:

username: my username on dyndns.org
password: my password at dyndns.org
domain: the hostname + domain I registered at dyndns.org

Now all that's left is to get this command run automatically each time the device connects. To do this I created a small shell script /etc/network/if-up.d/ipcheck like this:

#!/bin/sh
#
if [ ! -d /opt/ipcheck ]; then
exit 1
fi

cd /opt/ipcheck
./ipcheck.py -l -r checkip.dyndns.org:8245 username password hostname.getmyip.com
exit 0

That is about it. Now I don't have to check the external IP address of my device.

Check Battery

Detailed battery information can be found using the hal-device command in the terminal:

Nokia-N900-42-11:~# hal-device bme   
udi = '/org/freedesktop/Hal/devices/bme'
battery.charge_level.design = 8  (0x8)  (int)
battery.charge_level.current = 8  (0x8)  (int)
battery.charge_level.percentage = 96  (0x60)  (int)
battery.charge_level.last_full = 8  (0x8)  (int)
info.category = 'battery'  (string)
battery.rechargeable.is_charging = true  (bool)
battery.rechargeable.is_discharging = true  (bool)
battery.reporting.unit = 'mAh'  (string)
info.parent = '/org/freedesktop/Hal/devices/computer'  (string)
info.addons = { 'hald-addon-bme' } (string list)
battery.reporting.design = 1261  (0x4ed)  (int)
battery.reporting.last_full = 1221  (0x4c5)  (int)
battery.reporting.current = 1221  (0x4c5)  (int)
battery.voltage.unit = 'mV'  (string)
info.capabilities = { 'battery' } (string list)
battery.voltage.current = 4185  (0x1059)  (int)
battery.remaining_time.calculate_per_time = false  (bool)
info.subsystem = 'unknown'  (string)
info.product = 'Battery (BME-HAL)'  (string)
info.udi = '/org/freedesktop/Hal/devices/bme'  (string)
battery.voltage.design = 4200  (0x1068)  (int)
maemo.charger.type = 'wall charger'  (string)
maemo.charger.connection_status = 'connected'  (string)
maemo.rechargeable.charging_status = 'full'  (string)
battery.present = true  (bool)
battery.type = 'pda'  (string)
battery.is_rechargeable = true  (bool)
battery.remaining_time = 0  (0x0)  (int)
battery.charge_level.capacity_state = 'full'  (string)
battery.charge_level.unit = 'bars'  (string)



The most interesting value is probably the battery.charge_level.percentage - which in the above example show fully charged.

Using grep to quickly get the value that is interesting would go like this:

$ hal-device bme | grep percentage

While charging the battery.voltage.design and battery.voltage.current are also interesting since charging will be completed as they approach each other.