Nokia N60 series
From CLUG Wiki
This page is written by a Gentoo user with Gentoo in mind. Thus, he liberally uses emerge, and assumes that
everything will work exactly the same for you.
If you don't run Gentoo (shame on you), it won't, so please find the differences and add them to this page.
Contents |
Introduction
I was suprised to find so little documentation on setting up Mobile Phones to interface with linux, so I decided to start the revolution with this article on the N60 series phones. There a quite a few topics that I havent covered in this article regarding these phones and I would encourage anyone to extend this artice and add in anything helpful including:
- bluetooth driver setup
- Gnokii support
- File transfer over USB and bluetooth using OBEX
USB
For all of those gentooers out there who are too cheap to invest in a bluetooth dongle (like myself), here is how to get your Nokia N60 series phone to talk to your pc via the DKU-2 cable which comes with the phone (I think).
About the DKU-2
After much obscure browsing of forums etc, I came across some details about the DKU-2. First of all the cable is passive and contains no convertors or chips etc like the DKU-5 cable has.This has lead some people to believe that the phone is just a straight USB device, but this is not true. The phone itself acts as a USB to Serial convertor.
Plug it in
plug the phone into your PC using the cable
lsusb should display the following:
Bus 001 Device 001: ID 0000:0000 Bus 002 Device 004: ID 0421:041e Nokia Mobile Phones <- Bingo!! my Nokia6680 Bus 002 Device 001: ID 0000:0000 Bus 003 Device 001: ID 0000:0000
you'll see the ID 0421:041e or something similar depending on your phone
- the first part:
0421, is the vendor ID (we'll need this later) - the second part:
041e, is the Product ID (we'll need this later aswell)
Kernel Configuration
Now get into your kernel source directory and fire up the menuconfig
$ cd /usr/src/linux $ make menuconfig
ensure the following settings are enabled:
Device Drivers --->
USB support --->
USB Serial Converter support --->
<M> USB Serial Converter support
[*] USB Generic Serial Driver
If you had to enable them then obviously recompile your kernel, which Im sure you've done before but just incase:
$ make && make modules_install $ cp arch/i386/boot/bzImage /boot/kernel-xx
Now restart so that the new kernel comes into effect
finally modprobe the module with your specific vendor and product ID's and you're done:
$ modprobe usbserial vendor=0x0421 product=0x041e
The device should now be under /dev/ttyUSB0
Tip:if you dont feel like modprobing the module with all the ID settings everytime, then put it into: /etc/modules.autoload.d/kernel-2.x
usbserial vendor=0x0421 product=0x041e
Using your Phone as a Modem
Kernel Configuration
Now to use your phone as a modem you'll need to do some kernel tweaking once more:
$ cd /usr/src/linux $ make menuconfig
and enable the following in your kernel:
Device Drivers ---> Network device support ---> <*> PPP (point-to-point protocol) support [*] PPP multilink support (EXPERIMENTAL) [*] PPP filtering <*> PPP support for async serial ports <*> PPP support for sync tty ports <*> PPP Deflate compression <*> PPP BSD-Compress compression <*> PPP MPPE compression (encryption) (EXPERIMENTAL) <*> PPP over Ethernet (EXPERIMENTAL)
Recompile and copy your kernel image like before:
$ make && make modules_install $ cp arch/i386/boot/bzImage /boot/kernel-xx
Emerging Ppp
Now emerge ppp (if you havent done so already):
$ emerge ppp
portage might give you some sort of important message at the end about how the base layout has changed. If it suggests you do some sort of update, then do it.
Ppp Scripts
Now we need to get some ppp scripts going:
/etc/ppp/peer/provider
#!/bin/bash /dev/ttyUSB0 # Serial device to which the GPRS phone is connected debug # Comment this off, if you don't need more info # scripts to initialize the 3G / EDGE / GPRS modem connect '/usr/sbin/chat -v -f /etc/ppp/peers/connect-chat' # AT commands used to 'hangup' the connection disconnect '/usr/sbin/chat -v -f /etc/ppp/peers/disconnect-chat' 460800 # Serial port line speed crtscts # hardware flow control for cable local # Ignore carrier detect signal from the modem: lcp-echo-failure 0 lcp-echo-interval 0 # IP addresses: :0.0.0.0 # - accept peers idea of our local address and set address peer as 10.6.6.6 # (any address would do, since IPCP gives 0.0.0.0 to it) # - if you use the 10. network at home or something and pppd rejects it, # change the address noipdefault # pppd must not propose any IP address to the peer! ipcp-accept-local # Accept peers idea of our local address defaultroute # Add the ppp interface as default route to the IP routing table #replacedefaultroute # New route should be our default route to Internet usepeerdns # User DNS returned by server noauth # The phone is not required to authenticate # Most phone do not support compression, so turn it off. noipv6 novj nobsdcomp novjccomp nopcomp noaccomp # Username and password: # If username and password are required by the APN, put here the username # and put the username-password combination to the secrets file: # /etc/ppp/pap-secrets for PAP and /etc/ppp/chap-secrets for CHAP # authentication. See pppd man pages for details. user "insert_your_access_point_here" # Change this persist # Persistent connection maxfail 99999 # Retry and retry and retry if failed...
/etc/ppp/peer/connect-chat
#! /bin/sh
TIMEOUT 10
ECHO ON
ABORT '\nBUSY\r'
ABORT '\nERROR\r'
ABORT '\nNO ANSWER\r'
ABORT '\nNO CARRIER\r'
ABORT '\nNO DIALTONE\r'
ABORT '\nRINGING\r\n\r\nRINGING\r'
\rAT
TIMEOUT 15
OK ATE1
OK 'AT+cgdcont=1,"IP","insert_your_access_point_here","0.0.0.0"' #change this
OK ATD*99#
CONNECT
/etc/ppp/peer/disconnect-chat
#!/bin/sh # send break exec /usr/sbin/chat -V -s -S \ ABORT "BUSY" \ ABORT "ERROR" \ ABORT "NO DIALTONE" \ SAY "\nSending break to the modem\n" \ "" "\K" \ "" "\K" \ "" "\K" \ "" "\d\d+++\d\dATH" \ SAY "\nPDP context detached\n"
Now dont forget to make your scripts excecutable
chmod a+x /etc/ppp/peer/connect-chat chmod a+x /etc/ppp/peer/disconnect-chat chmod a+x /etc/ppp/peer/provider
This is where the real fun begins....
As with Linux, nothing ever works the first time around, so open up a new terminal and see whats happening:
$ tail -f /var/log/messages
Now plug in your phone
Make sure the usbserial module is loaded
Open up a new terminal and remove your default gateway if you have one, as this will cause a conflict resulting
in the phone not functioning properly as a modem
$ route del default gw
Now fire up the script and hope that it works
$ pon provider
If it does work, you should be able to see something like this when you run "ifconfig ppp0":
ppp0 Link encap:Point-to-Point Protocol
inet addr:10.64.26.234 P-t-P:192.168.100.101 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:2154 errors:0 dropped:0 overruns:0 frame:0
TX packets:1654 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:2400234 (2.2 Mb) TX bytes:221590 (216.3 Kb)
otherwise, theres a problem in your script configuration and you need to investigate /var/log/messages to sort it out
Tip: You might want to make sure that the device is unplugged, that all processes started by the provider script are killed and then the device is reconnected, before attempting to rerun the script
once you've got it working you can disconnect by simply running:
$ poff provider
