N900: Running ofono with a 4.x kernel
robotanarchy edited this page Apr 8, 2016
·
9 revisions
Clone this wiki locally
Preparation
Alternative 1) gpio switch with nokia-modem pm=0
Use the linux-n900 kernel (eg. with the debian900 scripts). Boot it up, then run modprobe nokia-modem pm=0. A phonet0 device should appear:
# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: upnlink0: <POINTOPOINT,NOARP> mtu 65541 qdisc noop state DOWN group default qlen 1
link/phonet 1b peer 00
3: usb0 ...
4: wlan0 ...
17: phonet0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 4000 qdisc pfifo_fast state UP group default qlen 100
link/phonet 15 peer 00
family 35 ???/0 scope link
Alternative 2) recompile linux-n900 kernel without gpioswitch && gpio from nokia-modem
(Untested half knowledge) From what I understand, this is basically the stock kernel. You will need:
- exported GPIOS in
/dev/cmt/(run the following:ln -sf /sys/bus/hsi/devices/n900-modem /dev/cmt) - the
phonet0network device (try modprobing some modules; you might need to edit the rules in/lib/udev/rules.d/97-ofono.rules(Debian path), if there is such a file.)
Running ofonod in debug mode
- If ofonod is already started (check with
ps ax | grep ofonod), kill it withkillall ofonod. - Start ofonod in debug mode and in foreground:
OFONO_ISI_DEBUG=1 OFONO_ISI_TRACE=1 ofonod -nd
Using ofonod
Ofono provides a D-Bus interface. There are various ways to interact with that, using the python3 test scripts from the ofono source code, using mdbus2 and many others. Here is nice step-by-step guide using mdbus2.
Example with the Python3 scripts:
./list-modems # useful debug info, lists if the pin has been typed in etc.
./enable-modem
./enter-pin pin 12345
./online-modem
./register-auto # prints a dbus timeout, but seems to connect anyway?
./send-sms 55513371338 "hello world" 0
./receive-sms # run this and *then* send a message. I could not receive messages which have already been sent that way.
...
Troubleshooting
I guess after symlinking, systemd was stuck at booting with the message "waiting for all network devices". Pressing CTRL+C continues booting though.
Related Links
- http://musicnaut.iki.fi/comp/linux/nokia_modem.html
- http://permalink.gmane.org/gmane.linux.kernel/1700770 (stock kernel infos)
- http://wiki.maemo.org/User:Jebba/Ofono
- http://mg.pov.lt/maemo-irclog/%23maemo.2016-04-07.log.html (especially messages from Pali and Wizzup)
- http://elinux.org/N900
- https://github.com/pali/linux-n900
Thanks to
in alphabetic order
- Aaro
- Pali
- sre
- Wizzup