Nokia 6310i

From Smop.co.uk

Jump to: navigation, search

This guide shows how to connect a Nokia 9210i phone to your Linux box, in particular a Thinkpad T21. I'll start by talking to the phone via IRDA (infrared), then show how to dial out, enable GPRS and finally go through the bluetooth settings. This guide does not explain PPP, there are better documents out there for that.

Contents

IRDA

First of all, ensure your BIOS hasn't disabled the IR port. Ensure your kernel has all the relevant IRDA stuff compiled in.

Activate the infrared on the phone (menu item number 10) - you will see a little laser beam type symbol flashing away in the corner of the screen. Now type "irdadump" - watch for the packets - one of them will say something like "Nokia 6310i". You ca n now stop irdadump.

Phoning

In /etc/ppp/peers/provider you want something like this:

# The chatscript (be sure to edit that file too)
connect "/usr/sbin/chat -v -f /etc/chatscripts/isp"
defaultroute /dev/ircomm0 115200 name myname nopersist ipparam isp
passive

# Use hardware flow control with cable and Bluetooth but not with IrDA.
#crtscts  # serial cable, Bluetooth
nocrtscts # IrDA

The important parts are the "/dev/ircomm0" device and "nocrtscts" option. I use the ipparam option that a little script I wrote in /etc/ppp/ip-up.d/00dns can add the correct domain into /etc/resolv.conf.

/etc/chatscripts/isp is a fairly normal PPP script:

TIMEOUT         80
REPORT CONNECT
ABORT "NO DIALTONE"
ABORT "NO CARRIER"
ABORT "ERROR"
ABORT "NO ANSWER"
ABORT "BUSY"
ABORT "Username/Password Incorrect"
ABORT           ''RINGING\\r\\n\\r\\nRINGING\\r''
''''              AT
OK              ATDT01234567890
CONNECT

One thing I found is that the Nokia really disliked any pauses at the end of the dial string (e.g. ATDT01234567890,,). When the commas were there, the phone would dial but immediately hang up.

Now tell Linux to dial - type "pon provider". You should see the phone start to dial and talk to your isp. "plog" will give you PPP information, "dmesg" may also say something useful.

GPRS

There's something a bit sad about treating a mobile phone as a modem rather than as a digital device. So GPRS fixes this! However it's worth checking call charges - you may be better off using the phone as a dumb modem depending upon your usage of the link. GPRS calls are typically charged per byte wheras modem calls are charged according to how long they last and what modem your phone is asked to be (9600 bps, 14400 bps etc).

To use GPRS, you just change the dial string - it's that easy! In fact, there are many wonderful and cool things you can do with this - like changing what modem your phone acts as. The two sites I used to get this data are:

However the GPRS string is just "ATD*99***1#". So replace your dial string in "/etc/chatscripts" with that and enjoy! Just remember - you now have an internet connection provided by your mobile phone network, not a direct link to your ISP.

Bluetooth

To use Bluetooth, you'll need a Bluetooth adapter (I've used a 3Com USB dongle - P/N: 3CREB96), kernel support and the Bluez utilities.

Here are the settings on my laptop, however I can't remember which ones I changed from the default. In /etc/bluetooth/hcid.conf I have "security auto".

Activate bluetooth on your phone (menu item 11) - a dot surrounded by brackets appears at the top left of the phone. Its a good idea to set a name on the phone (menu 11-5-2). Run "hcitool scan - after a few moments, you should see something like this:

Scanning ...
        00:02:EE:54:1F:72       Wyvern

Now edit /etc/bluetooth/rfcomm.conf so that it looks like this (edit the device to the number you get above):

rfcomm0 {
        # Bluetooth address of the device
        device 00:02:EE:54:1F:72;
        # RFCOMM channel for the connection
        channel 1;
        # Description of the connection
        comment "Nokia 6310i";
        }

If you type "rfcomm" and do not see the correct id, try "/etc/init.d/bluez-utils restart".

Now edit /etc/ppp/peers/provider like this:

# The chatscript (be sure to edit that file too)
connect "/usr/sbin/chat -v -f /etc/chatscripts/isp"
defaultroute /dev/rfcomm0 115200 name myname nopersist ipparam isp noauth
passive

# Use hardware flow control with cable and Bluetooth but not with IrDA.
crtscts  # serial cable and Bluetooth
#nocrtscts # IrDA

# Ignore carrier detect signal from the modem 
local

Now "pon provider" and watch the magic happen. You are likely to be prompted to accept the connection on the phone. If you have problems, try typing in "rfcomm connect rfcomm0":

Connected /dev/rfcomm0 to 00:02:EE:54:1F:72 on channel 1
Press CTRL-C for hangup

You may find you have to restart the bluez-utils again.

If you want more debugging output, try "hcidump -x". If you need a pin number, beware - you may you need to specify one at least four numbers long (some programs accept fewer). One last gotcha - the "bluepin" program on Linux was failing to use the correct options to ps. I can't remember right now - it may have been because I used to set the I_WANT_A_BROKEN_PS environment variable.

Personal tools