User:AndreasJellinghaus/GetStarted

From Openmoko

< User:AndreasJellinghaus(Difference between revisions)
Jump to: navigation, search
Line 50: Line 50:
 
<pre>
 
<pre>
 
cat > hello_world <<EOF
 
cat > hello_world <<EOF
#!/usr/bin/python
+
#!/usr/bin/env python
  
 
import gtk
 
import gtk
b = gtk.Button("Hello")
+
 
w = gtk.Window()
+
def on_button_clicked(*args):
w.add(b)
+
    print "Hello World"
w.show_all()
+
 
 +
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()
 
gtk.main()
 
EOF
 
EOF

Revision as of 20:00, 15 November 2007

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.

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_openmoko 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 root@192.168.0.202
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

DISPLAY=:0 ./hello_world

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

Notes

Personal tools

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.

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_openmoko 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 root@192.168.0.202
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

DISPLAY=:0 ./hello_world

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

Notes