Using the Nokia N70 (and other Series 60 phones) on Linux (Fedora)



Introduction

This guide is a bit out-dated now – but you may still pick up some useful information.

If you have a Nokia "Series 60" telephone, such as the Nokia N70 or certain other N- or Communicator models and Linux, then this guide is for you. It is not complete, but I do want to make it as thorough as I can as I discover more. The phone comes from Nokia’s "PC Suite" for Windows – not much use for Linux users. However, it generally uses technology for which Linux solutions exist.

I’m using Fedora 7, but Linux systems are generally similar enough that if I got something working then you should be able to do too, give a little tweak here and there. Here’s a status report on how far I’ve got. The second column tells you whether I got the feature working; the third tells you whether I found someone else on the Internet who did.

Feature Index

(Follow the link for the feature to skip to that part of my notes).

Feature Status for Me Anyone Else?
Copy files to and from the phone YES YES
Play back movies recorded on the phone YES YES
Use the phone as a GPRS/EDGE modem (Internet dial-up) YES YES
Copy contacts to/from phone Partial – from only YES
Synchronise calendar to/from phone Not yet Don’t know
Copy notes to/from phone Not yet Don’t know
Send and read SMS messages from computer Sending only Don’t know

For the features which I haven’t got working yet, from what I’ve read there is a higher chance of success if you use a Bluetooth or infra-red connection to the phone (I was using a USB cable); if you install "gnapplet" on the phone you can then speak to it and do all kinds of things. Google for "gnapplet" to get some more help on these.

Now I will tell you what I know about getting these things working…


1. Copying Files

The Nokia phone speaks a standardised protocol called Obex. To get this working on Fedora, I needed to install the "obexftp" and "obexfs" packages. The first is a command-line tool; the second allows the phone to be mounted as part of the normal Linux filesystem (and hence for you to use all the command-line tools, e.g. ls, cp, mv etc., or to browse it via your desktop file browser).

% su -c "yum install obexftp obexfs"

KDE also contains a component (a "kioslave", kio_obex) which allows the phone to be easily browsed and used in Dolphin, Konqueror or whatever other application by using URLs beginning with obex:/. (GNOME also has an equivalent, but I’ve never tried it). However, as far as I can tell, this only works if you are connecting to the phone via Bluetooth or infra-red, whereas I am using a USB cable. KDE and GNOME both seem to have a quite a large number of utilities for communicating via Bluetooth. I haven’t used any of them, but I believe that the packages you need on KDE is called kdebluetooth ("yum install kdebluetooth"). "help:/kdebluetooth" on KDE will get you some more help on this. I think you will also need to ensure that the Bluetooth services are started on your computer (/sbin/service bluetooth start) and that Bluetooth is activated from the phone’s menu.

I found that when you plug the phone in, it can only be used by the root user due to device ownership issues. Hence, I needed to configure Fedora to have the device file accessible to whoever was logged in on the machine. If accessing things as the root user doesn’t bother you, or if you are using Bluetooth or infra-red instead of USB like me, you can skip this bit. Users of other distributions might find that the approach needed is different; here in Fedora the approach was to configure udev to set the device to be owned by the logged-in user; I think that Debian and Ubuntu users instead have the device owned by a group that their user also belongs to, which simplifies the configuration.

My method was probably something of a hack, as I am a bit of a novice in some of the bits here. But, it worked for me. I also had to contend with the fact that SELinux needed to be configured to allow the operations I was doing – I didn’t want to turn SELinux off. Here’s what I did:

1. Create an executable file /etc/udev/nokian70.sh with these contents:

#!/bin/sh

[ -n "${DEVICE}" ] && DEVICE=$1

