How to develop and debug the SHR phone stack on your desktop

| No Comments | No TrackBacks
Why do we want to do that?
One annoying thing while developing applications for SHR is the time consuming cycle of: hacking - building with OE - installing on the device - testing. The UI itself could be developed natively on the desktop too, but as lots of stuff depends on the actual hardware (eg. phone calls) that does not cover the whole story.

What can we do about that?
Now, we have a solution :-) The other day an interesting application was added to OpenEmbedded (thanks mickeyl): dbus-daemon-proxy. So, what is that? If you start dbus-daemon-proxy on your phone it will proxy all dbus methods and signals from your phone over the network to you desktop. This means you can have the hardware dependent stuff like fsogsmd running on the phone and stuff like phoneuid running on your desktop and it will just work.

So, what do you need to do that?
1) you need a current EFL stack with elementary. Current means you have to build it yourself from Enlightenment SVN. I personally use the get_e.sh script from raster (find it here: get_e.sh). But there are others out there too. NOTE: get_e.sh does not install elementary itself. You have to do that manually after get_e.sh finished installing all the other stuff.

2) you have to install dbus-daemon-proxy on your phone. It is already in the SHR-unstable feed, so if you run SHR-unstable (which is somehow important if you want to develop the SHR phone stack ;), then just opkg install dbus-proxy-daemon.

3) install the SHR phone stack (and all of its dependencies) on your desktop. To make life easy for you I created a script which does that (setup-shr-build-env.sh). It will install all needed stuff to your home directory. If you don't already have LD_LIBRARY_PATH set to contain $HOME/lib you have to add it.

4) stop phoneuid on your phone. Easiest way is to just execute 'killall phoneuid'.

5) start dbus-daemon proxy on your phone. Note: you need one instance for every program connecting to it. I'm using one for phoneuid, one for communication with phoneuid (eg. to start messages app) and one for some debugging tool like d-feet or mdbus2. Create something like the following script to start it on three different ports:

#!/bin/sh
dbus-daemon-proxy --system --port 8080 &
dbus-daemon-proxy --system --port 8081 &
dbus-daemon-proxy --system --port 8082 &
make it executable and start it.

6) start phoneuid on your desktop with the following call:

DBUS_SYSTEM_BUS_ADDRESS=tcp:host=192.168.0.202,port=8080 phoneuid
7) start the messages app with the following call:

DBUS_SYSTEM_BUS_ADDRESS=tcp:host=192.168.0.202,port=8081 phoneui-messages
8) have fun watching your messages pop up on your desktop :-)

Apart from saving a lot of time by not cross-compiling and installing... one big winner is to be able to use some nice gdb GUI to debug the thing.

No TrackBacks

TrackBack URL: http://blog.shr-project.org/cgi-bin/mt/mt-tb.cgi/30

Leave a comment

Pages

About this Entry

This page contains a single entry by Klaus 'mrmoku' Kurzmann published on May 1, 2010 12:40 PM.

SHR Project gets a successful presentation at Openmobility conference was the previous entry in this blog.

SHR-T upgrade and no sound? is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.