User:Jebba/Ofono

(Connect N900)
Line 40: Line 40:
=Connect N900=
=Connect N900=
-
Plug in fone to laptop via USB. Select "PC mode" or wtf it's called in English.
+
Plug in fone to laptop via USB. Select "PC Suite" mode.
-
 
+
=ofonod=
=ofonod=

Revision as of 03:33, 6 January 2010

  • Quick and dirty.

Contents

Build ofono

On laptop.

Check build deps, and make sure your ./bootstrap-configure finds them all.

git clone git://git.kernel.org/pub/scm/network/ofono/ofono.git

cd ofono

./bootstrap-configure

make


modem.conf

On laptop.

You need a modem.conf file like this. I put it in /etc/ofono/modem.conf and /usr/local/etc/ofono/modem.conf... (havent confirmed which it's using, depends if you make install or not i think).

[atgen]
Driver=atgen
Device=/dev/ttyACM0
Baud=115200

dbus

On laptop.

If not doing make install, you'll need to copy this file over:

cd ofono

cp -p ./src/ofono.conf /etc/dbus-1/system.d/ofono.conf
  • You then need to reload dbus. Reboot is a lame way to restart it. Heh. Or reload messagebus or whatever.


Connect N900

Plug in fone to laptop via USB. Select "PC Suite" mode.

ofonod

On laptop.

Run this as root:

cd ofono

export OFONO_AT_DEBUG=1

./src/ofonod -nd

Now ofonod daemon is running, so you can watch wtf is going on in that xterm.


enable modem

On laptop, in different xterm as the ofonod is happily running in other xterm.

DO *NOT* run this as root. Run as regular user:

cd ofono

./test/enable-modem

You can watch the fun go by in the other terminal.

Make f1rst fone call

On laptop.

DO *NOT* run this as root. Run as regular user, substituing 5551212 for who you want to call:

./test/test-voicecall 5551212

Chill

Ok, so that works. Now you can try some other scripts in test/

dbus-send

Here's a few dbus sends, I've only tested one so far.

ofono-dial

#!/bin/sh

sudo dbus-send --print-reply --system --dest=org.ofono /atgen0 org.ofono.VoiceCallManager.Dial string:"48990591" string:""

ofono-get-properties

#/bin/sh

sudo dbus-send --system --print-reply --dest=org.ofono /atgen0 org.ofono.Modem.GetProperties


ofono-get-properties-sms

#!/bin/sh

sudo dbus-send --system --print-reply --dest=org.ofono /atgen0 org.ofono.SmsManager.GetProperties

ofono-power-on

#!/bin/sh

 sudo dbus-send --system --type=method_call --print-reply \
 --dest=org.ofono  /atgen0 org.ofono.Modem.SetProperty string:"Powered" \
 variant:boolean:true


ofono-register

#!/bin/sh

sudo dbus-send --system --print-reply --type=method_call --dest=org.ofono /atgen0 org.ofono.NetworkRegistration.Register

Thanks

Much thanks to zhenhua1 in #ofono for his help :)