if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
then
    # Idea and code from Nalin Dahyabhai 
    if [ -f /var/run/console/console.lock ]
    then
        CONSOLEOWNER=`cat /var/run/console/console.lock`
    elif [ -f /var/lock/console.lock ]
    then
        CONSOLEOWNER=`cat /var/lock/console.lock`
    else
        CONSOLEOWNER=
    fi
    if [ -n "$CONSOLEOWNER" ]
    then
        chmod 0000 /dev/${DEVICE#/proc}
        chown "$CONSOLEOWNER" /dev/${DEVICE#/proc}
        chmod 0600 /dev/${DEVICE#/proc}
    fi
fi

Remember to make it executable (chmod +x /etc/udev/nokian70.sh).

2. Then create a file with name /etc/udev/rules.d/XX-nokian70.rules with these contents:

ACTION=="add", DRIVER!="?*", ENV{MODALIAS}=="usb:v0421p043Ad0000dc02dsc00dp00ic02isc0Bip00", RUN+="/etc/udev/nokian70.sh $env{DEVICE}"

If your phone is not a Nokia N70, then you will need to use a different sequence in the MODALIAS bit above. To find out what, plug the phone in and run the command "lshal". Then find in the output the string "PC Suite":

# lshal|grep -A 8 "PC Suite"
  usb.interface.description = 'PC Suite Services'  (string)
  usb.interface.number = 6  (0x6)  (int)
  usb.interface.protocol = 0  (0x0)  (int)
  usb.interface.subclass = 11  (0xb)  (int)
  usb.is_self_powered = true  (bool)
  usb.linux.device_number = 11  (0xb)  (int)
  usb.linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:13.1/usb2/2-1/2-1:1.6'  (string)
  usb.max_power = 100  (0x64)  (int)
  usb.num_configurations = 1  (0x1)  (int)

Then run the sysfs_path through udevtest:

# udevtest /sys/devices/pci0000:00/0000:00:13.1/usb2/2-1/2-1:1.6 | grep MODALIAS
import_uevent_var: import into environment: 'MODALIAS=usb:v0421p043Ad0000dc02dsc00dp00ic02isc0Bip00'

udev should not need restarting as it should detect the new configuration automatically.

3. If you have SELinux activated, create and load a policy file.

Create a file named NokiaN70.te anywhere with these contents:

module NokiaN70 1.0;

require {
        type udev_t;
        type usbfs_t;
        class file getattr;
        class file setattr;
}

#============= udev_t ==============
allow udev_t usbfs_t:file getattr;

Then run these commands (the last must be run as root):

# checkmodule -M -m -o NokiaN70.mod NokiaN70.te
# semodule_package -o NokiaN70.pp -m NokiaN70.mod
# semodule -i NokiaN70.pp

Now if you disconnect the phone and connect it again, there should be device files owned by the logged in user. If not, then looking in /var/log/messages, /var/log/audit/audit.log, dmesg and using tools such as sealert, udevtest and udevmonitor is the way forward… but can be quite painful if it’s all new to you. If it’s too much, you might find it easier just to use Bluetooth (you’ll have to buy a Bluetooth card for your computer if you don’t have one) or operate as root.

4. Go go go!

At this point you should be able to run the command "obexftp -u" and then "obexftp -u 1 -l / " (or maybe with 0 instead of 1) to list the contents of the phone. If it doesn’t work, try again as root – if it works as root, then the device files aren’t correctly owned.

To access the files in a more convenient way (by mounting the phone into the normal filesystem tree, using FUSE), use obexfs. Steps are:

  1. Add your user to the "fuse" group. (/usr/sbin/usermod -a -G fuse david). Change "david" for your actual username.
  2. Create a directory for the phone to be mounted at (e.g. mkdir ~/.NokiaN70).
  3. Create a script to mount or umount the phone (contents below).
  4. Create an icon (.desktop file) to run the script.

For step 3, the script looks like this. If you are using BlueTooth, then instead of "-u 1" you should use "–bluetooth AA:BB:CC:DD:EE:FF", replacing the AA:BB:CC:DD:EE:FF with the correct device ID for your phone.

#!/bin/sh

MPOINT=$HOME/.NokiaN70

mkdir $MPOINT

if [ "`mount | grep obexfs|grep $MPOINT`" = "" ]; then
        obexfs -u 1 $MPOINT
        xdg-open $MPOINT
else
        fusermount -u $MPOINT
fi

You will need the "xdg-utils" package installed (yum install xdg-utils).

To create an icon in KDE that runs the above script when you click on it, just right-click on the desktop background, and create a link to an application; for the application, enter the location of your script above. Remember to make the script executable.

If you’ve done all that succesfully, then clicking on the icon should open up a window showing the contents of the phone. The two directories shown are C:/ for the phone’s internal memory, and E:/ for the memory card. Within those directories you should be able to find all your photos, movies, downloads, etcetera – and be able to upload any documents you want to e-mail, give to someone else, beam via Bluetooth, view in the built-in PDF reader, etcetera.


2. Play back recorded movies

To get the movie files from the phone onto your computer, you’ll need to follow the instructions above.

mplayer (which you run from the commmand line) and kplayer (which is a KDE application) built on top of mplayer, available from the Livna repository, can be used to play back the higher quality movies recorded (.mp4 files). There may be patent laws in existence in your jurisdiction which forbid you from using this software – you should do your own research.

mplayer/kplayer are at the time of writing able to play the video of the lower quality files (.3gp files) that the phone records, but not the sound. Realplayer, a proprietary application that has no patent problems in the jurisdictions it is available in, is able to play the video and the sound.



3. Use the phone as a GPRS/EDGE modem.

You can probably use these instructions to use the phone as a UTS (3G) modem as well – but I wouldn’t know as there are no 3G networks where I live (they’re in other parts of the city, apparently – but not my neighbourhood yet).

First, you should make sure that you can get your phone to access the Internet on its own, without the computer – otherwise you may be looking in the wrong place for your problem if things don’t work. The N70 has built-in e-mail and web browser applications – first make sure that one of these works.

For me, the phone "just works" using the standard system-config-network tool on Fedora with the phone connected via a USB cable, or via Bluetooth. The details for the cable were as follows (many other baud rates worked too):

Modem via USB cable

Number to dial *99#
Modem device /dev/ttyACM0
Baud 460800

Your phone will use its default Internet access point to connect; the number dialed (*99#) has no significance other than being the magic number that tells a Nokia Series 60 phone to dial the Internet. For me, anything could be put in as the username and password, as the authentication is done via the SIM card rather than via this. The standard tools on Fedora use the "wvdial" dialing package which does the hard work of negotiating the connection and invoking the ppp daemon, and these are the contents of /etc/wvdial.conf that system-config-network sets up:

[Modem0]
Modem = /dev/ttyACM0
Baud = 460800
SetVolume = 0
Dial Command = ATDT
Init1 = ATZ
Init3 = ATM0
FlowControl = NOFLOW
[Dialer MyISP]
Username = anything
Password = anything
Phone = *99#
Stupid Mode = 1
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Inherits = Modem0

Here is the ifcfg file (from /etc/sysconfig/networking-scripts) I use successfully together with it on Fedora:

TYPE=Modem
DEVICE=ppp0
BOOTPROTO=dialup
ONBOOT=no
USERCTL=yes
PEERDNS=yes
AC=off
BSDCOMP=off
VJCCOMP=off
CCP=off
PC=off
VJ=off
LINESPEED=460800
MODEMPORT=/dev/ttyACM0
PROVIDER=MyISP
DEFROUTE=yes
PERSIST=no
PAPNAME=anything
WVDIALSECT=MyISP
MODEMNAME=Modem0
DEMAND=no
IPV6INIT=no
IDLETIMEOUT=600

If you are connecting to your phone via BlueTooth instead of USB, then the device will be different. It might be something like /dev/rfcomm0, but I do not know. Use the "dmesg" command to get some tips.

For some reason the Nokia always returns "10.6.6.6" as the IP gateway address, which didn’t used to work. I used to have to use the following script installed in /etc/ppp/ip-up.local to over-ride it (the IP address has been changed to aaa.bbb.ccc.ddd … it was specific to my carrier so was no good for you unless you are using the same service as me). However, a couple of months later, everything started working without it. Go figure! Whether my ISP changed, or whether an update to my Linux installation fixed it, I don’t know.

#!/bin/sh

# Add correct default gateway
# This must be done first - nothing is routable without it!
if [ "$6" = "MyISP" -a "$5" = "10.6.6.6" ]; then

        /sbin/route add default gw aaa.bbb.ccc.ddd

fi

There is a useful program that exists (with both a desktop and command-line client) called "GPRS Easy Connect" which has done the hard work of collecting all the different settings needed for a whole variety of GPRS phones and ISPs. I used it succesfully but seeing as Fedora’s standard tools worked fine it wasn’t necessary in the long term. I found that "GPRS Easy Connect" also wanted me to make my pppd daemon setuid-root (chmod +s /usr/sbin/pppd) before it would work, and replace the Fedora-supplied /etc/ppp/ip-up. You can find this useful program at http://www.gprsec.hu/modules/downloads/list.php?category=1.

Modem via Bluetooth

In a nutshell:

  1. Get the bluetooth services on your machine working ("yum install bluez-utils ; /sbin/service bluetooth start") – though I think these are on by default on Fedora so this step may be redundant.
  2. Find out the bluetooth address of your phone ("hcitool scan")
  3. Create the link to the modem using this command, replacing the AA:BB:CC:DD:EE:FF with the actual address of your phone: "rfcomm connect /dev/rfcomm0 AA:BB:CC:DD:EE:FF 3". The command "sdptool search DUN" will be useful if your phone uses a different channel to 3.
  4. Then, do exactly the same as with the cable, except use /dev/rfcomm0 instead of /dev/ttyACM0. Your phone will likely ask you to accept the request to connect. You will also need to be running a bluetooth applet on your desktop to set up the connection; the GNOME applet runs by default I believe, but I use KDE: "yum install kdebluetooth" as root and then "/usr/bin/kbluetooth" as the logged in user.

To avoid having to repeat steps 1-3 each time you should do "/sbin/chkconfig –level 345 bluetooth on" and create a file named BluetoothModem.desktop on your desktop backdrop with these contents (changing the Bluetooth address again as appropriate).

[Desktop Entry]
Comment=
Comment[en_GB]=
Encoding=UTF-8
Exec=rfcomm connect /dev/rfcomm0 AA:BB:CC:DD:EE:FF 3
GenericName=Connect via Bluetooth to Modem on Nokia 70
GenericName[en_GB]=Connect via Bluetooth to Modem on Nokia 70
Icon=kbluetooth
MimeType=
Name=N70 Modem
Name[en_GB]=N70 Modem
Path=
StartupNotify=false
Terminal=true
TerminalOptions=-T "Connect to Nokia N70 modem via Bluetooth" --vt_sz 58x4 --notabbar --noscrollbar
Type=Application
X-DCOP-ServiceType=none
X-KDE-SubstituteUID=true
X-KDE-Username=root

4. Sending SMS messages

To do this, I used gammu (yum install gammu). I saved this configuration file with the name .gammurc in my home directory:

[gammu]
port = /dev/ttyACM0
connection = at19200
model =

Then, this command from the command line succesfully sent an SMS (replace the xxxxxxxx with a real telephone number):

# gammu sendsms TEXT 07xxxxxxxx
(type text in, then press Control-D).

I also succesfully sent an SMS message using the program kmobiletools (yum install kmobiletools). If you want to use gammu, kmobiletools or similar tools without being root, you will need to set up the ownership on the /dev/ttyACM0 device. I did this in Fedora 7 by adding the following file as /etc/security/console.perms.d/99-nokian70.perms before plugging in the USB cable:

<modem>=/dev/ttyACM*

# permission definitions

<console> 0664 <modem> 0664

I think that this method is deprecated in Fedora 8 and likely to disappear with Fedora 9, but I do not know much about this. If you are using Bluetooth or infra-red then the name of the device will be different to /dev/ttyACM*.




Links:

  1. A quick guide to using an N70 as a modem by Bluetooth
  2. Recently I have written this parable about Richard Dawkins.
  3. I also wrote this website and this blog exposing a bogus group of science educators.
  4. My homepage.



Feedback / E-mail / Anything I forgot to mention?: Use the e-mail address on my homepage. (Of course, please try Google first).

Print This Page Print This Page

Leave a Reply