Showing posts with label bluetooth. Show all posts
Showing posts with label bluetooth. Show all posts

Thursday, March 05, 2009

Using mobile's GPRS/EDGE for Internet connectivity on computer

GPRS/EDGE services provide internet access to mobile handsets. The services have become readily available and are very economical that many people have started using GPRS/EDGE on their mobile phones. I have it for atleast 3-4 years now in India and I find it really useful specially while travelling when you need frequent access to data and might not be connected to Internet otherwise. I use it to read news and check emails specially and even to track the train's timings and current status as I wait for the train in the junction -- believe me it is handy.

To add to its existing benefits, wouldn't it be wonderful if one can connect to Internet on a desktop/laptop PC using the mobile phone's GPRS/EDGE service? And yes it is possible.

Technically there are 2 possible ways to do this:

1. Connecting to Internet using the mobile as a GSM modem; so one can just dial in to their network service -- the dial up networking service (DUN). This method has been very common and almost all decently higher end phones support an interface for GSM modem. On installing the correct drivers on the computer, the mobile when connected over (usually) USB will be recognized as a USB based modem which can be used to dial in. Obviously, this requires support from the mobile service provider. Many service providers (including Airtel, Vodafone) do support this option but usually are costly and not worth it if you aren't roaming a lot. (eg., paying a monthly rental of Rs.200 on a data plan but using it once a month is not worth the money). But remember this is the easiest and widely available means to connect.

2. The computer connects to your mobile phone and establishes a personal area network (PAN) between them. This network shall be established in any means that you have -- maybe a USB Lan over USB, or a Bluetooth PAN over bluetooth. Once the network is established, if the phone can route the traffic to/from the computer to the EDGE, you have an Internet connection on your computer. At application level, if you can manage to run a HTTP proxy server (you can even write your own) on your phone that can work over the EDGE on the other side, it should do. You can configure the browser on the computer to use the phone as the proxy server. The other best option is : if the OS on the phone supports to make the phone as a full fledged router to route the data between your EDGE network and the computer. Unfortunately this option is pretty difficult to customize yourself if the phone does not support it -- as it needs support at the OS level.

Now, Windows Mobile (and Windows OS) users take a deep breath; we are saved. Fortunately Microsoft has implemented the 'Internet sharing' functionality into Windows Mobile (I guess 5.0 and above) which allows us to do exactly the same thing (with a Windows computer). The interface is very simple and is much easier to use than even the GSM modem counterpart.

On your WinMo phone, just click on Start->Programs->Internet Sharing. The following (or similar) window would popup.





Now select the mode of connection you want to connect through. USB connectivity is easier if you do not know how to connect over Bluetooth PAN. Connect your Windows Mobile mobile onto your computer through an USB cable (I assume the standard setup to communicate over ActiveSync is installed on the computer). On the Internet Sharing dialog on your mobile, just select USB and the appropriate service connection point that you have configured on your mobile. Click Connect. The mobile registers itself with the computer as a 'Windows Mobile based Internet Connection sharing device' and a virtual network adaptor gets installed. Then it also creates a Network connection that connects automatically to your Windows mobile over DHCP and acquires an IP address to talk over. You should be able to see the new connection in your Network Connections dialog (Start -> Control Panel -> Network Connections) with the status as 'Connected'. In addition, you can also run ipconfig to see the new connection's IP address etc., That's it. Now you are all set to browse the Internet using your computer. Just open up a browser and start browsing.

Caveats:
1. If you are using Vodafone Live (or a similar variant from any other service provider who restricts the use only to mobiles), every thing will go through as explained, except that your browser would not be able retrieve any data or would always show '403 Forbidden'. It is possible to work around this, you might have to wait for my next post on this. I do this.

2. Incase your computer is connected over ethernet/wifi to your local network which has a default gateway configured, you might have to tweak your routing table to redirect the Internet traffic to your mobile phone.

Saturday, December 13, 2008

Bluetooth Autolock for Windows

Are you having to lock your laptop/PC when you leave your place and again unlock it everytime you come back? Are you tired of unlocking your comp everytime? (arae yaar, say "yes"). Then this app is for you. This app would automatically lock your comp when you move out of your place and unlock it when you are back :) sounds useful? Technically, this is not exactly what is possible. This app actually shows up a screen saver hiding the whole screen when it detects that you are away; saying like 'You know what? Gerald is away so this comp is autolocked' -- fancy enough?

when you are back the screen saver is automatically closed and you are back to where you were.. uhhh!! wait wait... it will really lock your comp when it detects any keypress or mouse movement while you are away -- ok so you are safe. It is technically impossible to unlock a machine programmatically (even if the password is known), so this is the max that can be done. So incase if someone intrudes when you are away, the computer is locked and you will have to manually unlock it; but all in all you are safe still. And nothing needs to be installed on your mobile device.

A snapshot would help you follow further




(btw, the hardware id shown is not my phone's -- in case you thought about it)

The whole idea is to track the user by bluetooth. You need a mobile (or anyother device that supports bluetooth modem (DUN) or bluetooth serial port (SPP) profile) with bluetooth enabled. Almost all mobile phones with bluetooth, support atleast one of these -- so don't worry if you have a mobile phone. Your bluetooth device/dongle on the computer should be powered by Broadcom's (previously WidComm) bluetooth stack (this is most common, it is more likely you already are running on this) -- sorry to BlueSoleil/Windows stack users. (I will post a workaround for you people later).

As it is clear from the UI, just configure the COM port in which your bluetooth modem (or bluetooth serial port) is installed on your computer. The application automatically detects the available COM ports and lists only them (actually I've disabled this feature for the moment, as this adds up to the application startup time and hits by debugging latency). Next is to type in the bluetooth hardware ID of your mobile (as shown in the example). Now using your widcomm bluetooth application, pair your computer and your mobile phone (by typing the passkey etc). All set!

One optional thing is the sensitivity. Based on how enclosed/open your cubicle is, and when you would want yourself to be called as "away", you might want to tune the sensitivity. The 'status' button shows the current status as seen by the software; either "reachable" or "not reachable". This should help you to tune your sensitivity level and also to make sure you configured everything right.

When it's all done, just press AutoLock and forget the fear of locking/unlocking the computer.

I had to go through a number of prototypes before zeroing on this. I also have a working version which tracks the user through Wifi. The wifi chip is power-hungry and it is not practically affordable to run wifi continuously on your mobile (possibly resolved with the new invention from broadcom). Anyways for now, no no no! So I had to fallback to bluetooth for usability, inspite of losing precision.

This app is in my labs for more than a week now and is doing well with ongoing fixes.. Will post an update once I'm convinced that I should release ;) I will also post a separate blogpost about the technical details behind this app -- for the developer audience.