Home Pauline's Pages Howto Articles Uniquely NZ Small Firms Search
Height Padding
Ubuntu Linux on the Move

Fun with Ubuntu Linux  ||  Ubuntu Linux on the Move - Introduction | Dial up Modems | Bluetooth connection to a Phone Modem | GPRS Access via Mobile Phone | Vodafone Mobile Connect Card | GNOME-PPP | Conexant Soft Modems | Using Windows Mobile Devices as Modems | Monitoring Data Transfer | WiFi Devices and Software | Communications Requirements Table | Reader Feedback || Ubuntu Linux on the Take (Photo Support) || Open Source, Free and Cross-Platform Software

Introduction

 The main page covering my experiences in making the transition from Microsoft Windows to Ubuntu Linux - Fun with Ubuntu Linux quickly become excessively long.  This is the first, and for me one of the most important, specialised pages in what will probably become a series  covering specific aspects of the transition. I have just started the next new page covering what is perhaps the second most important activity after communications for inveterate travelers like ourselves, that is handling all the photographs we take with digital cameras, viewing them and ultimately putting them into a form that can be used on our web site. Retaining the fun approach I have called it Ubuntu Linux on the Take. Logically the third will be "Ubuntu Linux on the Make" covering Web Authoring!

One of my main reasons for making the transition were the huge flows of data with little control whilst on the move when using Microsoft Windows XP. I got so tired of the continual updates to Windows XP and the associated Virus checkers, Firewalls and Malware detectors. It is almost impossible to prevent a large data flow when one first connects and many programs seek information updates etc. There are dozens of processes running in the background under Windows XP and my hard drive is in continuous use minutes after the last user activity has finished. This all makes Windows XP difficult to use securely whilst traveling and costly on a mobile connection. Using the firewall to restrict the programs accessing the internet used to work but now many share common service interfaces and it has become less easy. In contrast Ubuntu uses under a 100 bytes (bytes not Kbytes) when make an average GPRS connection and will sit there for 10 minutes and use no more. Furthermore it has no virus checkers or firewalls which need updating and no unstoppable or essential automatic system updates.

Effective communications was the real test of whether I could make a permanent swap to Ubuntu Linux. It turned out to be easier in many ways than I expected but progress was marred by a number of little irritations, many caused by my ignorance and I went down enough dark if not blind alleys that I have decided to make it the subject of a separate page and only leave some general considerations and the overall outcome in Fun with Ubuntu Linux .

This page has become a record of  what I have done with details of all the changes I have made (and how) to the systems so I can repeat them in the future. It is a bit difficult to know where to start as there are hardware aspects (modems, phones, specialist cards etc) connection/interface aspects (Bluetooth, USB cables, serial cables etc) and low (Terminal) and high level Graphical User Interface (GUI) software. It is still in a sort of chronological order although considerable backfilling has occurred in many sections and I have done some re-ordering to avoid swapping back and forwards between different aspects. I have also included many of the links I found useful at the time. I hope it will be useful to others and perhaps avoid yet more reinventions of the wheel. 

'Classic' Dial-up Modems on a Land-line. 

I will start with what ought to be the simplest and certainly the most common type of connection to the internet used away from home. In practice it is not that simple and it is worth noting from the start that support for some types of modems is poor in all versions of Linux. The reason is simple - the type of modem which is used in many machines and built into many recent cards are often referred to as Winmodems or soft modems because they use Windows and the processor to do much of the hard work in software rather than do it on the chip or card. This software is often proprietary and Linux is poorly supported by most manufacturers. 

In my case Intel does support the chip set on the very cheap (£6.00) modem card in my AMD based desktop machine under some versions of Linux but  I could not really face a long battle at an early stage in Linux. I therefore got out my old but very good US Robotics V90 external serial interface Fax modem for the desktop.

The laptop also has a soft modem and the information I have gathered shows that relatively easy driver support is likely in the near future but at present it is a nightmare to install. I then remembered that I had a Xircom PCMCIA modem and Ethernet card which I plugged in - it was recognised immediately and I had a telephone connect working a few minutes later. 

Modem Connection Software

The starting point for testing a modem connection is to use System  -> Administration -> Networking which allows a dial-up connection to be configured  and provides simple and consistent swapping between a broadband Ethernet connection, WiFi connection and a modem. This allows setting up a basic connection on a serial, or specified device, and needed no editing of files for my Serial Modem - it even detected the port it was connected to. There is however one very important trick to swapping - you MUST use a tick box to set the modem as the default route to the Internet before connecting and un-check the box before switching back to Ethernet. If you do not do that you may find that there is no Internet functionality when you go back to broadband although one can still see other machines over the network!  This switching of the default route took me some time to work out when I carried out my initial experiments in accessing my mobile phone. A disadvantage of is this approach is that you need to enter the superuser password every time you use Networking  as it is a administrative function needing root privileges. 

A better long term approach is to use GNOME-PPP, an excellent GUI (Graphic User Interface) tool which puts an connection icon in the panel so you easily check on the connection and terminate it - I see no real reason why one should not use it from the start. See below for more details.

The Modem Monitor

At an early stage you should add a connection icon to the top panel by right clicking on the top  panel -> Add to Panel and dragging the Modem Monitor onto the Panel - it needs to be set by a double clicking and being set to monitor ppp0 for modems. It will also monitor the Ethernet connection eth0 and the Wifi connection ath0 which usefully shows the signal strength. 

Allowing extra users to use sudo.

Many of the modem related activities need administrative privileges. When you set up Ubuntu, it automatically adds the first user to the sudo group, allowing that user to make changes as the super user (root) by typing in their password. If you have several users on the machine it is useful to know how to give them the ability to use sudo and system programs such as Network Manager to manage connections. I found this suggestion at Linux.com | Ten tips for new Ubuntu users.  Go to System -> Administration -> Users and Groups. Select the user you want to add to sudo, and click Properties. Under the User privileges tab, check the box that says "Executing system administration tasks" .

