Being the modern ‘connected’ type of person, I have finally taken the plunge and purchased a 3G Data Card for my laptop. – I opted for the Merlin XU870.

Now… you would think that getting this to work under Linux would be difficult. The good news is that this task is really easy.

Here’s what you need to do:

Step 1: Find out what device your modem is plugged is connecting as.

This is easy to do. Simply open up a terminal session, and type ‘tail -f /var/log/messages’

Now, plugin your card and see what messages popup.

Mine looks like this:

Mar 31 22:18:49 glug kernel: [34785.336000] usb 1-1.3: new full speed USB device using uhci_hcd and address 13
Mar 31 22:18:49 glug kernel: [34785.452000] usb 1-1.3: configuration #1 chosen from 1 choice
Mar 31 22:18:49 glug kernel: [34785.452000] airprime 1-1.3:1.0: airprime converter detected
Mar 31 22:18:49 glug kernel: [34785.452000] usb 1-1.3: airprime converter now attached to ttyUSB0

So.. my device is using device /dev/ttyUSB0

Step 2: Create a ppp configuration for the device

Create a file in this location: /etc/ppp/3g-chat

And add this script:

###########################################
ABORT BUSY
ABORT ‘NO CARRIER’
ABORT ERROR
REPORT CONNECT
TIMEOUT 10
“” “AT&F”
OK “ATE1″
OK “AT+CGDCONT=1,42IP42,42internet42″
SAY “Calling 3g GPRS\n”
TIMEOUT 60
OK “ATD*99***1#”
CONNECT \c
###########################################

NB! The text ‘internet’ in the code above is the name of your mobile providers ‘accesspoint’.

Now, create a another file in this location: /etc/ppp/peers/3g

And add this code to it:

###########################################
#Set this to the device allocated to the Card
/dev/ttyUSB0
#Baudrate
230400
#Idle time for closing connection
idle 7200
#Lock the device for this PPPD process use only
lock
#Use normal handshaking
crtscts
#Assume it is a modem device and force modem control methods
modem
#Any user can start the connection
noauth
#If a default route exists replace it with the ppp link
#You get an error if this command is not supported
#by your version of PPPD
replacedefaultroute
#Make the ppp link the default root
defaultroute
#Username and Password for computer/GlobeTrotter ppp link
#Normally ignored. Change if GSM Operator requires it
user web
password web
#Change the path to chat if required for your version of Linux
connect “/usr/sbin/chat -V -f /etc/ppp/3g-chat”
#Accept IP address provided by network
noipdefault
#Detach PPPD from console used to run the program {optional}
#updetach
#Get DNS addresses from operator
usepeerdns
#Don’t use VJ compression for ppp link
novj
###########################################

Step 3: Try the connection

Now.. in a terminal, type ‘pon 3g’ and… all going well you should have a connection… well I did

Have fun…

Advertisements