NX and the Nokia 770

Posted by George Wright Sun, 18 Feb 2007 04:54:00 GMT

So recently I managed to acquire a Nokia 770 internet tablet (thanks to mjg59). It’s a really nifty device – the screen on it is unparalleled (except, obviously, for the N800 – whose screen is slightly better), and it has quite a nice Linux platform on it. The problem? It runs Hildon, which is GTK-based. The input methods are heavily integrated into the GTK on the device and using any other widget toolkit just doesn’t work (well, it does, but you’re going to need a physical keyboard).

In light of this, I decided to start hacking around with GTK. Its API is not as pretty as Qt in my opinion, but it’s not too shoddy. It just takes a bit of getting used to, although the really verbose function names and endless requirement to call them really annoys me (gtk_foo_bar_baz_lala_eggs_breakfast() anyone?).

Armed with NXClientLib which I developed for my Summer of Code project last year, I decided to try and port my NX client to Hildon. In typical style, I made the architectural decision last year to write the library in C++ and link to QtCore/QtXml simply because it made my life a whole lot easier (I would dread to think how much extra code I’d need to write if I didn’t have QString). Anyway, I’m currently in the process of gluing GTK and Qt together in perfect harmony (haha) so that NX can take over the world, but it’s proving to be less trivial than I thought it would be.

Some gratuitous screenshots:


The initial login interface

The window automagically changes the layout for the on-screen keyboard

I’m afraid that’s all there is to “Maemo NX” thus far. I’ve spent most of the time trying to learn how GTK/X11 works and also thinking how best to implement the whole thing. If anyone is an expert at X window reparenting in GTK I’d be most grateful if they could take a look at this code and let me know why it doesn’t reparent the X window whose ID is specified by int wid into the GTK window I create and then make the reparented window visible. It seems to reparent fine, as the window with id wid disappears, but there’s no sign of it in the GTK window. If I can’t get this to work I’ll simply use mozplugger-helper which does a fine job of reparenting a window, but the fewer dependencies I can have the happier I’ll be.

If anyone’s interested in the code so far, it can be found in the FreeNX subversion repository at http://svn.berlios.de/viewcvs/freenx/nxclientlib/maemonx/.

Posted in ,  | 8 comments

Linux on the HTC Universal

Posted by George Wright Sun, 31 Dec 2006 02:26:00 GMT

For those of you that don’t know, I have an HTC Universal phone. I have two main priorities for this thing - firstly, to get Linux booted on it with the phone hardware working nicely, and secondly to get NX working on it (yes, I’m strange).

Today was the first day in ages that I’ve actually decided to do anything. Those of you that met me in Ireland at aKademy will know that I was working on bootstrapping Debian Sarge on it without much success. Well, today, I managed to bootstrap an almost fully working Etch system without too much difficulty (and by that I mean it only took me 14 hours to do..).

Anyway, it was installed by running

debootstrap --include=wireless-tools,hotplug --arch arm --foreign etch /etch http://ftp.uk.debian.org/debian

at first on my desktop, then copying the entire directory over to my 2GB SD card. I had to create /dev/mmcblk0p1 and /dev/mmcblk0p2 though, and pass the kernel parameters rootdelay=3 root=/dev/mmcblk0p2 init=/bin/bash for it to be usable. When I got to bash I could then run debootstrap --second-stage which finished the bootstrap process.

After all that I installed kdrive from the 720degrees project but ended up having to replace the Xfbdev binary with that from one of the pre-built Universal GPE tarballs as it didn’t seem to have support for VGA modes.

In any case, I’ve now got X11 to run semi nicely, but the lack of a working touch screen is a bit infuriating at the moment.

I’m still trying to work out how tslib works - it seems to be a bit of a weird library. I can create the device /dev/input/event0 and get output from it when I tap on the screen, but Xfbdev always moves the cursor to the top right if I try and specify that as the tslib device. If anyone knows about how tslib works I’d be grateful if they could share it with me as documentation on it seems to be rather sparse.

I intend to get more working soon, but for now, I’m pretty washed out after all the fiddling I’ve done today. On the todo is to get the phone hardware to work, write a telepathy backend for the phone hardware and experiment with various desktop environments or window managers to find which one is suitable (I have a pet hatred for qtopia/opie/gpe. They’re all rubbish.). I’d also like to get the wireless working more reliably (I’m having to use the usbnet at the moment) and also write a keymap for the keyboard that isn’t rubbish. Ah the joys of embedded Linux.

Posted in  | 11 comments

Using a Windows Mobile phone to connect to the internet

Posted by George Wright Wed, 22 Nov 2006 01:31:00 GMT

As some of you may know, I have a Windows Mobile 5 based phone. It’s possibly got the worst software I’ve ever used in my life but the hardware’s really nice so I put up with it.

One of the major things I use the phone for is as a modem for Linux because I have an (effectively) unlimited data tarriff on my contract, so being able to use it with my laptop is incredibly useful.

Previously, I have been using the USB cable and using wvdial to treat the phone as a dial up modem to connect to the internet. This wasn’t without complications as Windows Mobile seems to require an initialisation string which no other phone uses. This is:

AT+CGDCONT=1,"IP","APN",""