Bluetooth connection to a Modem in a Mobile Telephone 

We are now getting to the more interesting stage - connecting up through a mobile phone (or PDA with mobile access). Before we can get to the use of a mobile phone we have to consider how to connect it. I prefer Bluetooth as it does not involve cables and has much greater range than Infra Red allowing a phone to be placed in a good signal area (in theory up to 10 metres away) so I will only discuss Bluetooth at this point. 

I plugged in my existing Bluetooth Dongle, a D-Link DBT-120 and it was detected by the system immediately. 

The following procedures to set up to use Bluetooth were those I used initially and are based on http://www.russel.org.uk/gprsInternet.html and modified for my phone which is a Sony Ericsson T610 . 


# RFCOMM configuration file /etc/bluetooth/rfcomm.conf.

rfcomm0 {
bind yes;
# Bluetooth address of T610
device 00:0E:07:2C:E8:82;
#
# RFCOMM channel for the T610
channel    1;
# Description of the connection
comment "T610 Dial-up Networking via DBT-120 Bluetooth";
}

Whenever you change a configuration file such as the above which you are going to use  you must reboot or restart the relevant sub-system, in this case open a terminal and type :
 sudo /etc/init.d/bluez-utils restart 

For completeness I will note here that I have found that you can set up multiple rfcomm channels in the file to cover multiple devices. I have also found a more useful command to provide the information to set up the RFCOMM file:

sdptool search DUN

The above can be used instead of  sdptool browse <phone-bluetooth-address> when several bluetooth phones are in range. The XDA section below has examples of its output with several Bluetooth devices connected.

Since writing the above I had to get another Bluetooth Dongle, this time a class 2 v1.2 device from Belkin - a F8T009 based on a Broadcom chip. This was detected immediately and was usable with no addition setting other than pairing from the phone. I ordered the Dongle from Amazon for £9.99 and noted that in the existing customers comments somebody had noted that it worked well with Linux 2.6 kernel. I have also discovered another useful command lsusb which list all USB devices plugged in which is a valuable check that devices have been discovered.

GSM Dial-up to an ISP via Bluetooth Phone Modem

Having set up Bluetooth I  swapped the device in the Network Manager (System -> Administration -> Networking) from /dev/ttyS4 (the Xircom Modem) to /dev/rfcomm0 for the Bluetooth phone modem. I could then make a standard dial-up connection through the mobile phone.

The modem seemed very slow and I discovered the modem initialisation string is in /etc/chatscripts/ppp0 which I edited using gedit invoked from the command line:

sudo gedit /etc/chatscripts/ppp0
# comment out the following line:

# "" "AT&FH0L1"

Better modem initialisation strings will appear latter and use of GNOME-PPP as a dialer follow so really this section is only to complete my 'audit trail'. 

Other Programs and files used in PPP connections

This is following a chronological path and I also want to keep an audit of how I progressed so I should note that my background searches for information have indicated that other files  which used are used by Networking include /etc/ppp/peers/ppp0 and in some cases /etc/ppp/pap-secrets which contains a list of users and passwords.  At this point I tried making connections using the low level commands pon and poff.  pppconfig helps sets you set up connections for pon and poff . The commands and option scripts set up and use the PPP Daemon (pppd). The connections made using pon and poff appeared to work but did not seem to allow Internet access - something I now suspect was to do with setting the default route. I have not used them again.

Other programs I found and used are at a higher level namely wvdial and GNOME PPP which is a GUI front end to wvdial - these are covered below when I come to GPRS connections of various sorts and are a much better way to proceed. wvdial is very useful for testing from the command line and allows one to 'see' more of what is happening if there are problems. Once one is up and running one GNOME-PPP should be all one needs.

Getting Information - manuals and help

I have mentioned several commands and configuration files. There is a very useful command man which provides  'manuals' for many commands and options files eg 

man pon
man wvdial
man pppd
Also many commands take a parameter --help which provides some help eg

wvdial --help

Monitoring Connections and Devices - System Logs

When you are doing initial checks it is very useful if not essential, to monitor /var/log/syslog by use ‘tail -f /var/log/syslog’ (in a separate terminal) to check real time that all the right things are happening and what data has been transferred by the time the connection is closed.

tail -f /var/log/syslog

There is a command dmesg which shows all the main activities from startup and the the end is useful for seeing what happens when you plug in a [new]  device to see the channels which are allocated. 

dmesg

dmesg gives a lot of output so it is worth learning about the grep command and piping the output through it.

dmesg | grep "Connect"

will just give you the lines including Connect - see below for how I use this to get a record of connection times etc.

You can monitor some of what is going on by System -> Administration -> System Monitor

Improvements in procedures for modem connection, disconnection and monitoring

The use of a System  Administration program for making connections lacks elegance and you need to keep the Networking window open so you can close the connection.  The Modem Monitor does tell you when you are connected and disconnected but little more. I felt this was an area where my set up fell far short of Windows. 

The first improvement I found was that you can define an extra set of connections in Network Manager (in the box at the top) which mean that it is possible to at least switch between Landline, Bluetooth, WiFi and Ethernet pre-defined configurations which went a long way to removing my concerns especially if the Network Monitor is opened in a separate workspace. This technique seems to work well and I can switch between connections at a click if the default connection box is correctly set in each.  You do still need to change the connection which is being monitored by right clicking on the Modem Monitor icon -> Properties if you change from a Wifi/Ethernet to Modem Connection. The WiFi (ath0) shows signal strength alongside the modem monitor icon.

This may be all that some users need - the only downside is that the Network Manager needs a superuser password for access and you should also be aware not to open multiple copies of Networking - it has fallen over and needed a reboot when several had been opened!

GPRS access through a Mobile Telephone

