Start developing applications for OpenMoko!
Warning: this is my writeup from yesterday. I couldn't verify it today, because buildhost.openmoko.org is down.
Here is what you need to do.
First, you need to have a recent image on your moko. Beware: this can brick your hardware, don't do any of this unless, you know what you are doing, and willing to take the risk.
In this example I don't update the uboot bootloader - you should do so only if you need to. Mine is fine. Also always only use tested versions of the bootloader - you can fix everything else if the bootloader is still working (as far as I know). But if the bootloader is broken, you need a debug board to fix the issue.
Warning: The URL below points to the images of the day. Sometimes they work, sometimes they don't. It would be much better to point to some tested release that is at least somehow stable, but I don't know where to find such a thing.
Note: before running dfu-util you need your moko in uboot mode. To do that turn off your moko (if nothing else helps, remove usb and battery), and turn it on again - while pressing AUX, i.e. the upper left buttom. you will see a boot menu with "factory reset" and similar options. OpenMoko needs to be in this menu for below procedure to work.
BASE=http://buildhost.openmoko.org/OM2007.2/tmp/deploy/glibc/images/neo1973/ wget $BASE/dfu-util wget $BASE/uImage-neo1973-latest.bin wget $BASE/openmoko-devel-image-fic-gta01.jffs2 chmod +x dfu-util sudo bash # ./dfu-util -a u-boot -R -D uboot-gta01bv4-latest.bin # not needed ./dfu-util -a kernel -R -D uImage-neo1973-latest.bin ./dfu-util -a rootfs -R -D openmoko-devel-image-fic-gta01.jffs2
(see Flashing the Neo 1973 for details)
Next you need to get network access over USB to work for you. On my Ubuntu 7.10 I don't need to patch the kernel, load modules or anything like that, all I need to do is:
ifconfig usb0 192.168.0.200 netmask 255.255.255.0 route add -host 192.168.0.202/32 dev usb0
(see USB_Networking for details)
Now I can SSH to my Moko with
ssh firstname.lastname@example.org Password is "root"
and now I can create a simple hello world application:
cat > hello_world <<EOF #!/usr/bin/env python import gtk def on_button_clicked(*args): print "Hello World" window = gtk.Window() window.connect("delete_event", gtk.main_quit) window.set_border_width(10) button = gtk.Button("Hello World") button.connect("clicked", on_button_clicked) window.add(button) window.show_all() gtk.main() EOF chmod 0755 ./hello_world
and start it
(if you press the button you will see "Hello World" on the console. Use ctrl-c on the console to abort.)
Issues not handled yet:
- menu files so it can be started via the launcher
- packaging of a new application
- submitting of a new application to the openmoko team for inclusion