Archive for the 'openmoko' Category
2-D Slider – GTK Widget
Today I build my first true GTK widget. Since written in Python, it’s not fitting in all GTK programs, but still I think some people might find it useful.
The Idea is to have a widget that can change two values at the same time. This comes in handy whenever a program has two numeric inputs that are manipulating one result. Users will not have to jump from one input element to another, but can use a diagram-like area to set values using an X and an Y axis.

When the widget is created, the programmer can select which ranges X and Y shall be in. The 2-D area will then displays a grid to show where values will be placed. And while the mouse is hovering over the grid, a preview dot will mark the nearest available value pair. If a coordinate is selected (by pressing the mouse button, or dragging the mouse over the field) an event will be generated, to inform the rest of the program about new values (X, Y, or both).
The Python sources can be found at the SVN repository of the #neo1973-germany developers Homepage. The following code snippet shows how to use a slider_2d widget and how to connect two callback functions to the “value_changed” events.
import slider_2d
...
def x_changed_callback(new_x_value):
value_x_label.set_text("Value X: %s" % new_x_value)
def y_changed_callback(new_y_value):
value_y_label.set_text("Value Y: %s" % new_y_value)
value_x_label = gtk.Label("Value X: none")
value_y_label = gtk.Label("Value Y: none")
slider_2d = slider_2d.slider_2d(x_range = (0, 30), y_range = (0, 10))
slider_2d.connect('x_value_changed_event', x_changed_callback)
slider_2d.connect('y_value_changed_event', y_changed_callback)
...
No comments
Bluetooth PAN on Openmoko
Last night I could finally finish the 0.8 release of SettingsGUI. The touch based application for Openmoko does now feature a configuration interface for Bluetooth Personal Area Networks. After setting up such a Network (touching the “Connect” button on both ends) I could get two Neo1973 phones to communicate with each other.
SettingsGUI will use the last byte of the 6 bytes long Bluetooth Address as fourth number in its IP Address. That way most devices will reach each other without any further configuration.

Thanks to Professor Dr. Rüdiger Weis who privately financed the second Neo1973 as our university does not seem to be able to equip students with GSM capable hardware.
In the picture you can see the two Neo1973 (GTA01) with SettingsGUI running. Also I could successfully test a configure where the default gateway points to my Laptop, so that ip-forwarding would work. That way you can surf the Web using Bluetooth on Openmoko. Bluetooth 2.0 can reach a transfer speed of about 2 MBit/s which is about as fast as DSL, so it is fun to use.
Since last week SettingsGUI and the three other tools I wrote for Openmoko are part of the Moko Underground movement at neo1973-germany.de where they finally found a SVN home.
I would be happy about any kind of feedback regarding SettingsGUI.
2 commentsOpenMoko
As I’ll write my Master Thesis on OpenMoko, I bought a Neo1973 as soon as it was available in the OpenMoko Online Shop. OpenMoko is an open source distribution for mobile phones, and the Neo1973 the first publicly available Phone, using it.
After it arrived, I managed to write some software just to get used to the environment. I’ve chosen Python for the task, as I like the development speed you can achieve with it and the number of libraries it provides.
OpenMoko is based on OpenEmbedded (OE), and so I was happy it had the most important Python libraries in its recipe database. I could start using pyGTK, Distutils, Subprocess and urllib right away.
What would you code on a virgin Embedded System like the Neo? Well the first thing that came to my mind, after playing around with the functions that could be only accessed by the on screen terminal or an ssh connection, was a User Interface to provide these functions. That way, I would be able to set options on Audio, Video and GSM connection without having to use the onscreen keyboard. SettingsGUI was born.

It’s a great experience to work with the OpenMoko community. There is a Wiki to get in-depth information, and the guys at #openmoko (and #neo1973-germany) at the freenode.net IRC network are providing instantaneous help. I could commit patches and bugs into the Bugtracker, to get the existing source code adjusted to my needs, and Alessandro offered to package my programs for his repository. Thanks for that.
So, it is really fun to develop for OpenMoko. Currently I’ve also got an SMS tool and a note writing program in the works. Expect more blog posts on those and on an experimental RSS Feed Reader soon.
This all provides a great basis for the Master Thesis, and I am really looking forward to start writing in the next weeks (after my university approved). So stay tuned and don’t hesitate to send me any thoughts or ideas.
No comments