This is the logical place to cover the extension from dialing an ISP to use of GPRS on the mobile phone. GPRS access does not involve use of a normal telephone number but uses a special code in place of the number to access internal 'registers' in the phone which contain information on the connection such as the APN (Access Point Node), login name, password and possibly an IP and a DNS address. Each phone will be slightly different but in general they will contain a set of registers sufficient to hold the configuration settings for about 8 connections (sometimes described as accounts or profiles in the manufacturers literature). Each of these will have a CID (connection ID) associated which identifies which one is to be used.   A special code is sent to the phone instead of the usual access number.  The number used is *99***X# where X is the single digit CID number referred to above. The default connection (CID 1) is more easily accessed by *99#. 

A common way to set up a phone used as a modem is for the APN to be loaded by a modem initialisation string before the connection is initiated. There are also other  options which need to be set up for a GPRS/3G PPP protocol connection (the usual standard). Neither are possible using the Network Manager alone so other means must be used to connect.

Much of my experimenting during this stage used a higher level program but one still run in a terminal called wvdial which I mentioned earlier. I latter found a GUI frontend to wvdial called GNOME PPP which provides a much more satisfactory way to proceed once the initial problems were ironed out.  I was led to wvdial as it seemed to be the preferred way of connecting to a Vodafone Connect Card. It is also built into Dapper so it does not need to be downloaded. My initial interest was whether it conflicted with the set-up using the Administrator -> Network mechanism I already had working. I found no interactions although I deactivated the Ethernet or WiFi connections so I could test it other connections without confusion.

It requires two files which I needed to set up manually as the Bluetooth modem is not covered by the auto-detection facility in wvdial.

The files as in my set-up were:

# /etc/wvdial.conf

[Dialer Defaults]


Phone = 08456621026
# For GPRS
# Phone = *99***1
Username = username

Password = password
Dial Command = ATDT
Modem = /dev/rfcomm0
New PPPD = yes

# /etc/ppp/peers/wvdial
 

noauth
name wvdial
# Following makes sure that you get internet access when you change connection from WiFi etc.

replacedefaultroute

usepeerdns
# Following essential with mobile telephones with GPRS if there is no echo response implemented to check a connection is still alive

lcp-echo-failure 0
lcp-echo-interval 0

This worked fine and connected up the mobile - the only initial problem was that I did not realise that the only way to stop the connection was by a Cntl C !

The script above copes with a problem I initially had of the connections were being terminated after a couple of minutes - inspection of the log using

tail -f /var/log/syslog

showed that I was being disconnected because there were no echo responses - much googling using the error string as a search term came up with a [well] known but less well warned about problem with many phones/mobile service providers not implementing a lcp-echo. This call for a lcp-echo is done by default every 30 seconds and was included as a way to discover a disconnected telephone connection and after a default of 4 such failures the PPP link was terminated. Setting the echo time and number of checks to 0 inhibits sending lcp-echo requests and responding to lack of replies. See above script.

All the various options can be found using the manual command for the PPP Daemon pppd

man pppd

Vodafone Mobile Connect Card

My aim was to also be able to use my Vodafone Mobile Connect card in the laptop for 3G speeds and convenience. Some links I have bookmarked as being of interest are:

The first stages went well and the Vodafone Connect Card was detected when I plugged it in. 

All the pages above refer to use of a communication terminal program called minicomm which is not available in Ubuntu Dapper Drake - Add/Remove the Serial Port Terminal instead. You can override the preset selections to use ttyUSB0. After plugging in the card and monitoring with  dmesg I used the terminal to send a few AT commands and monitored/interrogated various settings OK. The card needs to be turned off with:

sudo cardctl eject

before taking it out if the machine is on otherwise there is a risk of damage (as with any card). This command is due for replacement and I will report when I find its replacement. I latter set up a script run from the desktop which ejects the card or warns to turn the machine off instead if you do not have access to the superuser password.

After studying the references above and other information, I started using wvdial with the following files when using the Vodafone Connect card, T610 and XDA:

# /etc/wvdial.conf

[Dialer Defaults]

Phone = *99***1#
Username = web
Password = web
# Starts negotiation without checking every response - needed by some providers
Stupid Mode = 1 Dial Command = ATDT


[Dialer pin]
Init1 = AT+CPIN=1234

[Dialer T610]
Modem = /dev/rfcomm0
Baud = 115200
Init2 = ATZ
Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem

[Dialer XDA]
Modem = /dev/rfcomm1
Baud = 115200
Init2 = ATZ
Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem


[Dialer option] Modem = /dev/ttyUSB0
Baud = 460800
Init2 = ATZ
Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ISDN = 0
# Turn off use of faulty DNS from Vodafone 'Option' card
Auto DNS = 0
Modem Type = Analog Modem

[Dialer 2gonly]
Init4 = AT+COPS=0,0,"Vodafone UK",0

[Dialer 3gonly]
Init4 = AT+COPS=0,0,"Vodafone UK",2

[Dialer internet]
Init5 = AT+CGDCONT=1,"IP","internet";

[Dialer internetvpn]
Init5 = AT+CGDCONT=1,"IP","internetvpn";

[Dialer myapn]
Init5 = AT+CGDCONT=1,"IP","myapn"

[Dialer 384k]
Init6 = AT+CGEQMIN=1,4,64,384,64,384
Init7 = AT+CGEQREQ=1,4,64,384,64,384

[Dialer 144k]
Init6 = AT+CGEQMIN=1,4,64,144,64,144
Init7 = AT+CGEQREQ=1,4,64,144,64,144

[Dialer 64k]
Init6 = AT+CGEQMIN=1,4,64,64,64,64
Init7 = AT+CGEQREQ=1,4,64,64,64,64

# /etc/ppp/peers/wvdial

noauth
name wvdial
replacedefaultroute
noipdefault
# Seems to be overridden by the Auto DNS = 0
usepeerdns
# The following turns off header compression - the first is essential for the Option card

novj

nodeflate
nobsdcomp
# Following essential with many mobile telephones where there is no echo response implemented
lcp-echo-failure 0
lcp-echo-interval 0
# The following have also been suggested as appropriate but I have not used
# plugin passwordfd.so
# ipcp-accept-local
# ipcp-accept-remote
# nomagic
# nomp
# noccp
# nopredictor1
# novjccomp

