How to use the Nokia 6340i as a wireless modem under Linux


Requirements:
Instructions
Notes on your cellular plan
Troubleshooting
Related links

Instructions

First, make sure you have Infrared support compiled into your kernel. You will need support for the IrCOMM protocol, IrTTY, and the specific driver for the IR chipset in your computer.

Device Drivers --->
Networking support --->
IrDA (infrared) support --->
<M> IrDA subsystem support
--- IrDA protocols
< > IrLAN protocol
< > IrNET protocol
<M> IrCOMM protocol
[ ] Ultra (connectionless) protocol
--- IrDA options
[ ] Cache last LSAP
[ ] Fast RRs (low latency)
[ ] Debug information
Infrared-port device drivers --->
--- SIR device drivers
<M> IrTTY (uses Linux serial driver)
--- Dongle support
--- Old SIR device drivers
< > IrPORT (IrDA serial driver)
--- Old Serial dongle support
--- FIR device drivers
<M> IrDA USB dongles
<M> NSC PC87108/PC87338
<M> Winbond W83977AF (IR)
<M> Toshiba Type-O IR Port
<M> SMSC IrCC (EXPERIMENTAL)
<M> ALi M5123 FIR (EXPERIMENTAL)
<M> VLSI 82C147 SIR/MIR/FIR (EXPERIMENTAL)
<M> VIA VT8231/VT1211 SIR/MIR/FIR

Use the findchip program from the irda-utils package to determine what IR chipset your computer has.

Make sure the /dev/ircommX devices exist:
cd /dev && ./MAKEDEV irda
After you have booted into your IrDA-capable kernel, read the irattach man page for any special settings that are required for your computer's particular IR chipset. The examples below are for a Thinkpad 600, which has an NSC PC87338 chipset (nsc_ircc driver), and requires a dongle_id to be passed when loading the module.


You should now be able to see irda0 in the ifconfig output.

The next step is ensuring that communication between your computer's IR port and the 6340i is working. First, start up irdadump. Then on the 6340i, select Menu, then Infrared. Be sure your phone is positioned close to your IR port and with no obstructions between them. You should see output similar to the following from irdadump:
17:26:41.913280 xid:cmd d16daa56 > ffffffff S=6 s=0 (14) 
17:26:42.002689 xid:cmd d16daa56 > ffffffff S=6 s=1 (14) 
17:26:42.092674 xid:cmd d16daa56 > ffffffff S=6 s=2 (14) 
17:26:42.182644 xid:cmd d16daa56 > ffffffff S=6 s=3 (14) 
17:26:42.272628 xid:cmd d16daa56 > ffffffff S=6 s=4 (14) 
17:26:42.355846 xid:rsp d16daa56 < 00002eee S=6 s=4 Nokia 6340i hint=b125 [ PnP Modem Fax Telephony IrCOMM IrOBEX ] (28) 
17:26:42.362625 xid:cmd d16daa56 > ffffffff S=6 s=5 (14) 
17:26:42.452605 xid:cmd d16daa56 > ffffffff S=6 s=* tp hint=8404 [ Computer IrCOMM ] (19) 

At this point, /dev/ircomm0 is acting as a serial device, just like /dev/ttySX does. To dial out to your ISP, simply replace the /dev/ttySX line in your PPP config file (e.g. /etc/ppp/peers/provider) with /dev/ircomm0 and connect to your ISP as you normally would. The 6340i responds to standard AT commands, so you can use minicom to experiment as well.

Notes on your cellular plan

In order to transmit data over your cell phone, your cellular account needs to have CSD (Circuit Switched Data) enabled. Different cell phone providers have different policies for enabling CSD. Some enable CSD for all accounts by default, some charge extra for it, and others don't provide it at all. If you are using Cingular you can get CSD support for (currently) $4/month by adding the Wireless Internet option to your account (not Wireless Internet Express, that is for WAP content and is more expensive).

Troubleshooting

My phone responds to AT commands, but dies with "NO CARRIER"

Your cellular account probably doesn't support data calls. See the plan notes above.

The modules loaded fine, but I'm not getting any output from irdadump

You may need to rebind:
for i in irda0 irda1 irda2; do irattach $i -s; done
I'm getting output from irdadump, but the IR indicator on the phone is still blinking

This is normal. The IR indicator becomes solid only after you attempt to dial up.

I get an error like "nsc_ircc_open(), can't get iobase of 0x3f8" when loading the driver module

Errors related to I/O port access when loading a driver can be caused by a serial port already using the I/O ports needed for the IR interface. Check /proc/ioports to see what is using the I/O space. If it is 'serial', use setserial to find which serial port needs to be changed, and disable it:
root@host:~# setserial /dev/ttyS0
/dev/ttyS1, UART: unknown, Port: 0x03f8, IRQ: 3

root@host:~# setserial /dev/ttyS0 uart none
If setserial doesn't work, or if the I/O ports are being used by something other than a serial port, you may need to change your BIOS settings to reconfigure I/O usage. Some IR drivers may also have options to get around the problem.

The module reports that it can't assign the requested IRQ

A likely cause of IRQ allocation errors during module loading is the presence of other devices in the system making use the same IRQ. Check /proc/interrupts to see which device is causing the conflict. The IRQ for a serial device can be changed using the irq option to setserial, and often the BIOS provides a means to change IRQ assignments.

Related Links

Gnokii

Gnokii includes GUI and CLI applications for communicating with Nokia phones. Although the 6340i is not (currently) listed as a supported model, some functions do work. You can, for example, read stored contact entries from the phone, but sending new entries doesn't work. Specify AT as the phone type in the Gnokii configuration file. Gnokii provides a method for making data calls, but it is redundant if the normal /dev/ircomm0 method works for you.

Infrared-HOWTO

General guide for Infrared on Linux. A good resource particularly if you're looking for information on identifying the IR hardware in your computer.

TuxMobil

Contains miscellaneous information about Infrared on Linux, including a hardware survey.

Jean Tourrilhes' IrDA on Linux page

Lists quite of few common problems and their solutions.


Written by Jason Wies <jason at xc.net>.