12.07.2015 Views

Mobile Internet access with GPRS - Linux Magazine

Mobile Internet access with GPRS - Linux Magazine

Mobile Internet access with GPRS - Linux Magazine

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

COVER STORY<strong>GPRS</strong> in <strong>Linux</strong>not connected to your PC, you may evenneed to confirm the connection.The /sbin/ifconfig command gives youa list of active network devices. As <strong>GPRS</strong>uses a PPP connection, you should seean entry for the ppp0 device if the connectionis up. If you find this entry, youcan type ping www.kde.org to see if youcan contact the KDE project web server.At average <strong>GPRS</strong> speeds of 5-10 kbps, itcan take a couple of seconds for the firstresponse to start coming in. If pingresponds <strong>with</strong> an unknown host error,your nameserver settings may be false.Try to ping the KDE website using the IPaddress in this case:ping 80.232.38.131If the IP address works, you need anentry of the formnameserver IP addressto add at least one nameserver to the/etc/resolv.conf file. Check [2] for detailsof your provider’s nameserver.Now that you have successfully establisheda connection as root, you can dropyour privileges and repeat the experimentusing a normal account. Theaccount you use will need execute permissionsfor /usr/sbin/pppd. The systemadministrator can grant a user therequired permissions by entering thefollowing command:chmod +s /usr/sbin/pppdIn many cases, temporary problems canbe resolved by switching your phone offand back on.Unpleasant SurprisesEasy Connect makes child’s play of settingup an <strong>Internet</strong> connection via amobile phone. However, make sure thatINFO[1] Project homepage:http:// easyconnect. linuxuser. hu[2] <strong>GPRS</strong> <strong>access</strong> data:http:// www. taniwha. org. uk/ gprs. htmyour mobile <strong>Internet</strong> connection doesnot burn a hole in your purse.Most providers charge a monthly basicrate for the use of <strong>GPRS</strong> or UMTS – nomatter whether you just want to testyour connection using ping or download1 MB of data. Packages <strong>with</strong> larger trafficvolumes can cost up to 100 dollars permonth. <strong>GPRS</strong> traffic can cost up to 20dollars per MB of download volume.UMTS is cheap in comparison: expectto pay about 2 dollars per MB for UMTSservice, depending on your contract.Many providers expect you to sign a2-year contract in order to receive specialservices such as <strong>GPRS</strong>. ■Current distributions should have notrouble handling Bluetooth setup: simplyattach the USB dongle and launch theBluetooth system by entering /etc/init.d/bluetooth start (Suse and Fedora) or /etc/init.d/bluez-utils (Ubuntu). Suse <strong>Linux</strong> 9.3actually enables Bluetooth services automaticallyas soon as you attach anadapter. Typing hcitool dev will tell youif <strong>Linux</strong> has correctly identified yourdongle. The output from this commandshould show you the connected deviceand its Bluetooth address:marcel@kim:~> hcitool devDevices:hci000:10:C6:29:2E:15You can then enter hcitool scan to checkfor your mobile phone. Note that simplyenabling Bluetooth on your mobile willnot get your very far. The phone has tobe in visible mode. The following exampleshows that the program has detectedboth the phone (Z1010) and a PC(ubuntu-0):marcel@kim:~> hcitool scanScanning ...00:0E:07:BF:B4:C400:04:61:81:5C:6BZ1010ubuntu-0The last step is to set up a serial connection<strong>with</strong> the mobile; you need to be rootfor this. Again, you will need to run hcitool scan; note the Bluetooth address forthe phone (watch out for the additionalConnecting your Phone via Bluetoothnull between bind and the address):rfcomm bind 0 00:0E:07:BF:B4:C4If this command returns Connectionrefused, you probably need to pair thephone <strong>with</strong> your PC. To do so, enter afour (or more) digit PIN code in /etc/bluetooth/pin. Make sure the file containsonly the PIN code. Then restartthe Bluetooth service and launch yourmobile phone’s Bluetooth device searchfunction. If the phone prompts you forthe PIN code, enter the code from /etc/bluetooth/pin.To test the connection, become root andenter minicom -s; select /dev/rfcomm0 asthe port, and set the speed to 115200baud. Now type the AT command ATI tooutput your mobile phone name.The rfcomm command shows you theactive connections. To close the connectionto the PC, again become root andenter rfcomm release 0.Access Privileges: To open a connection<strong>with</strong> rfcomm, you must be root. Ofcourse, you will want to <strong>access</strong> the serialBluetooth port using a normal useraccount. To do so, first modify the permissionsfor /dev/rfcomm0. For older<strong>Linux</strong> distributions that do not usedynamic device files, simply type chmod666 /dev/rfcomm0 to do this. More recentdistributions create the device file onthe-flywhen a Bluetooth adapter is connected.In this case, you can either resetthe file permissions every time youattach a Bluetooth device, or change theUdev settings for the device.To do so, open the /etc/udev/rules.d/50-udev.rules file in your editor,and add the following line (Suse<strong>Linux</strong> 9.3):KERNEL="rfcomm*", NAME="%k" UGROUP="uucp" MODE="0660" UOPTIONS="resmgr"For Suse <strong>Linux</strong> 9.2, open /etc/udev/permissions.d/udev.permissionsin the editorand add the following line:rfcomm*:root:users:0666Ubuntu already has a line that starts <strong>with</strong>rfcomm[0-9]*. In this case, you can simplyset the permissions to 0666. Users<strong>with</strong> Fedora Core 3 don’t need to makeany changes. The /dev/rfcomm0 automaticallybelongs to the logged on userin this case.Automating connections: To removethe need to type the bind commandmanually, you can tell the Bluetoothsystem to bind automatically. To do so,edit the /etc/bluetooth/rfcomm.conf file.Change the bind no; entry to bind yes;,and enter your phone’s Bluetoothaddress in device 11:22:33:44:55:66;, forexample:device 00:0E:07:BF:B4:C4;Remove the hash sign at the start of theline, if any.24 ISSUE 58 SEPTEMBER 2005 W W W. L I N U X- M A G A Z I N E . C O M

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!