Resources: * [[http://openmoko.org/|Openmoko]] - Mobile Software Stack & Distributions, Neo Mobile Phone Hardware * [[http://freesmartphone.org/|FreeSmartPhone.org]] - Smartphone Software Projects Platform * [[http://www.gnome.org/mobile/|GNOME Mobile]] - Mobile/Embedded Desktop Platform * [[http://matchbox-project.org/|Matchbox]] - Embedded Desktop Suite * [[http://openembedded.org/|OpenEmbedded]] - Crosscompilation Framework * [[http://angstrom-distribution.org/|Ångström]] - Embedded Distribution * [[http://wiki.openmoko.org/wiki/Debian|Debian]] - The ultimate Distribution ;) * [[http://wiki.debian.org/pkg-fso|pkg-fso]] - The project working on the ultimate Distribution ;) \\ ====== ====== Es gibt eine Mailingliste münchner Openmoko-User: * openmoko@lists.muc.ccc.de \\ * http://lists.muc.ccc.de/cgi-bin/mailman/listinfo/openmoko ====== Freerunner ====== ===== SD/GPS Bug ===== Der HW-Fix des [[https://wiki.openmoko.org/wiki/GPS_Problems|SD/GPS-Problems]] ist das Einlöten eines [[https://wiki.openmoko.org/wiki/Image:Gta02_gps_10pf_rework_sop.pdf|10pF KerKos zwischen Pin5 und Pin6 des microSD-Sockels]]. \\ Openmoko empfiehlt dafür einen 0402 SMD KerKo. Den einzulöten fällt definitiv unter Herausforderung/Erfahrung/Abenteuer (vorher keinen Kaffee trinken und ausreichend Meditieren ist empfehlenswert ;), aber auch unter 'muss man mal gemacht haben'... ;) \\ Berichten zufolge passt ein 0603 SMD KerKo ebenfalls, drückt wohl leicht gegen die eingelegte microSD-Karte, ist aber mit Sicherheit deutlich leichter einzulöten. 10pF 0402 SMD KerKos liegen im Club herum. Geeignete Lötspitze und Pinzetten ebenfalls. Lupe wäre auch vorhanden, besser ist's kurzsichtig zu sein und die Brille abzunehmen... ;) ===== Case-Modding ===== Ein paar wahrscheinlich naheliegende Case-Mods: * Ausgang/Connector für Serielle * Ausgang/Connector für I²C * Externer Connector für GSM-Antennenanschluss (think 'Car-Dockingstation') ===== HW-Modding ===== Wahrscheinlich naheliegende HW-Mods: * IR-Sender/Empfänger * Entsprechende Hardware dürfte sehr minimalistisch/winzig realisierbar sein. Sinnigerweise möchte man den IR-Sender wohl am oberen Ende einbauen. Der Platz neben der GPS-Antenne könnte dafür möglicherweise ausreichend sein. * Falls das nicht übermässige Schwierigkeiten macht, wäre es sicher wünschenswert sich auf keine Trägerfrequenz festzulegen (also z.B. keinen TSOP mit Trägerfrequenz, sondern das in Software machen). * Als Schnittstelle dürfte wahrscheinlich I²C am naheliegendsten sein. Wäre schade um die Serielle, und die direkte Benutzung eines GPIO dürfte vermutlich nicht vorteilhafter sein. * Case-Modding notwendig. ====== Openmoko 2007 Distribution ====== Das Ganze ist Freerunner und Openmoko 2007 spezifisch (nach erfolgreichem 'opkg update; opkg upgrade'), aber vielleicht auch sonst hilfreich. ===== USB "Ethernet" mit dhcp ===== Mit ipv4-Masquerading, und da die Freerunner-Clock das gut brauchen kann ausserdem mit ntpclient. Das impliziert natürlich einen laufenden ntpd auf dem Host, wenn's funktionieren soll. ==== Freerunner ==== /etc/network/interfaces: auto usb0 iface usb0 inet dhcp /etc/udhcpc.d/60ntp: #!/bin/sh # udhcpc script to start a ntpclient in case we got a ntpsrv # disgorged by x@muc.ccc.de this=`basename "$0"` if [ -z "$1" ]; then echo "$this: got no action. this is fatal. exiting." exit 1 fi if [ -z "$interface" ]; then echo "$this: got no interface. this is fatal. exiting." exit 2 fi if [ -z "$ntpsrv" ]; then echo "$this: $interface: got no ntpsrv. exiting." exit 0 fi if [ -e /etc/default/ntp ]; then . /etc/default/ntp fi if [ -z "$NTPCLIENT" ]; then NTPCLIENT="/sbin/ntpclient" fi if [ -z "$NTPINTERVAL" ]; then NTPINTERVAL="600" fi case "$1" in deconfig) if [ -e "/var/run/ntpclient-$interface.pid" ] && [ "`ps -p \`cat \"/var/run/ntpclient-$interface.pid\"\` --no-heading -o comm`" == "$NTPCLIENT" ]; then echo "$this: $interface: stopping ntp client" start-stop-daemon --stop --quiet --pidfile "/var/run/ntpclient-$interface.pid" fi ;; renew|bound) if [ ! -e "/var/run/ntpclient-$interface.pid" ] || [ "`ps -p \`cat \"/var/run/ntpclient-$interface.pid\"\` --no-heading -o comm`" != "$NTPCLIENT" ]; then ntpsrvargs="" for i in $ntpsrv; do ntpsrvargs="$ntpsrvargs -h $i" done echo "$this: $interface: starting ntp client: $ntpsrv" start-stop-daemon --start --quiet --background --make-pidfile --pidfile "/var/run/ntpclient-$interface.pid" --exec "$NTPCLIENT" -- -l -i "$NTPINTERVAL" $ntpsrvargs if [ -n "$timezone" ] ; then : # use this timezone. fi fi ;; esac exit 0 ==== USB-Host (debian) ==== /etc/network/interfaces: allow-hotplug usb0 iface usb0 inet static address 192.168.0.1 netmask 255.255.255.252 post-up iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/30 post-up iptables -A INPUT -m udp -p udp -i usb0 --dport 123 -j ACCEPT post-up echo 1 > /proc/sys/net/ipv4/ip_forward post-up iptables -P FORWARD ACCEPT post-up dnslist="`sep=""; grep "^[ ]*nameserver[ ]" /etc/resolv.conf|sed 's/^[ ]*nameserver[ ]\+//' | while read; do echo -n "$sep$REPLY"; sep=", "; done;`"; dnssearch="`grep "^[ ]*search[ ]" /etc/resolv.conf|sed 's/^[ ]*search[ ]\+//'`"; cat /etc/dhcp3/dhcpd-usb0.conf.tpl | sed "{ s/@@dnslist@@/$dnslist/g; s/@@dnssearch@@/$dnssearch/g; }" > /etc/dhcp3/dhcpd-usb0.conf post-up dhcpd3 -cf /etc/dhcp3/dhcpd-usb0.conf -pf /var/run/dhcpd-usb0.pid usb0 pre-down kill `cat /var/run/dhcpd-usb0.pid` pre-down iptables -D INPUT -m udp -p udp -i usb0 --dport 123 -j ACCEPT pre-down iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/30 /etc/dhcp3/dhcpd-usb0.conf.tpl: subnet 192.168.0.0 netmask 255.255.255.252 { range dynamic-bootp 192.168.0.2 192.168.0.2; option broadcast-address 192.168.0.3; option routers 192.168.0.1; option domain-name "@@dnssearch@@"; option domain-name-servers @@dnslist@@; option ntp-servers 192.168.0.1; } Issues: * Wenn der Host einen neuen domain-name oder eine neue Liste von domain-name-servers bekommt, sollte dhcpd-usb0.conf neu generiert und der jeweilige dhcpd restarted werden. * Falls ntpd benutzt wird (s.u.) wär's wohl gut wenn ebenso die Liste der ntp-servers generiert werden würde. Die folgende Variante sieht zwar wüst aus, funktioniert dafür ohne dhcpd.conf Template und vollautomagisch (muss also nicht an die Interface-IP-Config angepasst werden - dhcp range = range zwischen $host und broadcast). Braucht allerdings die Pakete `sipcalc` und `prips`. /etc/network/interfaces: allow-hotplug usb0 iface usb0 inet static address 192.168.0.1 netmask 255.255.255.252 pre-up network="`sipcalc $IF_ADDRESS $IF_NETMASK|grep "^Network address"|sed "s/^Network address[ \t]*-[ \t]*//"`"; iptables -I POSTROUTING -t nat -j MASQUERADE -s "$network/$IF_NETMASK" pre-up iptables -I INPUT -m udp -p udp -i "$LOGICAL" --dport 123 -j ACCEPT pre-up echo 1 >/proc/sys/net/ipv4/ip_forward pre-up iptables -I FORWARD -i "$LOGICAL" -j ACCEPT pre-up iptables -I FORWARD -o "$LOGICAL" -j ACCEPT pre-up network="`sipcalc $IF_ADDRESS $IF_NETMASK|grep "^Network address"|sed "s/^Network address[ \t]*-[ \t]*//"`"; broadcast="`sipcalc $IF_ADDRESS $IF_NETMASK|grep "^Broadcast address"|sed "s/^Broadcast address[ \t]*-[ \t]*//"`"; last="`sipcalc $IF_ADDRESS $IF_NETMASK|grep "^Usable range"|sed "s/^Usable range[ \t]*-[ \t]*//"|sed "s/.*-[ \t]*//"`"; first="`prips "$IF_ADDRESS" "$last"|tail -n +2|head -n 1`"; dnslist="`sep=""; grep "^[ \t]*nameserver[ \t]" /etc/resolv.conf|sed 's/^[ \t]*nameserver[ \t]\+//' | while read; do echo -n "$sep$REPLY"; sep=", "; done;`"; dnssearch="`grep "^[ \t]*search[ \t]" /etc/resolv.conf|sed 's/^[ \t]*search[ \t]\+//'`"; echo -e "subnet $network netmask $IF_NETMASK {\n\trange dynamic-bootp $first $last;\n\toption broadcast-address $broadcast;\n\toption routers $IF_ADDRESS;\n\toption domain-name "$dnssearch";\n\toption domain-name-servers $dnslist;\n\toption ntp-servers $IF_ADDRESS;\n}" >"/etc/dhcp3/dhcpd-$LOGICAL.conf" post-up dhcpd3 -cf "/etc/dhcp3/dhcpd-$LOGICAL.conf" -pf "/var/run/dhcpd-$LOGICAL.pid" "$LOGICAL" post-down kill "`cat "/var/run/dhcpd-$LOGICAL.pid"`" post-down iptables -D FORWARD -i "$LOGICAL" -j ACCEPT post-down iptables -D FORWARD -o "$LOGICAL" -j ACCEPT post-down iptables -D INPUT -m udp -p udp -i "$LOGICAL" --dport 123 -j ACCEPT post-down network="`sipcalc $IF_ADDRESS $IF_NETMASK|grep "^Network address"|sed "s/^Network address[ \t]*-[ \t]*//"`"; iptables -D POSTROUTING -t nat -j MASQUERADE -s "$network/$IF_NETMASK" ===== ntpd (2do) ===== ntpclient ist nett, aber 'so richtig NTP machen' geht nur mit ntpd. Konkret: * GPS sendet ein Zeitsignal. Wenn wir das schon per Broadcast bekommen, wollen wir das auch als Clock Source nutzen. * GSM kann Zeitinformation broadcasten. Wenn das möglich ist, wollen wir das auch als Clock Source nutzen können (auch wenn .de Telcos zu lame dafür sein mögen). Issues: * GPS: * gpsd als 'Mux' für GPS-Daten-Stream, d.h. Pseudo-tty oder host:port/proto Socket; *:2947/tcp funktioniert zwar, der Start des Streams durch ntpd funktioniert allerdings nicht. Ausserdem scheint der gpsd zusätzliche Zeilen (^GPS.*) zu senden woraufhin wohl der ntpd Clock Driver die Arbeit einstellt. * ntpd-config, NMEA clock driver: server 127.127.20.0 * ln -s localhost:2947 /dev/gps0 * GSM: * Hinweise wie man den Cellbroadcast wirksam einschaltet (und welcher Channel das bei wem ist), werden gerne angenommen. :) * Weitergehende Infos über mögliche weitere GSM-Clock-Sources werden ebenso gerne angenommen. :) * ntpd-config, DUMBCLOCK clock driver: server 127.127.33.0 * ln -s $pty_or_pipe /dev/dumbclock0 * simples Script zwischen $pty_or_pipe und gsmd, das sich ein GSM-Mux-tty holt, regelmässig die Zeit pollt, und dem DUMBCLOCK im erwarteten Format vorwirft. * ntpd: * ntpdc (4.2.4p4, lenny) besteht auf eine keyid, und keyid 0 funktioniert nicht. Hinweise für die Benutzung von ntpdc ohne keyid werden gerne angenommen. :) ===== Deutsches Keyboard für matchbox-keyboard ===== Noch work in progress, aber sicher brauchbar: /usr/share/matchbox-keyboard/keyboard-de.xml: \\ (ln -s keyboard-de.xml /usr/share/matchbox-keyboard/keyboard.xml) Issues: * Manche Keys verhalten sich wie beim multitap-pad (e.g. 2* d ergibt e) * Ctrl Modifier funktioniert irgendwie nur manchmal * Layout is noch nicht ganz korrekt: 1. Zeile/Esc, Ret, #, <, AltGr, Win (Tip: multitap-pad über Click auf's Terminal öffnen, matchbox-keyboard über Panel-Icon öffnen, multitap-pad über Panel-Icon schliessen => Terminal hat Focus) ===== GPRS ===== GPRS und ein GSM-Telefonat sind nicht gleichzeitig möglich. Wird ein Telefonat aufgebaut, killt offenbar irgendetwas automatisch die GPRS-Connection (das gemuxte tty wird jedenfalls offenbar nicht einfach abgebaut). Bei folgendem Setup würde GPRS dann wieder aufgebaut werden sobald das Telefonat beendet ist. ==== GSM Mux ==== Der gsmd belegt /dev/ttySAC0, das tty des GSM-Modems. Es gibt einen GSM-Modem-Demux Daemon - [[http://www.freesmartphone.org/index.php/Implementations/gsm0710muxd|gsm0710muxd]] - der das tty des GSM demuxed und mehrere ttys bereitstellt, der allerdings noch nicht von der Openmoko-Suite benutzt wird. Versuche mit 0.9.1 zeichnen ein einigermassen stabiles Bild. Grundsätzlich funktioniert das ganze ganz gut. Drehen am GSM-Powermanagement/-Reset während der gsm0710muxd läuft führt dazu dass auf die Pseudo-ttys nicht mehr geschrieben werden kann... (lt. syslog: "gsm0710muxd.c:569:pseudo_device_read(): Write to a channel which wasn't acked to be open.") /etc/init.d/gsmd: #!/bin/sh # # gsmd This shell script starts and stops gsmd. # # chkconfig: 345 90 40 # description: Gsmd manages access to a serial-connected GSM # processname: gsmd PATH=/bin:/usr/bin:/sbin:/usr/sbin [ -f /etc/default/rcS ] && . /etc/default/rcS [ -f /etc/default/gsmd ] && . /etc/default/gsmd case "$1" in start) echo -n "Starting GSM daemon: " pid="`fuser "$GSM_DEV"`" if [ -n "$pid" ] && [ "`ps -o comm --no-heading -p $pid`" == "gsm0710muxd" ]; then tty="`dbus-send --system --print-reply --type=method_call --dest=org.pyneo.muxer /org/pyneo/Muxer org.freesmartphone.GSM.MUX.AllocChannel string:gsmd | grep '^[ ]*string' | sed 's/^[ ]*string "\(.*\)"$/\1/'`" else [ -n "$GSM_POW" ] && ( echo "0" >"$GSM_POW"; sleep 1 ) [ -n "$GSM_POW" ] && ( echo "1" >"$GSM_POW"; sleep 1 ) [ -n "$GSM_RES" ] && ( echo "1" >"$GSM_RES"; sleep 1 ) [ -n "$GSM_RES" ] && ( echo "0" >"$GSM_RES"; sleep 2 ) tty="$GSM_DEV" fi start-stop-daemon -S -x /usr/sbin/gsmd -- gsmd -p "$tty" $GSMD_OPTS -d -l syslog if [ "$?" == "0" ]; then echo "gsmd." else echo "(failed.)" fi ;; stop) echo -n "Stopping GSM daemon: " start-stop-daemon -K -x /usr/sbin/gsmd pid="`fuser "$GSM_DEV"`" if [ -z "$pid" ] || [ "`ps -o comm --no-heading -p $pid`" != "gsm0710muxd" ]; then [ -n "$GSM_POW" ] && echo "0" >"$GSM_POW" fi echo "gsmd." ;; restart|force-reload) $0 stop $0 start ;; *) echo "Usage: /etc/init.d/gsmd {start|stop|restart|force-reload}" exit 1 ;; esac exit 0 /etc/init.d/gsm0710muxd: #!/bin/sh # # gsm0710muxd This shell script starts and stops gsm0710muxd. # # chkconfig: 345 90 40 # description: Gsm0710muxd manages multiplexing of a serial-connected GSM # processname: gsm0710muxd PATH=/bin:/usr/bin:/sbin:/usr/sbin [ -f /etc/default/rcS ] && . /etc/default/rcS [ -f /etc/default/gsmd ] && . /etc/default/gsmd case "$1" in start) echo -n "Starting GSM 07.10 Mux daemon: " [ -n "$GSM_POW" ] && ( echo "0" >"$GSM_POW"; sleep 1 ) [ -n "$GSM_POW" ] && ( echo "1" >"$GSM_POW"; sleep 1 ) [ -n "$GSM_RES" ] && ( echo "1" >"$GSM_RES"; sleep 1 ) [ -n "$GSM_RES" ] && ( echo "0" >"$GSM_RES"; sleep 2 ) start-stop-daemon -S -x /usr/sbin/gsm0710muxd -- -x /sys/bus/platform/devices/neo1973-pm-gsm.0 -s $GSM_DEV -d rc=$? while [ "`ps -o comm --no-heading -p \`fuser \"$GSM_DEV\"\``" != "gsm0710muxd" ]; do sleep 1; done if [ "$rc" == "0" ]; then echo "gsm0710muxd." else echo "(failed.)" fi ;; stop) echo -n "Stopping GSM 07.10 Mux daemon: " start-stop-daemon -K -x /usr/sbin/gsm0710muxd [ -n "$GSM_POW" ] && echo "0" >"$GSM_POW" echo "gsm0710muxd." ;; restart|force-reload) $0 stop $0 start ;; *) echo "Usage: /etc/init.d/gsm0710muxd {start|stop|restart|force-reload}" exit 1 ;; esac exit 0 /etc/dbus-1/system.d/gsm0710mux.conf: \\ (Sehr freizügig. Das möchte man sicher sinnvoller/granularer, aber zum ausprobieren/damit's erstmal geht erfüllt's seinen Zweck) Da es für den gsm0710muxd noch kein init Setup gibt: ln -s ../init.d/gsm0710muxd /etc/rc0.d/K36gsm0710muxd ln -s ../init.d/gsm0710muxd /etc/rc1.d/K36gsm0710muxd ln -s ../init.d/gsm0710muxd /etc/rc2.d/S34gsm0710muxd ln -s ../init.d/gsm0710muxd /etc/rc3.d/S34gsm0710muxd ln -s ../init.d/gsm0710muxd /etc/rc4.d/S34gsm0710muxd ln -s ../init.d/gsm0710muxd /etc/rc5.d/S34gsm0710muxd ln -s ../init.d/gsm0710muxd /etc/rc6.d/K36gsm0710muxd Um den Aufruf eines GSM-Terminals zu vereinfachen: gsmterminal.sh #!/bin/sh # # gsmterminal.sh This shell script starts a gsm terminal PATH=/bin:/usr/bin:/sbin:/usr/sbin [ -f /etc/default/rcS ] && . /etc/default/rcS [ -f /etc/default/gsmd ] && . /etc/default/gsmd pid="`fuser "$GSM_DEV"`" if [ -n "$pid" ] && [ "`ps -o comm --no-heading -p $pid`" == "gsm0710muxd" ]; then tty="`dbus-send --system --print-reply --type=method_call --dest=org.pyneo.muxer /org/pyneo/Muxer org.freesmartphone.GSM.MUX.AllocChannel string:terminal | grep '^[ ]*string' | sed 's/^[ ]*string "\(.*\)"$/\1/'`" else [ -n "$GSM_POW" ] && ( echo "0" >"$GSM_POW"; sleep 1 ) [ -n "$GSM_POW" ] && ( echo "1" >"$GSM_POW"; sleep 1 ) [ -n "$GSM_RES" ] && ( echo "1" >"$GSM_RES"; sleep 1 ) [ -n "$GSM_RES" ] && ( echo "0" >"$GSM_RES"; sleep 2 ) tty="$GSM_DEV" fi screen "$tty" pid="`fuser "$GSM_DEV"`" if [ -z "$pid" ] || [ "`ps -o comm --no-heading -p $pid`" != "gsm0710muxd" ]; then [ -n "$GSM_POW" ] && echo "0" >"$GSM_POW" fi ==== PPP ==== Eine Art pppd-wrapper-daemon der dafür sorgt dem pppd immer ein tty zur Verfügung zu stellen. /etc/ppp/gsmpppd.sh: #!/bin/sh # # gsmpppd.sh This shell script starts a gsm pppd PATH=/bin:/usr/bin:/sbin:/usr/sbin [ -f /etc/default/rcS ] && . /etc/default/rcS [ -f /etc/default/gsmd ] && . /etc/default/gsmd [ -f /etc/default/pppd ] && . /etc/default/pppd if [ "$gsmpppd_phase" != "2" ]; then gsmpppd_phase="2" export gsmpppd_phase $0 & exit 0 fi; # making the shell send signals it receives to its children, too, would be # great... we could forget about signal handlers, would not have to care about # children pids, and would not have to detach pppd and then wait for it... sig_handler() { trap "" $1 # i don't know why, but at least TERM is signalled twice? logger gsmpppd.sh: signal $1 received #for i in `jobs -p`; do # does not work with ash - would work with bash for i in $gsmpppd_children; do logger gsmpppd.sh: sending child process $i signal $1 kill -$1 $i done exit 0 } trap "sig_handler HUP" SIGHUP trap "sig_handler INT" SIGINT trap "sig_handler QUIT" SIGQUIT trap "sig_handler KILL" SIGKILL trap "sig_handler TERM" SIGTERM while true; do pid="`fuser "$GSM_DEV"`" if [ -n "$pid" ] && [ "`ps -o comm --no-heading -p $pid`" == "gsm0710muxd" ]; then tty="`dbus-send --system --print-reply --type=method_call --dest=org.pyneo.muxer /org/pyneo/Muxer org.freesmartphone.GSM.MUX.AllocChannel string:pppd | grep '^[ ]*string' | sed 's/^[ ]*string "\(.*\)"$/\1/'`" else [ -n "$GSM_POW" ] && ( echo "0" >"$GSM_POW"; sleep 1 ) [ -n "$GSM_POW" ] && ( echo "1" >"$GSM_POW"; sleep 1 ) [ -n "$GSM_RES" ] && ( echo "1" >"$GSM_RES"; sleep 1 ) [ -n "$GSM_RES" ] && ( echo "0" >"$GSM_RES"; sleep 2 ) tty="$GSM_DEV" fi # as the following two lines are non-atomic, this qualifies as 'ugly' /usr/sbin/pppd file "/etc/ppp/$PPP_FILE.options" connect "chat -v -f /etc/ppp/default.chat -T '$PPP_PHONE' -U '$PPP_APN'" <"$tty" 1>&0 & gsmpppd_children="$gsmpppd_children $!" wait done /etc/init.d/pppd: #!/bin/sh # # pppd This shell script starts and stops pppd. # # chkconfig: 345 90 40 # description: Pppd manages an ip link via a serial device, in this case a gsm data connection # processname: pppd PATH=/bin:/usr/bin:/sbin:/usr/sbin [ -f /etc/default/rcS ] && . /etc/default/rcS [ -f /etc/default/gsmd ] && . /etc/default/gsmd case "$1" in start) echo -n "Starting PPP daemon: " start-stop-daemon -S -x /etc/ppp/gsmpppd.sh if [ "$?" == "0" ]; then echo "pppd." else echo "(failed.)" fi ;; stop) echo -n "Stopping PPP daemon: " #start-stop-daemon -K -x /etc/ppp/gsmpppd.sh # start-stop-daemon won't find it because it's just an argument to its interpreter pkill gsmpppd.sh pid="`fuser "$GSM_DEV"`" if [ -z "$pid" ] || [ "`ps -o comm --no-heading -p $pid`" != "gsm0710muxd" ]; then [ -n "$GSM_POW" ] && echo "0" >"$GSM_POW" fi echo "pppd." ;; restart|force-reload) $0 stop $0 start ;; *) echo "Usage: /etc/init.d/pppd {start|stop|restart|force-reload}" exit 1 ;; esac exit 0 /etc/ppp/flat.options: lock noauth crtscts lcp-echo-failure 3 lcp-echo-interval 20 noipdefault usepeerdns defaultroute replacedefaultroute /etc/ppp/demand.options: \\ (ungetestet, insbes. der active-filter dürfte wohl unter 'symbolische notation' fallen...) lock noauth demand idle 20 active-filter ( outbound dst port 53 ) or ( outbound tcp dst ( port 443 or port 80 or port 25 or port 22 ) or ( inbound tcp src ( port 443 or port 80 or port 25 or port 22 ) ) crtscts lcp-echo-failure 3 lcp-echo-interval 20 noipdefault usepeerdns defaultroute replacedefaultroute /etc/ppp/default.chat: TIMEOUT 15 "" "\K\K\K\d+++ATH" OK-AT-OK ATZ OK ATE1 OK AT+CFUN? +CFUN:\s1-AT+CFUN=1-OK AT+COPS? +COPS:\s0-AT+COPS=0-OK AT+CGDCONT=1,\"IP\",\"\U\" OK ATD\T ABORT BUSY ABORT DELAYED ABORT "NO CARRIER" ABORT "NO ANSWER" ABORT "NO DIALTONE" ABORT VOICE ABORT ERROR ABORT RINGING TIMEOUT 60 CONNECT "" /etc/default/pppd: \\ (Die jeweiligen Werte durch die für den [[http://wiki.openmoko.org/wiki/Manually_using_GPRS#Some_APN_names_for_reference|jeweiligen GSM Provider]] passenden Werte ersetzen - dieses Beispiel ist für EPlus und -Reseller) PPP_PHONE="*99#" PPP_APN="internet.eplus.de" PPP_FILE="flat" Falls für den GPRS-Zugang PAP oder CHAP Authentifizierung notwendig ist, noch die jeweiligen Daten in /etc/ppp/pap-secrets oder /etc/ppp/chap-secrets eintragen. Z.B. so (wieder EPlus und -Reseller, in dem Fall chap-secrets): * "eplus" "gprs" * Die PPP-Connection kann dann also mit /etc/init.d/pppd gestartet und gestoppt werden. PPP_FILE="flat" ist gedacht als 'always on' Variante. Ohne Daten-Flatrate sicher nicht zu empfehlen. PPP_FILE="demand" ist gedacht als 'on demand' Variante - ist aber ungetestet und funktioniert mit an Sicherheit grenzender Wahrscheinlichkeit nicht oder nicht so wie man das will, d.h. man kann davon ausgehen dass bei Benutzung die Welt untergeht. ;) \\ Symlinks zum Starten via init: s.o. analog zum gsm0710muxd - sinnigerweise sollten dann die S-links nach dem Starten des gsmd oder jedenfalls des gsm0710muxd eingetragen werden, bzw. die K-links vor dem Stoppen des gsmd oder gsm0710muxd. Ohne Flatrate will man das vielleicht lieber manuell machen... ===== mplayer ===== mplayer funktioniert (solange das sounddevice funktioniert). ^-vo^performance^scaling^ |xv (default)|%%*%%|fullscreen (unter matchbox-panel), ignoriert aspect| |x11|%%***%%|fullscreen (unter matchbox-panel), skaliert nicht (letterbox)| |fbdev|%%**%%|nein. da der xserver ebenfalls fb benutzt, wird X einfach oben links überschrieben| |fbdev2|%%***%%|nein. da der xserver ebenfalls fb benutzt, wird X einfach oben links überschrieben| ===== Audio ===== Audio überlebt Suspend/Resume nicht. Dafür gibt es offenbar schon seit längerem einen Fix von [[http://moko.mwester.net/|mwester]]. opkg install pulseaudio-misc wget http://moko.mwester.net/download/gtkuser.mw10.tgz tar xzf gtkuser.mw10.tgz cd gtkuser; ./install.sh ===== Disable suspend if on external power ===== Supernervig: Neo am USB, per ssh auf dem Neo - *click* Suspend-Timeout schlägt zu. \\ Was man meistens wahrscheinlich will wäre Suspend auszuschalten falls External Power verfügbar ist. \\ Der wohl direkte Weg dorthin führt über ein Script das vom apmd beim entsprechenden Event ausgeführt wird: /etc/apm/event.d/change_power: #!/bin/sh BAT_PM="0" # FULL EXT_PM="1" # DIM_ONLY # NONE == 2 if [ -r /etc/default/power_management ]; then . /etc/default/power_management fi self="`basename $0`" logger "apm $self[$$] called with $1 $2" if [ "$1" == "change" ] && [ "$2" == "power" ]; then neodpid=`echo \`ps -C neod --no-heading -o pid\`` eval "`grep "^DBUS_SESSION_BUS_ADDRESS=" /proc/$neodpid/environ`" export DBUS_SESSION_BUS_ADDRESS bat_online=`cat /sys/class/power_supply/bat/online` logger "apm $self[$$] bat/online=$bat_online" if [ "$bat_online" == "1" ]; then gconftool-2 -s /desktop/openmoko/neod/power_management -t int $EXT_PM elif [ "$bat_online" == "0" ]; then gconftool-2 -s /desktop/openmoko/neod/power_management -t int $BAT_PM fi logger "apm $self[$$] gconf:/desktop/openmoko/neod/power_management now `gconftool-2 -g /desktop/openmoko/neod/power_management`" fi Issues: * Es muss doch einfacher möglich sein gconftool-2 die Kommunikation mit dem gconfd-2 zu ermöglichen (als hier, über das Auslesen der passenden Environment-Variable des neod). Es gäbe da ein /var/run/dbus/system_bus_socket... * Eigentlich möchte man dem neod noch beibringen seine Timer auch zu resetten wenn in irgendeiner Shell mit tty activity ist... * Obiges geht davon aus, dass bei einer Änderung der gconf Werte die *_gconf_cb Funktion in neod aufgerufen wird. (Liest sich jedenfalls so... ;) ===== Buglist ===== * usb0 ist immer UP => auch wenn USB abgesteckt wird, geht das Interface nicht down. D.h. wird USB wieder eingesteckt, wird usb0 nicht wieder neu hochgefahren und kein dhcp client request ausgeführt. * Suspend wird während Reboot/Shutdown nicht disabled. D.h. es kann passieren dass mitten im Reboot/Shutdown suspendet wird. (Sollte sich leicht mit rc6/rc0 Script lösen lassen) * Die PIN-Eingabe hat kein Backspace. Es fehlt ein kanonischer Weg die PIN später einzugeben. * openmoko-mediaplayer2/gstreamer spielt keine Videos ab. Wahrscheinlich ein gstreamer Problem. (mplayer funktioniert) * Folgende Funktionen stürzen ggf. manchmal einfach ab: * Powerbutton (selten) * Switch to landscape mode * Dialer/Telefonierfunktion (selten) * Folgende Funktionen verhalten sich sonderbar: * Manchmal (Auslöser unbekannt) schaltet der X-Server (?) plötzlich den Mousepointer ein, was zu Chaos bei der Texteingabe führt. * Dim/Lock/Suspend (Powerbutton-Menu): ersetzt man Lock durch Suspend, beschreibt das die tatsächliche Funktionalität. * Missed Calls erscheinen nach einem Neustart wieder im openmoko-today2 * busybox less kennt kein / oder ? * busybox vi kennt kein . * openmoko-browser2 kann noch kein SSL * Shell-Activity sollte den Suspend-Timer zurücksetzen ====== Openmoko 2008 Distribution ====== Das Ganze ist Freerunner und Openmoko 2008 spezifisch (nach erfolgreichem 'opkg update; opkg upgrade'), aber vielleicht auch sonst hilfreich. ===== USB "Ethernet" mit dhcp ===== Funktioniert [[#usb_ethernet_mit_dhcp|wie bei Openmoko 2007]]. ===== Audio ===== Der bei 2007 erwähnte Fix von [[http://moko.mwester.net/|mwester]] ist zwar eingebaut, Audio überlebt Suspend/Resume aber trotzdem nicht mehr. Abhilfe schafft ein zusätzlicher Pulseaudio Suspend/Resume Cycle nach dem Resume. In /etc/apm/resume.d/gsm_resume hinzufügen: ... sleep 5 pactl suspend-sink 1 pactl suspend-sink 0 echo "enabling GSM..." ... ===== Disable suspend if on external power ===== Das Suspend-Verhalten wie oben bei 2007 erwähnt ist bei 2008 im Prinzip das selbe. Der neod ist allerdings entfernt worden, das Suspenden übernimmt dafür ompower, was nicht mehr mit gconf sondern mit DBUS-Messages arbeitet. /etc/apm/event.d/change_power: #!/bin/sh self="`basename $0`" logger "apm $self[$$] called with $1 $2" if [ "$1" == "change" ] && [ "$2" == "power" ]; then ompowerpid=`echo \`ps -C ompower --no-heading -o pid\`` eval "`grep "^DBUS_SESSION_BUS_ADDRESS=" /proc/$ompowerpid/environ`" export DBUS_SESSION_BUS_ADDRESS bat_online=`cat /sys/class/power_supply/bat/online` logger "apm $self[$$] bat/online=$bat_online" if [ "$bat_online" == "1" ]; then dbus-send --system --dest=org.openmoko.Power / org.openmoko.Power.Core.RequestResourceState string:cpu string:external-power string:on elif [ "$bat_online" == "0" ]; then dbus-send --system --dest=org.openmoko.Power / org.openmoko.Power.Core.RemoveRequestedResourceState string:cpu string:external-power fi logger "apm $self[$$] dbus:org.openmoko.Power/ cpu now `dbus-send --system --print-reply --dest=org.openmoko.Power / org.openmoko.Power.Core.GetResourceState string:cpu`" fi ===== Buglist ===== * usb0 immer UP, siehe 2007 * Manchmal fehlt die initiale PIN-Abfrage (das ist möglicherweise inzwischen gefixed). Es fehlt ein kanonischer Weg die PIN später einzugeben. * Die Installation von illume-config schlägt fehl. D.h. insbesondere es gibt keinen Keyboard-Button im Top Shelf. Das ist besonders nervig, da... * ...bei manchen Applikationen das Keyboard sich nicht automatisch aktiviert, z.B. bei xterm und openmoko-terminal2. * Manchmal lässt sich nach einem Suspend das Display nicht mehr einschalten. Ein Un-Suspend funktioniert zwar prinzipiell, das Display bleibt aber aus. Ein Versuch den xserver zu restarten, führt zu einem sofortigen Suspend, danach wird bei Un-Suspend-Versuchen nach etwa 10 Sek. immer wieder suspendet. Nach dem 5. oder 6. Versuch gelingt das Un-Suspend und der xserver-Start (das mit dem Display ist möglicherweise inzwischen gefixed, Suspend-Loops gibt's aber wohl noch). ====== Debian Distribution ====== Dafür gibt's eine [[openmoko:debian|eigene Seite]]. ====== U-Boot ====== ===== Buglist ===== * Aktuelle openmoko-u-boots (getestet mit [[http://buildhost.openmoko.org/daily/freerunner/200808/20080809/u-boot-gta02v5-1.3.1+gitr54+dc633f4be2527f844158aa5085c278b0c3039d3f-r0.bin|20080809 daily]]) supporten wie angekündigt ext2/3. Booten von SD-Card funktioniert, wie wohl generell auch von SDHC-Card - lustige Effekte wurden aber zumindest bei folgender SDHC-Card beobachtet: * "SanDisk Mobile Premier High Performance + TrustedFlash 8GB microSDHC Card with Reader" * Wird als 3MB SDHC-Card erkannt bzw. angezeigt * Booten von dieser Karte funktionierte (in mehreren verschiedenen Fällen) erst nach erneutem Partitionieren mit fdisk (!?) * ext2load kann (getestet mit dem Fall: 4 Partitions a 2GB) nur von Partition 1 und 2 booten, aber nicht von Partition 3 * Manchmal wird zwar der Kernel geladen, das root fs (von dem vorher der Kernel gebootet wurde!?) kann danach aber nicht gemountet werden ====== Kapsel ====== $killerapplikation ;) Zutaten: * [[http://linux.pte.hu/~pipas/gtkdialog/|gtkdialog]] - selbercompilen * [[http://sourceforge.net/projects/sshpass/|sshpass]] - selbercompilen damit sshpass auch mit encrypted keyfiles umgehen kann, braucht's einen patch: \\ (das kapsel.sh benutzt btw dieses gepatchte sshpass, und geht davon aus, dass das sshpass.patched heisst) --- main.c.orig 2008-08-29 13:15:31.000000000 +0200 +++ main.c 2008-08-29 13:28:49.000000000 +0200 @@ -41,6 +41,7 @@ int runprogram( int argc, char *argv[] ); struct { + const char *compare; enum { PWT_STDIN, PWT_FILE, PWT_FD, PWT_PASS } pwtype; union { const char *filename; @@ -52,6 +53,7 @@ struct { static void show_help() { printf("Usage: " PACKAGE_NAME " -fdph command parameters\n" + " -c string string used to detect password prompt\n" " -f filename Take password to use from file\n" " -d number Use number as file descriptor for getting password\n" " -p password Provide password as argument (security unwise)\n" @@ -77,8 +79,12 @@ static int parse_options( int argc, char fprintf(stderr, "Conflicting password source\n"); \ error=-3; } - while( (opt=getopt(argc, argv, "+f:d:p:heV"))!=-1 && error==0 ) { + while( (opt=getopt(argc, argv, "+f:c:d:p:heV"))!=-1 && error==0 ) { switch( opt ) { + case 'c': + // string to detect password prompt + args.compare=optarg; + break; case 'f': // Password should come from a file VIRGIN_PWTYPE; @@ -261,15 +267,15 @@ int handleoutput( int fd ) // We are looking for the string static int prevmatch=0; // If the "password" prompt is repeated, we have the wrong password. static int state; - static const char compare[]="assword:"; +// static const char compare[]="assword:"; char buffer[40]; int ret=0; int numread=read(fd, buffer, sizeof(buffer) ); - state=match( compare, buffer, numread, state ); + state=match( args.compare, buffer, numread, state ); - if( compare[state]=='\0' ) { + if( args.compare[state]=='\0' ) { if( !prevmatch ) { write_pass( fd ); state=0; @@ -296,6 +302,9 @@ int match( const char *reference, const if( reference[state]==buffer[i] ) state++; } + if ( state == strlen(reference) ) { // to match like /string/ and not /string$/ + break; + } } return state; nach dem zusammenrühren einfach nach /home/root kippen bzw. pfade im script an die location anpassen. auch noch wichtig: openssh client installieren, der dropbear client wird damit nicht klarkommen. \\ opkg install openssh-ssh das ganze ist für Openmoko 2007 zubereitet. das script funkt aber auch als textmode script, oder mit gtk (gnome). ~/.kapsel: IFACE="eth0" ESSID="luftschleuse.muc.ccc.de" HOST="192.168.2.1" KEYFILE=~/kapselpwd /usr/share/applications/kapsel.desktop: [Desktop Entry] Encoding=UTF-8 Name=Kapsel Comment=Open/Close Kapsel Exec=/home/root/kapsel.sh Icon=muc3greyknotonwhite128 Terminal=false Type=Application Categories=GTK;Application;Utilities; MimeType=text/x-vcard; SingleInstance=true StartupNotify=true /home/root/kapsel.sh: #!/bin/sh if [ "$phase" != "2" ]; then if [ -e ~/.kapsel ]; then . ~/.kapsel export IFACE export ESSID export HOST export KEYFILE else echo "Resource-file ~/.kapsel not found. Exiting." exit 1 fi if [ -e /tmp/kapsel_result.tmp ]; then rm -f /tmp/kapsel_result.tmp fi export phase="2" if [ -n "$DISPLAY" ]; then /home/root/gtkdialog -e "$0" exit fi fi _ssh() { if [ -n "$password" ]; then if [ -n "$KEYFILE" ]; then result=`/home/root/sshpass.patched -c "Enter passphrase for key " ssh "$1"@"$HOST" -T -o "ForwardX11 no" -o "NumberOfPasswordPrompts 1" -o "PasswordAuthentication no" -i "$KEYFILE" 2>&1 <&1 <&1` else result=`ssh "$1"@"$HOST" -T -o "ForwardX11 no" -o "NumberOfPasswordPrompts 1" -o "PubkeyAuthentication no" 2>&1` fi fi echo "$result" >/tmp/kapsel_result.tmp } if [ "`iwconfig "$IFACE" |grep ESSID|sed \"s/.*ESSID:\\\"\(.*\)\\\".*/\1/\"`" ! = "$ESSID" ]; then ifdown "$IFACE" iwconfig "$IFACE" essid "$ESSID" ifup "$IFACE" fi if [ -n "$DISPLAY" ]; then export MAIN_DIALOG=' RESULT [ -e /tmp/kapsel_result.tmp ] && cat /tmp/kapsel_result.tmp password /usr/share/pixmaps/muc3greyknotonwhite128.png ' else action="$1" if [ "$action" != "open" ]; then action="close" fi _ssh "$action" echo "$result" fi das [[http://brezn.muc.ccc.de/~x/muc3greyknotonwhite128.png|logo]] gehört nach /usr/share/pixmaps/ {{tag>projects}}