Nokia, GPRS, Linux, USB, and you!

Nokia 5320 XpressMusicI’ve written a few times about using GPRS with Linux in Kenya. First I was using Safaricom’s “Bambanet” USB device, which was merely a re-branded Huawei e220. A few months after that I sold the Bambanet and was using a Nokia 2630 over Bluetooth wireless. Last month I upgraded to a Nokia 5130 XpressMusic, and then sold it and upgraded to a Nokia 5320 XpressMusic (the 5320 runs Symbian S60, which is way more advanced than the S40 on either of my previous Nokias). The procedure is the same for all Nokia phones when using Bluetooth, but when using the USB cable there are a few show stoppers.

  • You must have cdc-acm support enabled in your kernel (tested here on kernel 2.6.30-rc4). From menuconfig:
  • [code lang=”bash”]Device Drivers —> USB Support —> USB Modem (CDC ACM) support[/code]

  • You have to connect the phone in “PC Suite” mode.
  • /etc/wvdial.conf must be updated to reflect the modem’s hardware address in USB mode

Once you’ve rebooted into your new kernel (or modprobe’d the cdc-acm module into your running kernel) you need to connect your phone via USB to the computer. Make sure the phone is set to connect in “PC Suite” mode; this tells the phone to expose the modem to the computer rather than the default Mass Storage mode which allows you to copy files to and from the removable memory.

You need to specify the location of your phone’s modem in the wvdial configuration file. It should be “/dev/ttyACM0” but if you’re having problems (or curious), read the last few lines of dmesg | tail or run wvdial’s automatic configuration tool wvdialconf to detect it. In any case, modify your /etc/wvdial.conf to reflect the address of the modem. Here’s mine, notice I have a preset for dialing via Bluetooth and one for USB:
[code lang=”bash”][Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Phone = *99#
Dial Command = ATDT
Username = doesnt
Password = matter
Baud = 460800

[Dialer nokia-bt]
Modem = /dev/rfcomm0
Modem Type = Analog Modem

[Dialer nokia-usb]
Modem = /dev/ttyACM0
Modem Type = USB Modem[/code]
Now use wvdial to connect to the phone and dial the ISP:

[code lang=”bash”][aorth@shamba: ~]$ sudo wvdial nokia-usb
–> WvDial: Internet dialer version 1.60
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: ATZ
–> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
–> Modem initialized.
–> Sending: ATDT*99#
–> Waiting for carrier.
~[7f]}#@!}!} } }2}#}$@#}!}$}%\}"}&} }*} } g}%~
–> Carrier detected. Waiting for prompt.
~[7f]}#@!}!} } }2}#}$@#}!}$}%\}"}&} }*} } g}%~
–> PPP negotiation detected.
–> Starting pppd at Wed May 13 19:36:57 2009
–> Pid of pppd: 11360
–> Using interface ppp0
–> pppd: ������ �[08]�
–> pppd: ������ �[08]�
–> pppd: ������ �[08]�
–> pppd: ������ �[08]�
–> pppd: ������ �[08]�
–> local IP address
–> pppd: ������ �[08]�
–> remote IP address
–> pppd: ������ �[08]�
–> primary DNS address
–> pppd: ������ �[08]�
–> secondary DNS address
–> pppd: ������ �[08]�
You should see a lot of gibberish like this, and that means it worked. You may have to add the two DNS addresses to your /etc/resolv.conf if your Linux distribution’s pppd doesn’t add them automatically. I hope some of this was helpful.


Comments are closed.