Wednesday 24 March 2010

What's clogging up the root file system

The file system layout of the N900 is arguably not the easiest when it comes to maintenance: The root directory / and a whole bunch of important directories (e.g., /usr/bin/ and /usr/lib/) are stored together on a fast flash memory chip which is, unfortunately, rather tiny with its 256 MByte capacity. When you add and add new software, especially from the extras-devel repository, it may easily happen that you don't have any free space left on that device.

While there are various ways how to free up disk space by moving the disk hogs, you may ask yourself what these may actually be. Here's how I do that:


  1. Install the packages rootsh, findutils-gnu and coreutils-gnu, if you haven't done yet.
  2. Open a root shell.
  3. mkdir /home/user/MyDocs/tmp
  4. gfind / -type f -fstype rootfs -printf "%T+ %k %s %h/%f %n\n" | perl -ne 's/\.0000000000//; print;' > /home/user/MyDocs/tmp/files-on-rootfs.txt
    This command will take about a minute or so.
  5. Now you have a file of all files occupying precious space on the root file system (actually, some more, since /proc will also appear in there), but without any symlinks or files in symlinked directories. The file list will look like this:
    2009-04-15+12:14:52 600 612764 /bin/bash 1
    2010-02-11+00:52:24 124 125124 /bin/less 1
    2009-07-01+12:16:27 4 1167 /bin/tempfile 1
    2009-08-24+14:20:35 4 4012 /bin/lsmod 1
    2009-04-02+10:54:09 8 5364 /bin/devlocktool 1
    2010-02-11+00:52:24 12 10500 /bin/lesskey 1
    2010-02-11+00:52:24 8 5188 /bin/lessecho 1
    2010-02-11+00:52:23 8 6947 /bin/lesspipe 1
    2009-07-01+12:16:28 348 355592 /bin/busybox 1
    2009-02-26+08:24:27 4 45 /etc/hildon-welcome.d/default.conf 1
    More precisely, the format is like this:
    • Timestamp (which is sortable with alphanumeric or numeric sort due to the clever GNU date format),
    • then the number of blocks,
    • then the file size (somewhat redundant, but perhaps there are sparse files),
    • then the file name,
    • then the number of hardlinks (usually 1).
  6. Now you could simply load that file into your PC via USB or scp and analyse it there with external tools such as OpenOffice Calc, Excel, or the likes.
    Or you can analyse it right away on the N900:
  7. Most certainly, you don't want to go over all these entries by hand. Let's sort the file list by the file sizes:
    gsort -k 2 -n /home/user/MyDocs/tmp/files-on-rootfs.txt
    The largest files will be conveniently placed by hand. Now this gives you a good opportunity for finding candidates to be moved to /opt/ and symlinked from there.
  8. If you are interested what files were recently modified (probably the culprit that filled up / is a rather new file), then you can simply do
    gsort /home/user/MyDocs/tmp/files-on-rootfs.txt
    to sort by time stamp.
  9. Probably there's a lot of small files involved, so you may want to filter them out:
    awk '($3 > 500000){print}' /opt/tmp/files-on-rootfs | gsort
    This will only print files that occupy more than 500,000 Bytes and sort them by modification time.

By now you should have found out candidate files for "optifying", as it is usually called.

Monday 22 March 2010

Resolving problems with mass storage mode

When you connect the N900 to a PC in USB mass storage mode (USB MSC, UMS), it may happen that it will complain and tell you that it will let access the PC only the SDHC card (i.e., /media/mmc1), but not the N900's main memory (i.e., /home/user/MyDocs/). This can really get on your nerves, e.g., if you want to install Nokia Maps for offline use onto the N900.

Explanation (?)