Where ‘APN’ is the access point name for your data carrier. In my case (T-Mobile), it’s “general.t-mobile.uk”.

To connect via USB though, you first need to load the appropriate module to give you a serial interface (/dev/ttyUSB0) to communicate through. You’d think this was as simple as running ”modprobe ipaq”, but no - it’s more complicated.

First you have to modprobe ipaq then run lsusb -v. You then need to look up your phone’s entry and record the hex numbers for the vendorID and the productID then rmmod ipaq and load it again passing those identification numbers as parameters to the module, so in my case:

modprobe ipaq vendor=0x0bb4 product=0x00cf

This will then give you /dev/ttyUSB0 to play with. However, it’s still isn’t that simple from here. You need one more fiddle to get it working. You need to set “Stupid Mode” in wvdial to force pppd to start as soon as the modem connects. Thus, the final wvdial.conf is as follows:

[Dialer Defaults]
Modem = /dev/ttyUSB0
Baud = 115200
Init = AT+CGDCONT=1,"IP","APN",""
Phone = *99#
Username = USERNAME
Password = PASSWORD
New PPPD = yes
Stupid Mode = yes

So, after setting up Linux you just need to run the “Wireless Modem” program on the phone and start the softmodem.

Unfortunately, trying to get it to connect via bluetooth appears to be infinitely more difficult. Luckily, I finally managed to get it to connect today after a few hours of research and fiddling, and it now seems rather trivial.

Firstly, Edgy’s bluez packages appear to be sufficiently broken that it doesn’t bring up the bluetooth adapter in discoverable mode - thus resulting in severe breakage when trying to connect the phone. This is fixed by running the command:

hciconfig hci0 piscan

You then need to fiddle some values in /etc/bluetooth/hcid.conf to allow the phone to pair.

I set a default passkey using the passkey "xyz"; option in hcid.conf as I couldn’t be bothered to set up a helper application. However, it should work just fine if you do set up a helper application. That’s basically all that needs to be altered.

Now onto the phone.

Going into Settings -> Connections -> Bluetooth, make sure the phone is discoverable and pair it with the computer. Once it’s paired, the Linux box’s ID should appear in the list on the “Devices” tab. You then just need to go into the “Internet Connection Sharing” program and start the connection using “Bluetooth PAN”. Once that’s done, it’s fairly trivial. On the computer, run the command:

pand --connect BADDR -n

Where “BADDR” is the 6-element bluetooth address of your phone, which can be obtained using the command hcitool scan. After that, it should splurt out something like:

pand[8361]: Bluetooth PAN daemon version 3.7
pand[8361]: Connecting to BADDR
pand[8361]: bnep0 connected

This means that pand has brought up a new ethernet interface called bnep0 for you to play with. After this, it’s just standard networking. Run a dhcp client on bnep0 and it will give you an IP address and NAT you across to the phone.

Hooray - the phone is connected via bluetooth to the internet. I still haven’t worked out how to get it to act as an actual modem over bluetooth (taking AT commands etc), but to be honest, I fail to see any point if we have Bluetooth PAN instead.

Posted in ,  | 10 comments

Google London Open Source Jam

Posted by George Wright Sat, 18 Nov 2006 01:27:00 GMT

On Thursday, Google’s London office hosted the first “Open Source Jam” - an invitation-only event designed to bring together members of the free software community to hack on stuff at Google’s office.

I was the only person in KDE there as John Tapsell, in his infinite wisdom, forgot it was Thursday and didn’t show up. It’s a really nice office in Belgrave House a few minutes walk from Victoria underground station. They were very hospitable and there was free wireless internet for us - although it was very erratic and the lack of a DNS server didn’t help. To be fair I didn’t really use the wireless as it was such a short event that I ended up talking through the whole evening instead of geeking.

Among the people there were a couple of guys I already knew, namely Alasdair Kergon (agk) of LVM fame, and also Paul Nasrat, a Red Hat employee.

The employees themselves were really friendly - and ridiculously good at table football. The room we were in was some sort of a hybrid cafeteria and recreation room, sporting lots of drinks refrigerators, a pool table and a table football table.

All in all, it was quite a fun event and they’re thinking of making it a regular thing on a monthly basis. Unfortunately Cambridge is a bit far to come from for a three hour session but I’ll certainly endeavour to go a few more times.

Posted in  | no comments

QtNX and nxproxy

Posted by George Wright Sun, 27 Aug 2006 17:31:00 GMT

I have had several emails in the last few days about QtNX which all detail a common problem.

QtNX, as you should know, requires nxssh and nxproxy to function properly. These need to be in the PATH and their relevant libraries in LD_LIBRARY_PATH. Without that, QtNX will not function.

On top of that, QtNX requires nxproxy 1.5.0. Version 2.0.0 does not work, so please don’t use that unless you want to try and port QtNX to nxproxy 2.0.0. I will look into porting it to 2.0.0 but I do not see it as urgent right now.

However, even though nxproxy 1.5.0 is used, I am reliably informed that it will connect to an NX 2.0.0 server without any trouble whatsoever - so there’s no need to worry about that.

Posted in  | 8 comments

Older posts: 1 2 3