It’s been a long time since I don’t write about any computer stuff so here I’m back again showing you how to use your mobile phone as a bluetooth modem under Linux. I needed it a couple of weeks back when I was travelling and wanted to be able to check my e-mail anywhere so I hope it seems usefull for you tu.
First of all a few important facts:
- I’m using a Nokia N70 but it should work with almost any device
- I’m using a Spanish SIMYO card
- I’m running a Debian GNU/Linux SO with some required packages (bluez, bluez-utils, wvdial)
Altough the process should be quite simple (pair your computer with your phone and then use it) I found lot of troubles while pairing that I’ll show how to solve.
First of all you should check if your mobile phone supports acting like a bluetooth modem so do ‘sdptool browse’ and look for something like “Dial-up Networking” (obviously have your bluetooth enabled in both PC and phone).
Okey, now lets pair both devices (here is where I found most of my problems) as none of the pages I found showed how to do it. Pairing means allowing a connection from PC to mobile phone or vicebersa.
Edit your ‘/etc/bluetooth/rfcomm.conf’ to assign a device (MAC) and channel, use which you get in the previous step.
Now let’s try to connect using ‘rfcomm connect rfcomm0’ which will prompt a message in your mobile phone to allow or deny the incoming connection and probably a PIN number.
If you get this ‘Connection refused‘ even if you are allowing it and inserting correctly your PIN (the one specified in /etc/bluetooth/hcid.conf’), it means that you need a key agent. Anyway check your syslog to see if this is what it’s going wrong:
So, this mean that what’s going wrong is that you insert any PIN in you phone and the computer doesn’t recognize it so it denies the connection request. If you have the ‘gnome-bluetooth’ package installed it is said that it should prompt a PIN code to insert the same PIN that you inserted in your phone but, at least for me, it’s not working. The solution? Use bluetooth-agent which sadly doesn’t have any man page so I had to do several tests in order to make it work.
What you have to do before trying to connect using ‘rfcomm’ is telling the bluetooh agent which PIN are you going to use, so run:
And after that try to connect:
There you are!, you’ve finally paired your devices!. Now, the rest of the process is quite easy. Edit ‘/etc/wvdial.conf’ as following:
You might have to make some changes if you’re using a different network operator like phone number, username, password and the Init3 part where here it says “grps-service.com”. For the first one contact your operator, and for the following check in your mobile phone: tools -> settings -> connection -> access points, and choose the one you’re using to see the correct values.
Now we’re done, just run ‘wvdial SIMYO’, wait until the negotiation finishes and enjoy checking your e-mail or surfing the web:
That was all. Hope it helps 🙂