Thursday, 15 July 2010

Additional instant messaging profiles

Apart from the preconfigured IM profiles offline, busy and available, you can define six other profiles for the built-in instant messenger, where you can specify for which of the IM and SIP profiles you want to have which status. For example, for my workplace I have one profile where I am online only via my SIP accounts and Google Talk, but not via other IM.

Prior to firmware PR1.2, you could only have three such user-defined profiles; now it's six. For me, even six was not enough.

I suspected that the profiles are stored somewhere in /home/user, so I changed one of my IM profiles by selecting a different online status for one of my SIP accounts in that profile, saved the changes, and looked at which configuration files got changed (command: ls -lat /home/user). Et voilà: The profiles are stored in /home/user/.osso/.rtcom-presence-ui.cfg.

Simply editing that file with a text editor (as a Unix freak, I used vim) and adding another profile did, however, not do the trick. Rather, the IM application would ignore my changes and instead overwrite my modified file soon after.

But I found out that the following procedure worked for me. Since we live in a sometimes absurd world where people are drawn into court just because other people were too lazy to think, here comes the obligatory warning and disclaimer: You do all this at your own risk. I can neither guarantee that it works, nor do I guarantee that it does not break your phone. You have been warned. If it looks too difficult to you, ask a friend—with just a small bit of Linux/Unix commandline knowledge, it's really easy to do.

  1. Switch your IM availability to offline. Wait half a minute to make sure that you're really offline now.
  2. Edit the configuration file with the IM profiles (/home/user/.osso/.rtcom-presence-ui.cfg):
    1. Create a backup copy of the file in a place you remember. Just in case.
    2. Open the file with a text editor. I used vi, but if you installed PyGtkEditor, you can edit the file by invoking it from the command line: pygtkeditor /home/user/.osso/.rtcom-presence-ui.cfg (note that it won't let you open the file via the menu!).
    3. The syntax should be obvious: The definition of a profile starts with a line like [Profile blah], followed by many lines that describe the definition of that profile, and the definition ends where the next profile definition starts. Don't let yourself get fooled by some superfluous empty lines. Just copy one of the entries three times; for simplicity, I used the last entry for that.
    4. Give each of your three copied profiles a new, unique name. Obviously, the profile name is the text that follows "Profile " inside the brackets. Since you can change their names later anyway, you might as well pick something like "foo", "bar" and "quux". In any case, I would avoid any fancy characters such as ä, ö, ü, ß, é, ç, ś, ţ, ł, å, ъ etc., just in case.
    5. (Probably you now also could re-arrange your existing profiles now by moving them around in the text file, and you also might delete some superfluous empty lines, but I haven't tried that out either of these. So don't do it unless you're prepared to take this additional risk.)
    6. Save your modified file.
  3. Reboot your phone.
    (I'm pretty sure that it might as well be enough to kill and restart some process, but I didn't know which process to kill, and my phone needed a reboot anyway due to some apparent memory leak.)
  4. When you now open the IM application, you'll see that you have three profiles. Now you can change them via the menu just like the others, give them different names and icons, etc.

I imagine that you will be able to add many more profiles this way; however I recommend adding only three. Otherwise, you will have to scroll down to reach the text field where you can specify your status message and select if others should be able to see your GPS position.

Wednesday, 9 June 2010

Configuring Eduroam on the N900

Getting Eduroam to run on your N900 may involve a lot of fiddling, but at least, it's possible with the new PR1.2 firmware. I had to do the following in order to be able to use my LRZ/MyTUM account for Eduroam; but bear in mind that configuration may vary for other academic institutions! (For example, my institutions gives me login and password, whereas other institutions hand out login and an individual certificate.)
  1. Install the newest firmware (PR1.2 at the time of this writing).
  2. From the N900's Web browser, download the root certificate of the DFN and install it in the N900's certificate manager. Make sure that you allow the certificate to be used for WLAN authentication (you may also tick the other options if you wish).
  3. You now may try to get Eduroam to run. If you're lucky and your institution doesn't require support for PAP with TTLS, you're done. Chances are, however, that it doesn't. Curse and do a lot of googling. Come across the forum page http://talk.maemo.org/showthread.php?t=39399&page=2
  4. From the N900's Web browser, download the little software program wlan_tool which was written by a Nokia employee. (For background information why you need it, see the corresponding forum entries.) Throw your inhibitions concerning downloading software from some forum overboard and pray that this software was really developed by an honest Nokia employee and really doesn't open any backdoors or the like. Save the application file (a .deb file) to a folder where you will find it again.
  5. Open the file browser, navigate to that download folder, and open the wlan_tool_blabla.deb software package file. The program manager will open and install the file (after you clicked on "yes, I know that I'm a silly person because I'm about to install unofficial software because Nokia messed things up.")
  6. You now have a new program installed called WLAN Tool. Run this software by clicking on it in the application list/menu. Due to its name beginning with the letter W, it probably will appear near the very end of the application list.
  7. The software opens a new window. In General settings, tick the option Allow TTLS/PAP. Leave the other things as-is; they don't have anything to do with authentication.
  8. Close the WLAN tool application.
  9. Reboot the N900.
  10. Open the Settings program, open the Internet connections, create a new connection with the following parameters (N.B. these are spread out over several screens):
    • Connection name: eduroam (or whatever you prefer)
    • SSID: eduroam
    • Mode: Infrastructure
    • Security method: WPA with EAP
    • EAP type: TTLS
    • Choose certificate: none
    • EAP method: EAP PAP (if you haven't rebooted after you installed the WLAN tool, you won't be offered to select EAP PAP here)
    • User name and password as provided by your institution, e.g., lars.zbigniew.delorenzo@mytum.de and *******
    • Before you click the done button, click extended first! A new pop-up will open. Here, navigate to the EAP tab, tick Use manual user name: yes, and enter the "anonymous" user name which is the default for your academic institution (in my case: anonymous@mwn.de). Click Save.
    • Save everything and enjoy. Note that it sometimes may take rather long (many seconds) to log into the Eduroam network.



Nachtrag für MWN-Nutzer (Juli 2010)


(This is only relevant to people in Munich/München who work or study at TUM and perhaps LMU, FH/HS, etc., so I post it in German.)


Nachdem ich all diesen Mist für EAP PAP gemacht habe, habe ich erfahren, dass das MWN durchaus andere Authentifizierungsmethoden neben EAP PAP anbietet – allerdings fuktionieren die nicht mit einer selbstgewählten ...@mytum.de-Adresse, sondern ausschließlich mit dieser kryptischen, vom LRZ vorgegebenen Adresse. Falls man die nicht kennt (Achtung, das war bei mir nicht dasselbe wie diese ellenlange Mytum-ID, die ich bei meiner Einstellung auf einem Zettel genannt bekommen habe), kann man sich einfach bei Mytum einloggen und sich in bei den Konto- oder Maileinstellungen diese LRZ-Kennung anzeigen lassen. Ich hatte es stattdessen mit meiner Mytum-Kennung versucht, und genau das geht idiotischerweise dann nur mit EAP PAP.

Saturday, 8 May 2010

N900 as GPRS/UMTS/3G bluetooth dial-up for a Ubuntu Linux PC

If you want the N900 to act as a mere modem for connecting to the Internet via a GPRS/UMTS/HSPA/3G/3.5G/... network from your laptop running Ubuntu Linux v9.10, here's a very brief description how to do that. It's aimed at people who don't want to open a shell and enter something like "sudo pon gprs", but who rather prefer to use their mouse (that's actually a rather ununixy/unlinuxy way, I know):

Preparation

  1. Prepare your N900: Install the software package bluetooth-dun from extras-testing.
  2. Prepare your Ubuntu laptop:
    1. Install the bluetooth manager blueman (the Gnome default bluetooth applet will not do!)
    2. Go to the Network Manager and create a new mobile broadband connection. (In case you already have created one for a UMTS/3G stick and want to use the same provider with your N900, you don't need to do this.)
  3. If you have not done so, initiate a bluetooth pairing between your N900 and your laptop so that you don't have to enter PINs, confirm connection requests, etc.

Using it

  1. Activate Bluetooth on your N900 if you haven't done yet.
  2. On your laptop, click on the blue Bluetooth "B" icon which blueman puts into the system tray (usually in the upper left system menu bar at the top of your desktop). A list with paired bluetooth devices appears; your N900 should be listed there, too. If not, you need to pair it with your laptop first (as I told you step 3 above).
  3. Do a right-hand click on the entry representing N900. A pop-up menu appears.
  4. In that popup menu, select "serial connection" and there "dial-up networking". Now you will see three bars indicating signal strenghts and signal quality for the bluetooth connection. More importantly however, your bluetooth phone has now been made visible to the network manager.
  5. Still on your laptop, do a left-click on the icon of the Network Manager (system tray). Your broadband connection should appear in the "available" section of the menu, with the label that you gave your broadband connection when you created it (step 2.2 in the preparations) Click it to connect.
  6. After a couple of seconds, you now can use the net! Don't be confused by the fact that the N900 will not reveal to you that it just went online via GPRS/UMTS in its system tray (there will be no data connection item appearing near the battery level indicator; only the Bluetooth icon will shine blue instead of white once you activated the serial connection in Blueman).
  7. To close the connection, you click again on the Network Manager icon in the system tray and disconnect via the menu.
Bear in mind that the Bluetooth connection is a bottleneck: Bluetooth v2.1+EDR only yields a speed of 2–3 Mbit/s, whereas the N900's HSPA chip can attain a throughput of up to 10 Mbit/s for download (HSDPA) and 2 Mbit/s for upload (HSUPA). If you need a higher speed, you thus might want to try JoikuSpot which connects your N900 to your laptop via WLAN instead of Bluetooth (bear in mind, however, that it offers only a highly insecure connection, since the WLAN only uses the terribly outdated WEP encryption, which can be cracked within seconds).

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).