m2oTech.com

  • Increase font size
  • Default font size
  • Decrease font size
m2oTech.com

Installing QtMoko on Openmoko Freerunner GTA02

Print PDF

After trying out SHR without much luck (GSM calls didn't work, connecting to wifi often caused system crashes, ...) I decided to move on to the next distro, that is QtMoko.

I followed a similar procedure to what I did for SHR, in this case I created a FAT16 partition sized 8MB for the kernel and a bigger ext3 partition (~500MB) for the main filesystem, both on my 2GB SD card. I also left some space for a swap partition (128MB).

After ssh-ing into the phone, I created the partitions

fdisk /dev/mmcblk0

(the SD card path)

Use m to list commands, n will let us create a new partition, t specify the type (choose Linux for an ext2/ext3, FAT16 for the kernel partition, swap for the swap one).

Format the partitions with mkfs

# FAT16 for kernel
mkfs.vfat /dev/mmcblk0p3
# ext3 for filesystem
mkfs.ext3 /dev/mmcblk0p5

Copy the distribution and kernel image to the mounted partitions:

# kernel (small partition)
mount /dev/mmcblk0p3 /mnt/mokokernel
cp uImage-fic-gta01-latest.bin /mnt/mokokernel/uImage.bin
# (or use scp from host computer through ssh)
scp uImage-fic-gta01-latest.bin 192.168.0.202:/mnt/mokokernel/uImage.bin
# filesystem (big partition)
mount /dev/mmcblk0p5 /mnt/moko
# (following from host computer)
cat /home/m2/Desktop/openmoko_distros/qtmoko-debian-v24.tar.gz |ssh This e-mail address is being protected from spambots. You need JavaScript enabled to view it "gunzip -d | tar -C /mnt/moko/ -xf -"

Now add another entry to boot QtMoko with kernel in p3 and fs in p5:
(the following to be typed at the bootloader prompt, how to do it?)

NB: change menu_4 according to your needs in order to make sure you don't overwrite an existing useful entry, use printenv to find out current entries, up to 10 can be specified

# (for ext2 kernel partition)
setenv menu_4 Boot from microSD part3/part5 (ext2+ext3): setenv bootargs \${bootargs_base} rootfstype=ext3 root=/dev/mmcblk0p5 rootdelay=5 \${mtdparts}\; mmcinit\; sleep 1\; ext2load mmc 1:3 0x32000000 \${sd_image_name}\; bootm 0x32000000
# (for FAT16 kernel partition)
setenv menu_4 Boot from microSD part3/part5 (FAT+ext3): setenv bootargs \${bootargs_base} rootfstype=ext3 root=/dev/mmcblk0p5 rootdelay=5 \${mtdparts}\; mmcinit\; sleep 1\; fatload mmc 1:3 0x32000000 \${sd_image_name}\; bootm 0x32000000

Now you can boot the Freerunner by pressing power button followed by AUX button (keep both down for a few seconds) and choose the entry you just created.

First impressions with QtMoko

I must say I was pretty impressed. First of all it is much faster and more responsive than SHR or Om-2008 (the two distros I have tried so far). I find the menu navigation quite intuitive and not overly crowded. As I understand it is based on a Qt framework originally developed by Nokia. It definitely feels like a phone rather than a computer OS, but that's not necessarily a bad thing.

A few warnings:

  • QtMoko has a tendency to delete all your SMS from your SIM card, I have read that this was fixed but it wasn't in my case
  • the default /etc/fstab does mount default partitions at /media/card and as swap, make sure you adjust those values to reflect your partitioning
  • I did manage to crash the system a few times, one time it went particularly wrong and after restarting I would get a fatal error (blank screen) every time I'd try to use the keyboard, possibly changing the language caused so as that is the last action I did before the mishap (I "fix" that by reinstalling the whole thing, reflashing the filesystem partition)
  • in my understanding QtMoko runs within a Qt desktop environment (QtExtended) sitting on top of a Debian installation (yes like Ubuntu...), this causes it to be very stable and configurable, yet having some oddities, i.e. there is no X server running by default, so all the graphical applications you would run under Debian do not work, however you can run them using the included application Qx which runs a X server on top of the QtExtended (or maybe in parallel?), haven't yet experimented much with this

What works very fine:

  • most applications already installed
  • wifi connections (requires a few clicks to configure), nice surprise
  • GPS (though slow to get fix)
  • phone functions (calls, SMS) though the volume is quite low, that's a common problem with the Openmoko I think
  • underlying Debian system (can use apt-get update, etc. to install packages)

Overall this is definitely a usable system for everyday use, relatively speaking, and looks more tidy and focused than SHR.

 

Installing SHR on Openmoko Freerunner GTA02

Print PDF

In my last post I described how to setup a few things on the Freerunner by using the shipped OM2008 distribution, including USB networking.

This time I set out to install a new distribution, the SHR, by far the most used distro on Freerunner according to the wiki page. It promises to be relatively stable and complete.

I decide to install SHR on a 2GB microSD card which I inserted into the Openmoko, so I follow the instructions on how to install it there. Basically we need to create two partitions, one for the kernel (a small one, either FAT16 or ext2) and a bigger one for the filesystem (ext2 and ext3).

I will not repeat the steps here as I think the guide is clear enough. In order to boot from SD card through the uBoot bootloader we follow this guide. Although some suggest using a different bootloader Qi I stick to uBoot for the time being.

However I decided not to follow the default and install the kernel on a ext2 partition instead of a FAT16 (or vfat). Therefore there was no entry in the bootloader, since the only one available expects a FAT16 as the kernel partition, while I had a ext2. So I needed to access the boot loader shell and create a new entry.

To make changes into the bootloader through USB connection I used the neocon tool, which I really recommend as it saves a lot of hassles you will encounter using a general purpose serial console program like minicom.

Download sources, compile it and run

neocon -t 30 /dev/ttyACM0


The program keeps polling to check whether the device is present so we can start it earlier and then connect the device. To start the Freerunner device and send it to boot loader menu we need to press the power button, keep it pressed, press the AUX button (red button on top), keep both pressed for a couple of seconds. Then use the boot loader entry to set the console to USB.

Before making changes I print the environment variables (GTA02v6 is the bootloader prompt and printenv is the command to type):

GTA02v6 # printenv
boot_menu_timeout=300
int1=0x80
pcf50otfstype=jffs2 root=/dev/mtdblock6 console=ttySAC2,115200 console=tty0 loglevel=8 regular_boot
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel 0x200000; bootm 0x32000000
bootdelay=1
menu_1=Boot from microSD (FAT+ext2): setenv bootargs ${bootargs_base} rootfstype=ext2 root=/dev/mmcblk0p2 rootdelay=5 ${mtdparts} ro; mmcinit; fatload mmc 1 0x32000000 ${sd_image_name}; bootm 0x32000000
menu_2=Set console to USB: setenv stdin usbtty; setenv stdout usbtty; setenv stderr usbtty
menu_3=Set console to serial: setenv stdin serial; setenv stdout serial; setenv stderr serial
menu_4=Set console to USB: setenv stdin usbtty; setenv stdout usbtty; setenv stderr usbtty
menu_5=Set console to serial: setenv stdin serial; setenv stdout serial; setenv stderr serial
menu_6=Reboot: reset
menu_8=Power off: neo1973 power-off
mtdids=nor0=physmap-flash,nand0=neo1973-nand
mtdparts=mtdparts=physmap-flash:-(nor);neo1973-nand:0x00040000(u-boot),0x00040000(u-boot_env),0x00800000(kernel),0x000a0000(splash),0x00040000(factory),0x0f6a0000(rootfs)
quiet=1
sd_image_name=uImage.bin
splashimage=nand read.e 0x32000000 splash 0x5000; unzip 0x32000000 0x8800000 0x96000
stderr=usbtty
stdin=usbtty
stdout=usbtty
usbtty=cdc_acm
partition=nor0,0
mtddevnum=0
mtddevname=nor
pcf50633_int1=0x80
pcf50633_int2=0x02

Environment size: 1374/262140 bytes

Then I change the timeout so that we don't need to keep pressing buttons on the phone to prevent it from shutting down while making changes (this is strictly optional):

setenv boot_menu_timeout=30000

My purpose is to boot SHR from microSD card with the kernel on a ext2 partition and the filesystem on a ext3 (the default boot loader entry expects a fat16 for the kernel, that's why I need to create another entry).

We can add a new menu entry like this (just modify a bit the original one):

NB: needed to add the "sleep 1" instruction (as suggested on the webpage) or else kernel would fail to load

setenv menu_9 Boot from microSD part2 (ext2+ext3): setenv bootargs \${bootargs_base} rootfstype=ext3 root=/dev/mmcblk0p2 rootdelay=5 \${mtdparts}\; mmcinit\; sleep 1\; ext2load mmc 1 0x32000000 \${sd_image_name}\; bootm 0x32000000

Now the environment looks like this:

GTA02v6 # printenv
bootargs_base=rootfstype=jffs2 root=/dev/mtdblock6 console=ttySAC2,115200 console=tty0 loglevel=8 regular_boot
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 0x32000000 kernel 0x200000; bootm 0x32000000
bootdelay=1
menu_1=Boot from microSD (FAT+ext2): setenv bootargs ${bootargs_base} rootfstype=ext2 root=/dev/mmcblk0p2 rootdelay=5 ${mtdparts} ro; mmcinit; fatload mmc 1 0x32000000 ${sd_image_name}; bootm 0x32000000
menu_2=Set console to USB: setenv stdin usbtty; setenv stdout usbtty; setenv stderr usbtty
menu_3=Set console to serial: setenv stdin serial; setenv stdout serial; setenv stderr serial
menu_4=Set console to USB: setenv stdin usbtty; setenv stdout usbtty; setenv stderr usbtty
menu_5=Set console to serial: setenv stdin serial; setenv stdout serial; setenv stderr serial
menu_6=Reboot: reset
menu_8=Power off: neo1973 power-off
mtdids=nor0=physmap-flash,nand0=neo1973-nand
mtdparts=mtdparts=physmap-flash:-(nor);neo1973-nand:0x00040000(u-boot),0x00040000(u-boot_env),0x00800000(kernel),0x000a0000(splash),0x00040000(factory),0x0f6a0000(rootfs)
quiet=1
sd_image_name=uImage.bin
splashimage=nand read.e 0x32000000 splash 0x5000; unzip 0x32000000 0x8800000 0x96000
stderr=usbtty
stdin=usbtty
stdout=usbtty
usbtty=cdc_acm
partition=nor0,0
mtddevnum=0
mtddevname=nor
pcb_rev=0x305
pcf50633_int1=0x80
pcf50633_int2=0x03
boot_menu_timeout=30000
menu_9=Boot from microSD part2 (ext2+ext3): setenv bootargs ${bootargs_base} rootfstype=ext3 root=/dev/mmcblk0p2 rootdelay=5 ${mtdparts}; mmcinit; sleep1; ext2load mmc 1 0x32000000 ${sd_image_name}; bootm 0x32000000
Environment size: 1580/262140 bytes

Reboot the phone and access the boot loader again (press power button, keep it down, press AUX button, keep it down), then choose the newly created entry and SHR should load. It will take some time and when done the welcome screen should appear.

Now I don't seem to be very lucky with this distro so far. The GSM (phone calls, messages, ...) doesn't seem to work, no network is found and the little icon in the upper right corner keeps showing either "None" or "SOS only". An operator scan in the Settings page does not show any operator even though the SIM is recognized. I don't know what could be wrong about that as all bugs found about this seemed to have been fixed. The wi-fi doesn't work either, the phone seems to get stuck when searching wireless networks.

The USB connection works, similarly to what it did in OM2008. The difference is that instead of being recognized as usb0 on Linux desktop it is now shown as eth2 and therefore the commands to connect to it from Linux computer should be something like:

(NB: the eth2 will likely be different on other systems, I have two ethernet cards, therefore eth0 and eth1 are taken, on most systems this could be eth1)

# to set the ip address of usb0 eth2 interface (openmoko)
ip address add 192.168.0.200/24 dev eth2

# to start openmoko connection
ip link set dev eth2 up

# to login into openmoko with ssh (this is the default ip address on openmoko)
ssh This e-mail address is being protected from spambots. You need JavaScript enabled to view it

After connecting to the internet this way (and changing the appropriate settings in the firewall if necessary) I could update the SHR distro:

opkg update

opkg upgrade

Some downloading later the system was happily up to date but my GSM connection problems still not solved. What would be next distro to try? I am thinking about QtMoko. In the meantime I can still boot into the original OM2008 installed in the phone internal memory. All I have to do is let the phone boot by itself without entering the boot loader.

Last Updated on Tuesday, 10 August 2010 10:43
 

m2oPaginator - embedding made easy

Print PDF

After using Picasa for a while, I thought it would be cool to have a way to automatically add photos or images from one of my Picasa albums to an article I am writing, without having to upload the photos again.

Using the built-in embedding feature from Picasa only partly solves the problem, since you either have to embed the whole album or each photo one by one,  a lot of copy and paste. I wanted to embed only some images from each album and also be able to include a short caption which I would write on the fly (i.e. not using the one that might be stored in Picasa). In addition I wanted to do as much as possible from keyboard so that I don't have to move around with the mouse while I am typing.

Certainly there are alternatives, all of which are probably more powerful and complete than what I did. But none of them did what I wanted and in a simple way. So here it is, phpPaginator lets me type something like this

[!1.23:The caption to my image]

and get something like this


[1] The caption to my image

You can find more details on this page.

There are several features I plan to implement, including supporting other online photo galleries besides Picasa, different sources for images and perhaps expand the functionality to something else than images. If you have any comment or suggestion you are welcome to post a comment.

Last Updated on Monday, 31 May 2010 12:15
 

Getting started with Openmoko Freerunner

Print PDF

So a few days ago I have received a brand new Openmoko Freerunner GTA02. This is basically a modern mobile device that supports GSM technology as well as all other functions (wireless, GPS, ...) which are commonly found on upper range mobile phones nowadays. What is interesting about it (at least from my point of view) is that its hardware and software development is completely open. It allows, and in fact encourages, participation in developing it towards a mature product (which still is not, at least in the common meaning of the word).

If you found this page chances are that you also got a Freerunner, therefore I'll go straight to the point and try to put down a few experiences that could be useful to someone.

The first time I switched the Freerunner on I was welcomed by a nice Openmoko logo, followed by a series of white-text-on-black-screen messages, like you would see on a desktop PC. This is definitely no ordinary phone! After a minute or so the home menu of the phone shows up with a few icons, iPhone style you could say. It's really only a few of them, including settings, dialer (to make phone calls), messages (for SMS), locations (basic GPS functionality) and little more.

Took me a while to realize I was running a version of the Om2008 distribution (not the Om2009 as advised by the reseller), *probably* the Om2008.12. With Wi-Fi not present in the settings page I immediately looked for a way to connect the FR to the rest of the world. It turns out it is relatively easy to do so using only a USB cable connecting to a Linux computer (OpenSUSE in my case).

Using a feature of the Linux kernel that easily allows to access network resources through a USB connection I followed the instructions in the manual and it was relatively easy to ssh into the Freerunner (that is, connecting to it through a terminal running in your Linux computer).

(the following commands are to be typed into a terminal in your Linux computer after connecting the USB cable to the FR)

(it is here assumed that the device is recognized as usb0 by the host computer, you can find messages to confirm it appearing in /var/log/messages or similar file after connecting the USB cable)

# to set the ip address of usb0 interface (openmoko)
ip address add 192.168.0.200/24 dev usb0

# to start openmoko connection
ip link set dev usb0 up

# to login into openmoko with ssh (this is the default ip address on openmoko)
ssh This e-mail address is being protected from spambots. You need JavaScript enabled to view it

# at the password prompt just press enter unless a password is set in the FR

(you can put the above into a script)

At this point you should be presented with a prompt which is something like the following:

root@om-gta02:~#

That means we have successfully entered into the device and can now explore it through the terminal. We can for example type:

ifconfig

and verify that interface usb0 in the FR is set to the IP address 192.168.0.202 (default on most FR devices), this is the reason why we previously set the IP address on our computer to 192.168.0.200 (the last 200 could be anything from 0 to 255, but not 202!), so that the two can communicate.

You can verify that the connection is there by typing:

ping 192.168.0.200

in the ssh session.

A problem with the default setting of 192.168.0.202 is that it can easily happen that your computer's main network card (ethernet or wireless) is already set to that address range (it is the default if you are connecting to the internet through a router). As this can cause problems it is advised to change the address range in your router, which should be much easier at this point than changing things in the Openmoko device... as I didn't have this problem I went straight to the next part which is making sure that the device can reach the internet.

We have to make sure that a request coming from the FR is properly forwarded through the router on to the internet and back. To do this:

  • IP forwarding must be enabled
  • proper rules needs to be set in the firewall (if any)

If your Linux system has a graphical interface for the firewall that might be the easiest way to proceed. Basically all you need to do (at least in my experience) is enabling masquerading, which should be somewhere in the firewall options. You can also set a specific rule that will forward traffic coming from usb0 to eth0 or from 192.168.0.0 subnet onto your router subnet.

If you don't have such graphical aids or you want to write a script to do it you can try some of the following commands:

(warning: altering firewall setting should be done cautiously, those suggested here are only quick fixes to communicate with the openmoko)

# in case we want to flush the content of the POSTROUTING table beforehand (may not be necessary)
iptables -t nat -F POSTROUTING

# this should let through all packages coming from openmoko subnet and directed to eth0 (internet bound interface)
# by sending them over to MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE

# the filter table needs to be checked as well, especially the FORWARD chain
# this will only list the filters currently active
iptables -t filter L

# this flushes the FORWARD chain so as to clear previous rules
iptables -t filter -F FORWARD

# this tells the firewall to accept and forward all packages FROM openmoko subnet
# the /24 specifies the subnet mask, in this case 255.255.255.0
iptables -t filter -A FORWARD -s 192.168.0.0/24 -j ACCEPT

# this tells the firewall to accept and forward all packages TO openmoko subnet
iptables -t filter -A FORWARD -d 192.168.0.0/24 -j ACCEPT

At this point I was able to:

ping google.com

and get a response!

I could then go on and run the installer on the Freerunner (the link is at the bottom of the page). Although it did complain that repositories were not found I was still able to install a few programs (I guess some repositories were found after all). As I plan to switch to another distribution soon (Om2008 is no longer developed) I did not put much effort into getting everything to work, I just wanted to become familiar with the FR.

Something I would like to get working is the Wi-Fi which is apparently on by default but lacks a graphical interface in the Settings page. Following some googled advice I installed Mofi and verified that it can in fact find wireless networks. I was not successful in connecting to one though.

By playing around in the terminal (even installed one in the FR itself, not the most convenient situation for typing a lot of stuff, but very cool) I found out that the SD micro card you can insert in the Openmoko is automatically mounted at /media/card while the root filesystem is mounted from a much more obscure string (nothing like /dev/sda1), which you can easily find by typing:

cat /etc/fstab

in the Openmoko (either through ssh or directly in the terminal application in the phone) and checking the entry corresponding to /

Switching off the Openmoko Freerunner requires pressing the power button for at least 3 or 4 seconds, while switching it on requires a much longer time (7 or 8 possibly). As mentioned in the manual there is some problem when the battery is empty. Basically the phone can run without a battery if it is connected to USB or power outlet, but it cannot boot. If the battery happens to drain completely I found that attaching it to the power outlet and waiting for a while (around 30 minutes) will allow the device to start again.

Last Updated on Tuesday, 10 August 2010 10:07
 

If you are trying to burn large files to DVD in Nautilus...

Print PDF

Quick tips for those having troubles burning files larger than 4 GB to a DVD using Nautilus (GNOME default file manager) built-in DVD burning facilities. Since Nautilus would always fail with "unhandled error" when trying to burn such files (e.g. a large backup file to DVD, in my case a large container file created with truecrypt) I did some googling and found various reasons for this. I also found a quick solution, that is using k3b, a disc burner for KDE. On my system (OpenSUSE 11.0) I have both GNOME and KDE installed so I already had that program installed, if not you can probably easily get it from your software package manager (KDE programs will usually run on GNOME as well) or from the k3b website.

K3b did not complain for the large size, only warning that UDF support must be enabled to ensure compatibility for large files. It did so and the disc is perfectly usable under Linux, where I can mount the truecrypt container (have not tried on other OS).

Hope this help.

 


Page 4 of 5