They make use of  various options (not to be confused with the card which is made by Option Wireless Technology and enable me to test the T610 and XDA as well as the  Vodafone Connect Card with minimum editing. I am not sure I understand the value of all the possible optional sections and only used wvdial option internet in most cases. The pin option is required if your SIM has a pin set (my did not at the time) - however note that you can only enter the pin once - further times causes an error which these scripts do not handle. The easy way is to put the SIM in a mobile you understand and turn the pin off - fine for a Prepay SIM but a risk for a contract SIM. If you want to do it the hard way in a terminal I understand from Linux and the Vodafone Mobile Connect 3G/GPRS Datacard but have not tested the following. Send AT+CLCK="SC",0,"XXXX" (replacing xxxx with your own PIN) to turn off the PIN question. This way, your UMTS card will start searching for a network immediately. To turn the PIN question on again, type AT+CLCK="SC",1,"XXXX" and to check if it's on or off, type AT+CLCK="SC",2if it says "+CLCK: 0" the PIN is off, if it says "+CLCK: 1" the PIN is on.

When using the main scripts above with wvdial and the Vodafone Connect Card I found I got a connection but did not get an IP address or DNS servers issued so I paused to ruminate. I have found from searches that the problem is not mine alone (see Linux - HOWTO - Page 11 . The default IP address provided is not a problem but the DNS (Domain Name Server) addresses of 10.11.12.13. and 10.11.12.14 seemingly coming from Vodafone are no use and their is no domain name resolution. The answer is to use fixed DNS servers and rather than use the Vodafone UK ones I have been using ones from OpenNic

Primary     DNS 217.115.138.24 
Alternative DNS  83.217.93.246

Pings show that the primary one is very fast although it is in Germany.

These can be set by using the Network Manager - System -> Administration -> Networking but they will not remain if you switch to an Ethernet or WiFi connection where new addresses are obtained so further work is needed. They are stored in /etc/resolv.conf which gets overwritten which gets overwritten.

 /etc/wvdial.conf also needs to be modified to have a line in the Default setting when using the Vodafone Connect Card of

Auto DNS = 0

I have updated the files above with the new settings. At least this has got me up and running with the Vodafone Connect Card so I do not need to move SIMs round. 

There is also a very useful command mentioned in PHARscape - Vodafone 3G (UMTS) Howto that changes the way the V3G card behaves that I plan to try and use so I can prefer connections with the slower but more reliable GPRS:

AT_OPSYS=n
Where n is a value between 0 and 5
AT_OPSYS=0     #Only connect to GSM networks

AT_OPSYS=1     #Only connect to UMTS networks
AT_OPSYS=2     #If you have a choice - GPRS first
AT_OPSYS=3     #If you have a choice – UMTS first
AT_OPSYS=4     #Which ever network you connect to stay with it.
AT_OPSYS=5     #Automatic – let V3G decide

Ejection Script for PCMCIA Cards

PCMCIA cards should be halted before they are removed and there are warnings for the Vodafone Connect card to do that. I wrote a simple script and created a launcher on the desktop.

#!/bin/bash
# Script is in ~/bin/eject with execute permissions set
echo "This will stop a PCMCIA card so it can be safely removed"
echo "This needs a superuser password - if you are not a superuser"
echo "you will need to turn the machine off to remove the card."
echo "Cntl C will abort" 
echo "Enter superuser password if requested"
sudo cardctl eject
echo " "
echo "The card has been stopped and can be removed"
echo -n "Hit enter after you have removed it "
read t1

Code to Set Pin and Connection type

I have  created a wvdial configuration file just to set the pin which can be run as sudo wvdial --config  /etc/wvdial-pin.conf and may need a Cntr C to exit

# /etc/wvdial-pin.conf
[Dialer Defaults]
Modem = /dev/ttyUSB0
Baud = 460800
Init1 = ATZ
Init2 = AT+CPIN=1234 # If you have a choice - GPRS first # Init3 = AT_OPSYS=2

This could also be put within a bash file to allow it to be called from a launcher and extended to ask for the pin and placed in an environment variable used in the .conf file. This would also be the place to specify whether one wanted GPRS or 3G priority etc. Above NOT tested yet but here to remind me of future actions when I need a PIN set. 

GNOME-PPP

Chronologically this is the point at which I discovered and switched to 'front end' to wvdial called GNOME-PPP but this should really be at the top as it is the way forward for most users. GNOME PPP is installed via Add/Remove and seems to be an excellent way to get a simple dial up connection which also puts a icon in the bar which can be used to monitor and stop the connection - first class for a normal simple modem set up which detected my serial modem automatically and connected me up. I do not see a way built in to handle multiple connection but it is so simple to change that may be not worth worrying so having done my initial trials with wvdial with the Vodafone Connect Card I have now switched to GNOME PPP.

The main configuration is done by a GUI interface and is all fairly obvious if you are making a simple land-line Dial-Up connection. The default modem initialisation strings and other settings will almost certainly work. so only the initial screen needs the username, password and telephone number need setting for a land-line modem.  The only thing missing with GNOME-PPP is help. It uses its own configuration file $HOME/.wvdial.conf which it is reported can have additions despite the warnings not to modify by hand. 

If, however, you want to make a GPRS connection via most mobile phones you need to set up the APN via an initialisation string option on the second tab of the Setup Screen, and then use a special code in place of the phone number. Using Vodafone UK PrePay as an example the Initialisation string 3 is set to: 

AT+CGDCONT=1,"IP","pp.vodafone.co.uk" 

and the phone code used is

*99***1#

For other providers replace the pp.vodafone.co.uk with their APN (eg Vodafone UK Contract is internet, Guernsey Wave is pepper and Vodafone NZ is www.vodafone.net.nz)

In general the username and passwords are not checked but for most phones something needs to be present - check with your provider. I use web and web with vodafone. There are more details on my Global Communications and Computing page

To avoid forgetting and to give others a start, my own typical settings on the Setup screens are: Device chosen from /dev/rfcomm0 , /dev/rfcomm1, /dev/ttyS4, /dev/ttyUSB0 for T610, XDA, Zircon and Vodafone Connect Card. The modem type is always analog. The speeds will be normally be 115200 for the Land-line and 460800 for GPRS/3G. Tone. Volume Off.

Init strings are typically Init 2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 and Init 3 =  AT+CGDCONT=1,"IP","pp.vodafone.co.uk" for a VFUK Prepay or AT+CGDCONT=1,"IP","internet" for a VFUK contract (empty for XDA Exec or dial-up) For GPRS phone number is set to *99***1# (or *99# for XDA). On Networking screen leave Dynamic IP and Automatic DNS ticked. On Options screen a good start is to tick - Dock in Notification Area; Abort connecting if line busy; Abort connecting if no dialtone and Stupid Mode. I leave connection attempts at 1 and the Idle time as 0 (disconnected).

Some other options need to be set for a mobile ppp connection which are not possible via the GUI interface and do not seem to be taken from the same place as wvdial(/etc/ppp/peers/wvdial) although it is supposedly a GUI front end to wvdial  - they are taken from the the 'master' pppd set up file which is /etc/ppp/options. We can look at the current options which are set by:

sudo egrep -v '#|^ *$' /etc/ppp/options

It is therefore desirable to make a backup before editing the /etc/ppp/options file so open a terminal and:

sudo cp /etc/ppp/options /etc/ppp/options_bak
sudo gedit /etc/ppp/options

I have made four changes to the file. The first two are essential for most GPRS connections and disable the sending and checking of the echo response sent to check the connection is alive - the echo is not implemented by most mobile service providers and the default result is that 4 echo response requests are sent at 30 second intervals and after he 4th failure to receive a response the connection is broken. If you are disconnected after 2 minutes that is the cause. The new values of 0 inhibit the sending and checking:

lcp-echo-failure 0
lcp-echo-interval 0

The third change is essential for the Vodafone Connect Card and does not impact other connections significantly so I do it routinely so I do not forget. It involves disabling negotiation of Van Jacobson style IP header compression by un-commenting

-vj

My wvdial control file also uses the no authorisation option by changing to

noauth

Note the information in the /etc/ppp/options file does not recommend that is changed in the main file. The documentation ( man pppd ) says that if there is a file ~/.ppprc it is used for user default options which could be used instead of modifying /etc/ppp/options - I have not tried that method as the simple way works for me and gives me a working system. I have the attitude that "if its not broken don't fix it" There is a lot more about GPRS connections via Mobile Phones and Cards in Ubuntu Linux on the Move but I have included it here so one does not forget when using this page to configure a system.

Interestingly when using GNOME-PPP to make the connection and only using an initialisation string to set up the APN, I seem to get a good connection both with my Vodafone Prepay SIM and the proper Vodafone Contract SIM with an automatic DNS provided unlike my experiences with wvdial. If I get problems GNOME-PPP enables one to manually set up the DNS addresses. I have not tried adding the other initialisation strings to force GPRS or 3G on the Vodafone Connect Card which came from the original scripts from  HOWTO: Using Option (Vodafone) 3G PCMCI card in Ubuntu PowerPC - Ubuntu Forums

Test so far have made a Dial-up connection via my Xircom PCMCIA card which was automatically detected on /dev/ttyS4. The Sony Ericsson T610 mobile phone connects via Bluetooth ( /dev/rfcomm0 ) and has been tested with an O2 SIM and Dial-up to my ISP (Freezone) and GPRS connections via a Vodafone UK prepay SIM, a Vodafone UK contract SIM and my Vodafone NZ SIM. The Bluetooth set up via device /dev/rfcomm0 has been covered above. All the GPRS connections were kept open for ten minutes and checked at the end to be alive. Note - without the lcp-echo setting changes they only worked for 120 seconds. Although SIM changes are needed the above 5 connections cover the most cost effective dial-up and mobile use I have available in the UK, NZ and most of the rest of the world. Further test aimed at improvements in convenience and speed through  the use of 3G showed GNOME-PPP could be configured just as easily from the Vodafone Connect Card or the XDA once I had understood how to access them. I see no reason to use low level programs such as wvdial in the future.

Conexant Soft Modems

The laptop also has a soft modem and I initially put off installing it as it seemed that relatively easy driver support was likely in the near future. I also had a Xircom PCMCIA modem and Ethernet card which I plugged in - it was recognised immediately and I had a telephone connect working a few minutes later so their was no urgency. 

The easy way to get a driver is through  linmodems.org  but  they either need a licence fee or are limited in speed. I first tied the procedures at Howto drivers Conexant softmodem - Ubuntu Forums to get a free driver loaded and nearly lost all as I ended  up with an un-bootable kernel and hung machine. Fortunately I had an older kernel left to boot into and I managed to recover eventually so take great care and back up anything valuable before departing from the approved routes. 

I then followed the correct procedures by loading a test program for the modem. A good starting place is DialupModemHowto - Community Ubuntu Documentation which sends one to linmodems.org  where one can get a free program to identify and help you install soft modems. This showed mine to be an Conexant modem packaged by ATI  as I expected. It directed me to download a package (specific to the kernel) to install the modem and the installation was fairly trivial - three lines in a terminal and a couple of questions to answer.

The drivers are restricted to 14 Kbaud unless you pay a $19.99 licence fee which covers one year of support and upgrades and they say will not be kernel or distribution dependent. At present I do not need a faster modem as I have the Xircom anyway. I really tested it all out for the sake of others and it all went together very easily. I believe the a further download and install will be required if the kernel is ever upgraded. If you have a machine with no connectivity you are often in a catch 22 situation for upgrades to set up connectivity. In this case it seems to be possible to download the two files on another machine and transfer them to get one up and running. With a dual boot machine you can, of course, get them under Windows and reboot. The modem software aliases /dev/modem to  /dev/ttySHSF0 and GNOME-PPP found the modem and worked immediately.

If you get a kernel update ie from 2.6.15.27 to 2.6.15.28 you will need to download a new .deb package from linmodems and install it in the new kernel.

O2 XDA Exec (HTC Universal)

Returning to the chronological order you will recall that I wanted in particular to be able to use the XDA Exec as a modem via Bluetooth in Linux as I had failed in Windows. It has also proved challenging with Linux and it took me 5 or 6 weeks before I found a way to get it working - if you follow the procedures here it should take a similar number of minutes! 

First pair the XDA and the laptop from the XDA Start -> Settings -> Bluetooth -> Tick make discoverable -> Devices -> New Partnership

The first problem was that I had difficulties in obtaining the channel used for Bluetooth as the command ‘sdptool browse <phone-bluetooth-address>’ gave no response. I did a man sdptool and sdptool -h and discovered that their were many more options and used an alternative option to search for all DUN connections which worked. You can use the following commands with the XDA:

hcitool scan
sdptool search DUN

In fact the second is actually all you need - see below for example with both my  T610 Phone and O2 XDA Exec on:

pcurtis@satellite:~$ hcitool scan
Scanning ...
        00:12:37:C6:81:31       P Curtis
        00:0E:07:2C:E8:82       T610
pcurtis@satellite:~$ sdptool search DUN
Inquiring ...
Searching for DUN on 00:12:37:C6:81:31 ...
Service Name: Dial-up Networking
Service RecHandle: 0x10003
Service Class ID List:
  "Dialup Networking" (0x1103)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 4
Language Base Attr List:
  code_ISO639: 0x656e
  encoding:    0x6a
  base_offset: 0x100
Profile Descriptor List:
  "Dialup Networking" (0x1103)
    Version: 0x0100

Searching for DUN on 00:0E:07:2C:E8:82 ...
Service Name: Dial-up Networking
Service RecHandle: 0x10000
Service Class ID List:
  "Dialup Networking" (0x1103)
  "Generic Networking" (0x1201)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 1
Profile Descriptor List:
  "Dialup Networking" (0x1103)
    Version: 0x0100

pcurtis@satellite:~$

I found, by trial and error that the T610 and XDA also responded to HF  - Hands Free gateway (6 - 2) and HS - Voice Gateway (1 - 3) and OPUSH (10 - 3) The full list includes according to the help file includes: DID SP DUN LAN FAX OPUSH FTP HS HF SAP NAP GN PANU HID CIP CTP A2SRC A2SNK AVRCT AVRTG SR1 SYNCML ACTIVESYNC HOTSYNC PALMOS NOKID PCSUITE

Now I  have access to several Bluetooth modems I thought I would experiment to see if I could set up a rfcomm1 as well as rfcomm0 as a Bluetooth device and found that one can add extra devices to the configuration file as below:

# RFCOMM configuration file /etc/bluetooth/rfcomm.conf. 
     
    rfcomm0 { 
    bind yes; 
    # Bluetooth address of T610 
    device 00:0E:07:2C:E8:82; 
    # 
    # RFCOMM channel for the T610 
    channel    1; 
    # Description of the connection 
    comment "T610 Dial-up Networking via Bluetooth"; 
    } 
    # 
    rfcomm1 { 
    bind yes; 
    # Bluetooth address of XDA 
    device 00:12:37:C6:81:31; 
    # 
    # RFCOMM channel for the XDA 
    channel    4; 
    # Description of the connection 
    comment "XDA Dial-up Networking via  Bluetooth"; 
    }  


Remember when testing that whenever you change a configuration file such as the above which you are going to use  you must reboot the machine or restart the relevant sub-system, in this case by:

 sudo /etc/init.d/bluez-utils restart 

The extra device appears in /dev so it can be accessed via the Network Manager, wvdial and the GNOME-PPP Dialer.

Firstly one should note that the XDA Exec is supposed to need the Wmodem program to be running and to be set to Bluetooth before it can be used as a modem. It certainly needs it to act as a USB modem with Windows. I found this was not required for Bluetooth - the only difference I could find was that one got a display of  'lights'. We now have a Palm Treo 750v running Windows mobile and have added a third device and it does not need the Wmodem program running wither.

I however still had one major problem - I could make a standard GSM dial up connection  via the XDA but not a GPRS connection using the initialisation string followed by a dialing string of *99***1#  - a mechanism that works perfectly with the T610. I  tried using both wvdial and GNOME-PPP and the same occurred with both - good GPRS connections via the T610 but only a GSM dial-up connection possible via the XDA.  I recall that I never made a satisfactory GPRS connection under Windows via Bluetooth and the XDA either and gave up.

I was at a loss until after many weeks I read in a script for a Mac accessing a Windows Mobile machine that Windows for Pocket PCs does not allow GPRS configuration changes through the modem interface - I therefore tried taking out the setting-up Init string and used a dialing code of  *99# which activates a connection using default parameters already in the XDA. It all then seemed to work fine. One obviously needs a working connection set up on XDA before using it as a modem and I note that the Options screen in WModem has a tick box to select a preset GPRS connection which was also set up in my case.

I initially tested it using a Prepay SIM then changed to a Contract SIM. I made a new connection for the Contract SIM in Start -> Settings -> Connections -> Connections -> Add a new modem connection in the usual way and then used it briefly so the new default route is set up. I also went into Start -> Programs -> Wireless Modem -> Tools -> Options and gave the new APN an left the box ticked - I do not know if that was necessary. I made no changes in  GNOME-PPP which then connected through the changed SIM.

Connection Times and Data Volumes

Having got everything working I decided it is useful to know how much ones sessions have cost. All the data is available in the system logs if you are prepared to plough through them.  The current on is in /var/log/syslog and older versions are /var/log/syslog.0 - even older versions are in compressed format. The first of the following searches for Times and Data flows in the current and previous log which usually cover at least a couple of days. The second does the same for the previous 6 zipped logs. Both must be copied as a single line into the terminal or set up an alias. Between them you should have a good idea of the bills you have run up over a week or more!

cat /var/log/syslog.0 /var/log/syslog | grep -e "Connect:" -e "Sent" -e "Connect time" | more

zcat  /var/log/syslog.6.gz /var/log/syslog.5.gz  /var/log/syslog.4.gz /var/log/syslog.3.gz /var/log/syslog.2.gz /var/log/syslog.1.gz | grep -e "Connect:" -e "Sent" -e "Connect time" | more

I leave the reader the exercise of creating a script and launcher to join them up and perhaps send it all to a file rather than scan it on the screen! An alternative is to put both commands onto a single line separated by a semicolon - again this must be copied and pasted as a single line into the terminal to work.

zcat /var/log/syslog.6.gz /var/log/syslog.5.gz /var/log/syslog.4.gz /var/log/syslog.3.gz /var/log/syslog.2.gz /var/log/syslog.1.gz | grep -e "Connect:" -e "Sent" -e "Connect time" | more; cat /var/log/syslog.0 /var/log/syslog | grep -e "Connect:" -e "Sent" -e "Connect time" | more

Wifi Connections

So far we have been covering dial-up and GSM/GPRS/3G connections but in due course this article will need to be extended to cover Wifi. At this time I will only mention Wifi-radar which is a tool to search for Wifi hotspots and allow easy connections which can be loaded by Applications -> Add/Remove.

WiFi drivers

Wifi cards in laptops are much better supported than modems but even so there may be a need to install drivers. he problem is that the drivers for a WiFi card are complex and few manufacturers support Linux. There are however a limited number of chips which are used by a large number of manufacturers and some of the most popular now have built in support in the kernel. Even then proprietary considerations mean that in some cases such as the Broadcom 43xx chips used by many manufacturers including Belkin and Dell need the proprietary firmware installed. Those that have no native Linux support can often be installed by a technique of 'wrapping' part of the Windows drivers in code to integrate them into Linux - the ndiswrapper mechanism. The basic windows .inf and .sys files can be obtained in many ways including from your Windows system or the CDs provided.

The code below shows that it need not be complex and covers the Belkin Card using the Broadcom 4306 chip. It got the WiFi up but had problems in integration into the system so one could not easily start a useful connection through it. This is based on a thread 
Broadcom (4306) - Ubuntu Forums  and the thread covers the two possible methods. All these mechanisms which use Windows drivers or place drivers into the kernel have a downside in that they need to be repeated if you upgrade to a new kernel - you do have the choice at boot-up which kernel you chose so you can use the old one until you are sorted. In some simple cases you may even be able to experiment using the LiveCD. The ndiswrapper actions are shown to indicate that it is not rocket science. First the tools are installed (that can be from Add/Remove Advanced). Then you find the windows drivers and put them in a directory ready for the next time, make the modules, install them and check and add them into the drivers loaded during booting up. In this case there may be an incomplete driver already present which needs to be removed from the sequence loaded at boot-up which is covered in the thread.

# First line is dangerous as it makes you a superuser better to put sudo in front of each of following instead
sudo su
apt-get install ndiswrapper-utils
# Change into directory where bcmwl5.inf and bcmwl5.sys are saved
cd ~/bcmwl5_drivers
ndiswrapper -i bcmwl5.inf
modprobe ndiswrapper
# Following should respond  hardware detected etc.
ndiswrapper -l
# now make sure ndiswrapper is run in the future at boot time
ndiswrapper -m

There are a number of useful commands which help find out what is going on - use man xxx to find out details.

iwconfig
iwlist scan

Configuration can be done using the System -> Administration -> Network or possibly wifi-radar .

The alternative using bcm43xx-fwcutter to load the extra firmware follows noting that the kernel version may need to be changed

# Copy the bcmwl5.sys and bcmwl5.inf files used in Windows to new directory ~/bcm4306
apt-get install bcm43xx-fwcutter
sudo bcm43xx-fwcutter -w /lib/firmware/2.6.15-26-386 ~/bcm4306/bcmwl5.sys
sudo rmmod bcm43xx
sudo modprobe bcm43xx

This seemed to work exactly the same as the ndiswrapper driver and the iwconfig and iwscan looked OK but in both cases no IP address was delivered most of the time although occasionally with both versions one got a good connection. I not pursued it further as I do not need the WiFi connection as I also have the ethernet connection.

More recently I returned to get this working as my network part of the motherboard was giving problems. I repeated the commands above updated to the new kernel and it all worked until a reboot. By now I had found out (see below) the need to open a terminal and do

		sudo ifconfig eth1 up

to activate the connection and that worked with WiFi encryption off after the reboot. I then installed Wifi Radar, turned encryption on again at the WiFi Router and set the connection up with WiFi Radar and it then worked through a number of reboots. This may be because of a Kernel fix or just luck so I have a turn on script ready in case I need it - again see below.

3Com 3CRUSB10075 USB WiFi dongle Latest update - I tried a 3Com 3CRUSB10075 USB WiFi dongle which is based on the ZD1211 chip initially without apparent success although I loaded an updated driver as per an article on the ZD1211 chipset in the Dapper - Ubuntu Forums .

During testing I found that it worked if I turned WEP encryption off and on further checking found that was the same for my Belkin Card using the Broadcom 4306 chip. Neither WiFi radar or the Network Administrator seemed to be able to set the encryption. However setting up using terminal commands did work. You can enable or disable an adapter using ifconfig and then set the encryption using iwconfig as below. Note the difference

		sudo ifconfig wlan0 up
		sudo iwconfig wlan0 key abcd1234ghjk4567liuy5678as

and that seems to work. I can find no references on the web to WEP not being set up with some adapters drivers so it may just be on my machine. Overall it is very peculiar as you seem to need to use both network administrator and the above commands after a reboot to get WiFi up when WEP is enabled, sometimes just disabling and re-enabling the connection is sufficient. If I needed it I would probably just rely on MAC filtering - WEP is easily hacked these days.

So the lessons are to always test with encryption etc off so you can identify where the problems are coming from.

Making WEP stick. More recently I have installed Ubuntu on a friends machine and had exactly the same problem of having to use iwconfig to set up WEP . His machine was a Desktop so the WEP key would never need to be changed so I did a quick and dirty fix to avoid having to run a terminal command as root every time by setting up a script to implement the above commands and run it at startup. The system runs many system scripts at startup and on Ubuntu they are accessed by symbolic links in the /etc/rc2.d folder (for normal startup at run level 2) to scripts generally kept in the /etc/init.d folder

I adding an extra symbolic link to my own script WifiStart by opening a terminal window and typing

 sudo ln -s /home/dugald/bin/StartWifi /etc/rc2.d/S99wifi

The script file StartWifi, needs to be owned by root and with permissions set up for everyone, I found the easiest way to create this was to use the file browser nautilus but opened as root by typing

 sudo nautilus 

in a terminal window. I then right clicked in the home directory and created the folder bin, opened the folder and then created the file StartWifi and immediately right clicked to properties and the permissions tab where I set read write and execute for everyone. I then double clicked to open it and selected edit to add the contents namely.

#!/bin/bash
ifconfig eth0 up
iwconfig eth0 key abcd1234ghjk4567liuy5678as

and saved it. Note that this is going to be run by root at startup so the sudo is not needed. I chose ~/bin as the home as this was a quick fix and ~/bin is the normal home for user scripts. If you do it properly and use /etc/init.d as the directory the script ought to implement start, stop and resume parameters which is extra work.

The Bottom Line

I now have everything I need for connections to the Internet on the move using Ubuntu Linux, in fact I am better off than with Windows as I now have a connection via Bluetooth and the O2 XDA Exec. I can use all my SIM cards in the T610 phone (GPRS not 3G) via Bluetooth, use the Vodafone Connect Card with the Vodafone SIMS offering GPRS/3G and use all the SIMs in my XDA which provides 3G. I can also use my Xircom modem for Land-line connections (and only need to pay to speed up the internal modem) and off course I have WiFi and Ethernet for Hotspots and Broadband at home. All the connections can be made with minor changes in the  GNOME-PPP using a GUI interface. There were many dead ends followed but for those following me only need to spend a few minutes in low level terminal activities to obtain some information and then make small changes in two or three files - why did it take me so long?

Communication Requirements

Interface Windows XP Score
0-10
Ubuntu Linux Score
0-10
Ethernet
  • Internet
  • Windows Network File and Printer sharing
Yes 9 Yes 9
WiFi
  • Internet
  • Windows Network File and Printer sharing
Yes 9 Yes 9
Dial-up modem (desktop) External Serial        Modem
 Built in Drivers
Internal 'WinModem'
 Driver software
 difficult to find.
10


6

External Serial Modem


Internal Modem

9


0
Dial-up modem (laptop) Internal 'WinModem'
 Driver software
 preloaded

10

Internal WinModem - no chance!

Xircom PCMCIA Modem
Plug and Play but it occupies my only PCMCIA slot and needs external dongle so it is a little inconvenient
0



6

Dial-up Mobile Telephone via Bluetooth Yes Yes Tested on desktop Yes
Software to monitor usage of data when a GPRS/3G connection is in use Icon in Tooltray Figures disappear when disconnected
No monitoring or logging software in use
3 Icon can be added to top panel
Figures disappear when disconnected
No monitoring or logging software in use except on phone itself
3
GPRS/3G Mobile Telephone via Bluetooth Yes. T610 phone keeps a log of data use Yes Tested on desktop
T610 phone keeps a log of data use
Yes ?
XDA to Laptop/Desktop
via Bluetooth
Files
Contacts
8 Files
Contacts
8
Mobile to Laptop/Desktop
via Bluetooth
Pictures
Contacts
8 Pictures
Contacts
8
GPS data transfer via a RS232 Serial Link 
There was No Serial link on the Laptop so a USB - RS232 interface which was supposedly compatible with Linux was ordered and installed
Routine but tweaking of the port number was need as it was allocated port 11, far too high for the GPS software. 8 Instantaneous but took time to check and find out that it was /dev/ttyUSB0 9
Vodafone Connect Card Special software with connection data logging 9 Accessible via GNOME-PPP like any other modem.
No TXT support.
No overall Data log
7
GPRS/3G XDA via USB or Bluetooth Special Proprietary drivers needed and WModem program has to be running on XDA.
Only USB works.
XDA does not log data use
6 Accessible via GNOME-PPP and Bluetooth like any other modem for GSM/GPRS/3G connections
WModem program does not seem to be needed to be run on XDA
XDA does not log data use
7
XDA synchronisation Email
Contacts
10 Ubuntu users are working on it -?

Before You Leave

I would be very pleased if visitors could spare a little time to give me some feedback - it is the only way I know who has visited, if it is useful and how I should develop it's content and the techniques used. I would be delighted if you could send comments or just let me know you have visited by sending a quick Message to me.

Fun with Ubuntu Linux  ||  Ubuntu Linux on the Move - Introduction | Dial up Modems | Bluetooth connection to a Phone Modem | GPRS Access via Mobile Phone | Vodafone Mobile Connect Card | GNOME-PPP | Conexant Soft Modems | Using Windows Mobile Devices as Modems | Monitoring Data Transfer | WiFi Devices and Software | Communications Requirements Table | Reader Feedback || Ubuntu Linux on the Take (Photo Support) || Open Source, Free and Cross-Platform Software

Home page | Pauline's Pages | Howto Articles | Uniquely NZ | Small Firms | Search

Copyright © Peter and Pauline Curtis
Content revised: 2nd October, 2007
Valid HTML 4.01!