| Home | Pauline's Pages | Howto Articles | Uniquely NZ | Small Firms | Search |
| 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
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.
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.
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.
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.
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" .
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 .
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:
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.
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:
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'.
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.
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
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 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
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!
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:
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
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:
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
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
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:
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
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.
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.
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:
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.
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
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 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.
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.
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?
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 |