A few days ago I wrote a tutorial on how to connect your Mac to a GPRS service via Bluetooth and a Bluetooth-enabled phone. However, not everyone owns a Mac or a higher-end phone. And so here is a quick tutorial on how to connect your Linux laptop to a GPRS service using an infrared-enabled phone. For this article we used a Sony Ericsson K700i phone, a Sony Vaio N505VX laptop (which has an onboard IrDA) running the latest Arch Linux and Cingular’s GPRS. In the following weeks I will also be publishing two more tutorials showing how to do the same thing under Linux but via Bluetooth and the USB port.Note: While this effort is geared around Arch Linux, it should be easy to modify for any other Linux distribution by following the distro-specific package management, services start up, etc. Obviously, some of the steps must be done only once (for the setup), while others must be done each time before you dial to GPRS.
Login as root on a terminal. Download and install all the needed applications by issuing the following command on that terminal:
pacman -S wvdial irda-utils setserial wvstreams ppp nano
Edit the /etc/conf.d/irda file and change the DEVICE’s value to /dev/ttyS0 and above that line add IRDA=yes. Then enter:
setserial /dev/ttyS2 uart none (this seems to be necessary on *my* laptop, otherwise the infrared driver refuses to load)
Depending on what findchip outputs, you must find the right driver for your laptop. For example, mine says that my laptop’s chipset is a NSC one. So, you navigate to /lib/modules/2.6.XX/kernel/drivers/net/irda/ and make an “ls” there. So, after a quick look there, if you also have an NSC chipset, you can easily understand that you need to use the nsc-ircc module. If you have something else, use whatever module has a similar name of what “findchip” found. So, load the specific driver for your infrared chipset as such:
modprobe nsc-ircc dongle_id=0x0b
If you instead are using a usb-to-irda adapter (and so your infrared is not part of your laptop), you might need to take extra steps (refer to the IrDA manual).
If you are using a buggy Sony Ericsson phone (the T-series are known to have a buggy IrDA implementation), you might need to also do the following every time:
echo 115200 > /proc/sys/net/irda/max_baud_rate
echo 2000 > /proc/sys/net/irda/max_tx_data_size
echo 1000 > /proc/sys/net/irda/min_tx_turn_time
echo 1 > /proc/sys/net/irda/max_tx_window
Then, start the IrDA service as such:
Then, load a few more modules that the IrDA service doesn’t take care of for you:
You should be having some /dev/ircommXX devices on your /dev folder. If you don’t something is wrong, or you might need to create them yourself (usually this happens on 2.4.x kernels).
Now, create a call configuration file for wvDial:
In it, type the following for Cingular GPRS (change accordingly for your GPRS service):
Modem = /dev/ircomm0 (or /dev/ircomm1, depends on your hardware)
Baud = 115200
Phone = *99***1#
Username = WAP@CINGULARGPRS
Password = CINGULAR1
New PPPD = yes
Stupid Mode = 1
Save the file and exit the nano text editor. Now load the resolv.conf:
and enter in it the Cingular GPRS DNS servers (change these numbers to your own GPRS’ service DNS numbers if you are not using Cingular):
Save the /etc/resolv.conf file.
Take your phone, and enable Infrared in it. On some phones, you might need to place the phone in “modem mode”, while on other phones this is automatic. Additionally, having the GPRS settings of your provider already setup’ed in your phone, is helpful.
Now, place the phone 20cm away from the laptop’s infrared port, and place it in a way that the two infrared ports face each other. On the Linux laptop enter in the command line:
If wvdial doesn’t connect, execute this:
irattach irda0 -s
and then retry ‘wvdial CingularGPRS’.
That’s it! A few seconds later, you should be connected to the internet via GPRS and start paying $1 per 100KBs. Infrared in SIR mode should be able to deliver about 8 or 9 KBs/sec. FIR mode is faster, but more incompatible, so I don’t recommend it.
If you run into trouble, use “irdadump” which is a debugging tool for IrDA and “irdaping any” to ping other IrDA devices. And a suggestion: to minimize the amount of data flowing through your GPRS connection (so you pay less), disable images/flash/java etc rendering. Also, here’s osnews’ lite headline page: www.osnews.com/jphone.php and here is slashdot’s: http://slashdot.org/palm/