The purported reason is that the system will not allow external accesses to that file system, as long as any process running on the N900 still uses that file system (e.g., by keeping a file handle open, or by having cd'ed into there). However, I found out that this is not quite true: When I ran lsof | grep /home/user/MyDocs as root, not a single process was shown, yet the PC was still denied access to the flash memory, so this cannot be the full story.

Simple yet unelegant solution

After doing some Googling (which was not enough) and doing some additional experimentation, I found the following unelegant but working solution:

  1. Unplug the N900 from your PC. Switch the N900 to offline mode (short press on power button, then select from pop-up menu). Reconnect with PC. Sometimes this already does the trick.
  2. If, however, the N900 still won't let you access the flash memory, then keep the N900 plugged into the PC and reboot the N900 (i.e., switch off and switch on again). When it asks you if you want to disable offline mode now, answer no (i.e., continue using the N900 in offline mode). Then you should finally be able to access the phone's flash memory from your PC. So far, this blunt approach has worked for me.

Friday 19 March 2010

Switching between cyrillic and latin keyboard layouts

Most of the time, I'm writing in German on my N900; but from time to time, I write English — e.g., right now — and Bulgarian, which is written in cyrillic letters. While it's not a big deal writing in English on a German QWERTZ keyboard, I needed some possibility to quickly switch between QWERTZ and ЙЦУКЕ (for some funny reason, I've always written Bulgarian texts with a Russian key layout — which comes in handy now that the N900 doesn't offer Bulgarian; although I'm sure it can't be a big deal to install the Bulgarian layout, I saw software packages for that). At the same time, I want the automatic word completion to work for German and English, but not Russian, since I never type anything Russian.

And here's how I do that:

  • Open the settings, tap on the Keyboard settings (Texteingabe).
  • Hardware layout: German
  • Use virtual keyboard: yes
  • 1st language: German, dictionary: German
  • 2nd language: Russian, dictionary English (!)
  • Use dictionaries in parallel: yes

I normally use the hardware keyboard. When I need to type something in Bulgarian, I simply close the lid, tap into the text area on screen so that the virtual keyboard pops up, and then have a Russian virtual keyboard. If not, I have to change it by tapping on the “” button that is located left to the Return button on the virtual keyboard (3rd from right in the button row right underneath the text display). Admittedly, this way I only get the cyrillic characters via the software keyboard, but then, I still do a lot of mistakes when typing on the Russian keyboard without seeing the layout.

Thursday 18 March 2010

Why to buy an N900

Alright, in my recent post, I described the numerous little flaws of the N900.
While the N900's set of features is huge and beyond description, in this post I will describe some of the really cool and (at the time of this posting) unique features that set the N900 apart from other mobile phones.

General aspects

  • A lot of free software, and you'll get automatic updates for all of it without any further ado — that's just one of the many advantages of having a phone with a real Linux distribution.
  • 30 Gigabytes of storage for your data (the remaining part of the flash memory is reserved for programs, operating system stuff, etc.), plus an SDHC slot (i.e., additionally up to 16 Gigabytes [1]; perhaps 32 GBytes or even more in the future [2] if the built-in card reader supports it)
  • Finally: A phone with a dedicated switch just for locking and unlocking the keyboard — and its positioning makes it almost impossible that it gets pressed inadvertently.

One great address book

  • The N900 automatically maps birthdays from its addressbook entries into the built-in calendar. Finally a phone which can do that — after all, implementing this feature shouldn't have been rocket science, but I don't know if any other phone is capable of that.
  • Better yet: A program called 'Hermes' merges contact information and birthdays from your Facebook contacts into the N900's address book.
  • Moreover, the address book features a very handy functionality: you can join multiple entries for a person into one with a mere click. Very easy, very quick; duplicate entries be gone.

Fully integrated, multi-multi-multi-protocol instant messenger

  • To my knowledge, the N900 features the only instant messenger client — not just for mobile phones, but for computers in general! — that speaks virtually all IM protocols:
    • Skype
    • ICQ and AIM (AOL instant messenger)
    • Jabber/XMPP
    • Google Talk (basically the same as XMPP)
    • Nokia Ovi (XMPP as well, IIRC)
    • Facebook chat
    • ICQ
    • MSN messenger and MSN Haze
    • good old IRC
    • GroupWise
    • Gadu Gadu
    • Tencent QQ (OICQ)
    • SIP (which also can be used for instant messaging, although this feature is mostly unsupported by servers as well as clients)
    • Salut/Bonjour/Link-local XMPP
    • Sametime
    • Yahoo messenger
    (Note here that most other IM software also can speak most or all of these protocols with the exception of Skype; whereas Fring which is popular with Symbian phones and, btw., which is available for the N900 as well, does speak Skype but understands neither IRC nor (non-Google) Jabber/XMPP, nor Salut, nor most of other, less used IM protocols.)
    As usual, you have to install additional plugins to use most of these protocols; nevertheless, upon installation they will be tightly integrated into the phone's user interface, together with the other IM protocols, as well as GSM text messages (SMS). If you choose to have a mobile flatrate, a volume-based tariff, or if you're logged into a WLAN most of the time, then instant messaging can replace SMS almost entirely — in most countries, this will save a lot of money.
  • The contact lists/buddy lists of your various instant messengers all are mapped into the address book, where you can join them with existing entries. For example, if some person X is in your ICQ buddy list, your Jabber buddy list, your Skype buddy list, in your Facebook friend list (and uses Facebook chat), has two e-mail addresses and seven different phone numbers, then you can unify all these different entries into one single entry for that person X. To my surprise, this didn't even mess up the buddy lists of my IM programs on my PCs (Pidgin and Empathy).

Geek aspects

Imagine you have a mobile phone on which you can install...

  • a new firmware by logging in as root (which you can do without doing any unsupported, warranty-violating or otherwise unpleasant jailbreaking!) and typing apt-get dist-upgrade (alright, you might use the graphical program manager as well...)
  • an OpenSSH client with X11 forwarding (Eclipse looks funny on the N900), scp data back and forth, build ssh port forwarding tunnels
  • an OpenSSH server so you can log in to your mobile phone and use a large screen and a normal keyboard, scp data back and forth etc.
  • vim and an emacs clone
  • bash
  • svn, git, mercurial
  • wireshark, nmap, socat
  • Bittorrent
  • tor
  • truecrypt
  • latex (haven't tried it out yet)
  • gcc (haven't tried it out yet)
  • mplayer with kmplayer front-end
  • a complete chrooted Debian that can run Firefox/Iceweasel (slow) or even OpenOffice (slo-o-o-o-w-w-!)

Other connectivity

  • Can play audio and videos via UPnP (universal plug&play). I use that to play MP3s and OGGs that are stored on a USB drive that is connected to my FritzBox; unfortunately, the network is a bit too slow for video.
  • Provided that you install some additional software modules, you can mount CIFS (Samba) and NFS file systems,
  • do IPv6 (kernel from extras-testing needed for that).

Wednesday 17 March 2010

Why not to buy an N900

First of all I have to say that I definitely do recommend the N900, especially for Linux-affine geeks. Actually I wrote this post mostly from my N900 while sitting in an underground. No matter what I write here, I still have to assert that it's the best phone I'v ever laid my hands on, by an order of magnitude.
Nevertheless, it does have a number of flaws that are more or less minor ones for me, but which may be major to other people who consider buying one. Therefore, I wrote this post so that people who buy it won't be disappointed after they bought it.

Software / in general

  • A lot of features is missing from the start. Luckily, you can very easily resolve this by installing additional free software. For example, the built-in instant messenger initially doesn't support ICQ, or you can't change your call forwarding settings — you have to install additional plugins in order to do that.
    Note, however, that this is way less complicated than it may sound, since you get most of that software from a central repository, including future updates. Still, it costs time in the beginning.
  • Also note that, in contrast to almost all other mobile phones including the cheapest ones, you cannot run any Java applications (MIDP, midlets, J2ME) on the N900! This holds less for "serious" applications, but most mobile games out there on the market are Java games...
    Meanwhile, you can install support for J2SE, and by installing a package from extras-devel, you will be able to run J2ME applications. Still, this involves a lot of tweaking and fiddling and using software which is not really suited for end users.

Phone and connectivity

  • You can't have different ringtones for different callers or caller groups.
  • Creating additional profiles apart from the built-in default and silent profiles (that's just two measly profiles!) is cumbersome and — of course! :( — requires to install yet another tweak application.
  • It doesn't have voice dialling. If you want to use it in a car, be sure your handsfree itself has a voice-dialing facility built in (expensive ones nowadays do).
  • It doesn't have MMS support, and the free software for sending MMS that is around now is fiddly to configure and far from being flawless. (Before you cry out loud now: Sometimes, MMS may indeed come quite handy as a replacement for SMS — since one MMS without any picture but with a long text is cheaper than a long text spread out over three or more chained SMS text messages.)
  • No video telephony over 3G/UMTS networks. (But who uses that anyway, it's usually horribly expensive.)
  • No video telephony over Skype.
  • Video telephony over Google talk is quite flawed:
    • It's not possible to initiate a video call from the N900; the PC has to call the N900.
    • The picture received from the PC side is full of codec artefacts and thus actually completely useless; the picture sent from the N900 is alright but rather low-res.
  • Using the European Eduroam academic WLAN (a lot of European universities offer this to their students and employees; a fact widely unknown as yet) is , in most cases, not possible at this time, although some people have reported success on this. Will be fixed in a future software release. difficult to configure, since in some cases (where your institution requires TTLS/PAP authentication) you have to download and install a hard-to-find unofficial software package from the Maemo forum.

Calendar and to-do list

A lot of homework to do here for Nokia!

  • It's unintuitive to navigate from day's view back to weekly or monthly view.
  • Even harder to switch from todo list or notes back to calendar.
  • Categories (i.e., different calendars) for to-do entries, but no priorities!
  • No dateless to-do entries, they always need a deadline.
  • When you enter a date, it won't show you the day of week in the date chooser, so you have to count in your head ("today's the 12th, so the 22nd should be... errmm... a Monday?"). Moreover, you cannot enter dates or times via the hardware keyboard, which would be more convenient than picking them iPhone-like from a scrolling menu.
  • The alarm prior to an event can only be chosen from a few options: a couple of minutes, half an hour, one and three hours, and a day. I'd prefer two hours, two days, etc. Or even better: completely free choice, as it was the case with the Symbian calendar on my old E70.
  • When an alarm goes off, there is no easy way to select an arbitrary time and date for a second alarm (you have to display the appointment and then edit it), there's only the snooze button (i.e., fixed and small amount of time).
  • No biweekly recurrences for appointments configurable, or other special occurences (e.g., 1st monday in month or things like that).
  • You cannot add an exception to a repeating entry: If you modify one entry, it will modify all recurrences; if you delete one recurrence, it will delete all recurrences. Only solution: Let the recurrences end the day beforeyou need the exception, and create a new repeating entry on the first recurrence after your exception. This is, of course, worse than tedious, because:
  • You cannot duplicate an existing entry, so if you want to copy an entry (e.g., if a meeting is twice a week), you will have to re-enter everything by hand. Aaaargh!
  • Under some circumstances, the calendar returns to the current date, or the first date of a recurring event, when you don't expect it. This is confusing and annoying.
  • What really bugs me here is that
    • the backend actually supports most of this, only the GUI doesn't,
    • yet Nokia are too lazy to implement it,
    • and apparently the source code for the calendar is not freely available (please correct me if I'm wrong here), so that the community can't do Nokia's homework, either! :-(
  • No native SyncML support for synchronizing via a network! Helloooo!??
    (I haven't tried out the SyncEvolution application yet, though.)
  • Only very limited syncing with Google calendar, from what I read on the Internet.
    The software 'erminig' allows to do that quite well... but again, you need to install it.
  • The calendar desktop widget is not configurable. For example, I would wish that I could make it larger, and to have more to-do items listed, but no...
    Luckily, there now exists an unofficial alternative calendar widget which allows you to do that.

If you ever owned a Palm and have used Datebook3, 4 or 5, you know what really useful features a good day planner offers. Nokia's builtin calendar is leagues away from that master class. At least, it is possible to install the GPE calendar and GPE to-do list; however, that software does not access the built-in's calendar and todo lists but keeps its own — not good if you already have entered a lot of things into thoese.

Usability and hardware

  • The resistive touchscreen is nice, but it doesn't have multitouch, is not as easy to operate as the iPhone's, and kinetic scrolling, although programmed in, definitely works better on the iPhone. On the other hand, you can also operate with a stylus if you wish; I operate with my fingers as well as the stylus, depending on the situation.
  • When the device is connected either to a charger or to a PC (both via MicroUSB port on left hand side) or to a headphone (3.5mm jack on right hand side), it is difficult to hold in your hand and type. These two jacks should have been moved upwards.
  • Although the device has a very nice orientation sensor (there are even two apps so that you can use it as a spirit level), only very few applications support rotating the device — most will always operate in landscape mode. (Luckily, the actual phone application does allow to be operated in both modes, so at least you can place and receive phone calls single-handedly.)
    At least there is a shortcut that you can try to force an application to operate in portrait mode, but it doesn't work with all applications, and you need to open the hardware keyboard in order to do that (but when you open the hardware keyboard, you probably want landscape mode, not portrait, aargh!).
  • The graphical user interface is nice and easy to learn, yet I feel it's not the most intuitive one. Especially switching from an application to the built-in main menu vs. switching to the configurable desktop still confuses me. The window manager should support two or three buttons for changing the applications, instead of one.
  • In general, usability is alright but could be improved. For example, why can't I click on an address in the phone book so that Nokia maps would open? Speaking of which, I feel that the maps application is usable but not the best in usability. But it has improved a lot.
  • In order to exchange the SDHC card, you have to open the back lid and finger around with a very fiddly card holder. Moreover, the card should be exchanged when the device is powered off (although Linux nerds will know they can do umount if no process is accessing the card).
  • When you connect the device to a PC in mass storage mode, it often sometimes will complain that it will not let the PC access the phone's flash memory but only the SDHC card. The purported reason is that access will be denied as long as any process on the N900 accesses the builtin memory (i.e., /home/user/MyDocs/); however, it even does this when lsof doesn't display any processes keeping handles on that part of the directory tree. Ehh?
  • The built-in media player does not support Unicode/UTF8 ID3 tags; apparently, it only does ID3 in Latin-1 (ISO-8859-1). Hellooooo?!? We're in the year 2010, and Unicode is everywhere! What do I do now with my Bulgarian MP3 files with Cyrillic ID3 tags?

What's not true

The following widely circulated flaws have been fixed by Nokia in the meanwhile and thus do not hold any longer after a firmware/system update:

  • The phone won't eat its battery for breakfast. Well, if you really need to use WLAN videotelephony, Bluetooth headset, 3G-only with bad coverage, and GPS simultaneously and incessantly, the battery will at most last half a day. But then, no phone would last long with such a treatment. However, if you install some powersaving helpers (e.g., kernel from extras-testing, WLAN disabler applet, 3G/GSM switcher applet, Bluetooth switcher applet) and leave the phone alone overnight with disabled WLAN, in GSM-only mode, without any instant messenger connections, e-mail or weather updates, then it will lose less than 5% of its battery charge during these 8 hours (measured with ''battery-eye'').

Geek aspects

  • Although X11 forwarding over ssh does work, (a) the N900's applications will tell the window manager on your PC to have them rendered fullscreen (the address book looks funny in 1920*1080px) and (b) you won't see the application's menu, which renders X forwarding more or less unusable for most cases.
  • You either have to program in C/C++ (yuck) or in Python (yuck). There is no JVM on the N900, neiter Java ME nor Java SE. You can install one from Debian, but that must run in a chrooted environment. :-( There is a Perl 5.8 on the device; however, many modules are missing, and more importantly, there are no [usable] Perl bindings for Qt or GTK-Hildon for the N900. :-/
  • The file system layout is somewhat weird (e.g., / has only 256MB yet includes /usr), which makes porting software a bit more difficult than you'd think initially. Moreover, if you install software using apt-get install instead of the built-in application manager, then / will fill up quite quickly. So make sure you don't forget to run apt-get clean.

Specific issues with O2 Germany

As the following information only applies to German customers of O2, I will provide them in German.

  • Das N900 zeigt leider nicht an, ob man sich gerade in der O2-Homezone aufhält oder nicht. Wem das wichtig ist, der muss also diesen nervigen Tonindikator für die Homezone einschalten.
  • Auch nach mehreren Konfigurationsversuchen ist es mir nicht gelungen, über SyncEvolution via SyncML mit dem O2 Communication Center zu synchronisieren. Will man also Daten aus seinem alten Handy aufs neue übertragen, bleibt einem nichts anderes übrig, als dafür die Nokia PC-Suite zu verwenden.

If I have missed important aspects, I'll add them later. It thus may be that this text will slightly change.
Last update> 2010-06-09.

Wednesday 10 March 2010

Recovering the special characters view

There is a rather handy app called "Keyboard mod." that allows you to modify the key layout of the special characters view, i.e., the small virtual keyboard which pops up when you press the Ctrl and Symbol key.
Alas, you may end up with a layout that does not work — and this means that the special characters view simply won't pop up any longer when you press these buttons. This is exactly what has happened to me. Unfortunately, there is no backup of the original keyboard layouts. Here's a quick fix that worked for me:

  1. Install the package gainroot if you have not done so yet.

  2. Open an X term and type in the following commands:

  3. root (Obtain administrator rights. Alternative: sudo gainroot)

  4. cd /usr/share/scv_layouts (Go to the directory where the broken file is located.)

  5. ls -lt

  6. You now see a list of .vkb files. Most of these should carry the same time stamp (on my device, it's Dec 3rd, 2009), with the exception of the one that you fucked up. :-) The files are sorted by modification date, so the evildoer should be at the top of this list.

  7. If you're a lucky man, you can somewhere get hold of an original version of the .vkb file. Then you can simply download the file and overwrite the broken one.
    I, however, was not so lucky. Thus, as an ugly quick-fix, I simply copied one of the untouched files to the one that I messed up. In my special case, I thus replaced de.vkb by ch.vkb. But before you do that, you should do a backup of the broken and the other .vkb files:

  8. mkdir /home/user/MyDocs/vkb-files (You should not call this directory .vkb-files with a leading dot, since that has a somewhat special meaning in Unix systems.)

  9. mv de.vkb /home/user/MyDocs/vkb-files/de.vkb.broken (Create a backup of the broken file: The overwriting quick-hack will mean that you'll get a double entry for one language! Perhaps you can fix the broken one at a later point in time, using a new version of the app.)

  10. cp *.vkb /home/user/MyDocs/vkb-files/ (You now have a safe backup of the remaining and untouched files... who knows if you'll need that one day)
  11. cp ch.vkb de.vkb (Warning: you probably have to replace the de and ch, depending on your situation!)


That's everything.
I hope I'll find the original versions of the .vkb files. In that case, I'll offer them for download.