Sunday, May 20, 2012

Bluetooth tethering for Android devices: making BlueVPN and BlueDUN work together




The BlueVPN application for Android acts like a "reverse bluetooth DUN" feature, or in other terms it is able to open a dial up connection on a bluetooth-enabled cell phone and use it as modem.  This function is natively supported for many operating systems (Windows, Mac OS, Linux ...) but not for Android:  the previous post showed how to create a modem internet connection on Windows 7.    At the current state, the only way to route all network traffic to a custom channel for a "not rooted" Android device is to open a VPN connection.  This is the reason for the application name.


What does mean "tethering"?

For people that are not familiar with the tethering concept, I quote here a definition taken from wikipedia:

"Tethering means sharing the Internet connection of an Internet-capable mobile phone or internet tablet with other devices. This sharing can be offered over a wireless LAN (Wi-Fi), over Bluetooth, or by a physical connection using a (USB) cable . In the case of tethering over wireless LAN, the feature may be branded as a mobile hotspot. The Internet-connected mobile phone acts as a portable router when providing tethering services to others."

While the Wi-Fi and USB tethering has been disabled on some Android devices the Bluetooth tethering is not supported in any case.  These features can be reenabled only by a device 'rooting' (hack the firmware to attain the superuser access) and there are several applications that work fine for rooted devices.
Anyway not all users are willing to alter the original manufacturer firmware because this operation does come with some risks.   The most notable risk is that you will void any warranty that you have on your device and you may have difficulty to find the original ROM for your device.
In addition, some users can run into problems, for example rendering the phone completely non-functional, having problems with reboots (endless boot cycles) or making the device more vulnerably respect to virus attacks.
The main benefit of using Bluetooth or Wi-Fi instead of a USB cable for tethering is that you can keep your cell phone in your bag or pocket and still make the connection.   Moreover, Bluetooth uses less energy respect to Wi-Fi and it is better suited for use in small portable electronics that rely on battery power.
This is because a Wi-Fi device is constantly transmitting data back and forth between connections, and it needs a lot of energy to transmit large amounts of data. Bluetooth, on the other hand, keeps a connection with very little energy being spent, about one-fifth that of a Wi-Fi connection.


The BlueVPN, app works also for "not rooted" devices ad allows to connect on-line an Android device without an Internet-access capability, sharing the connection available on another phone or tablet.

A said before, this application, routes the network traffic to a VPN connection and finally it exchanges the data packets throught the bluetooth channel.    VPN connections are fully supported  on the latest Android versions Ice Cream Sandwich 4.0.x but limited for previuos releases (Girgerbread 2.x and Honeycomb 3.x)

BlueVPN for Android 2.x and 3.x is quite unstable and difficult to set-up


while the version for Android 4.0.x (BlueVPN ics) is more simple and reliable



In this post we will see how to pair two Android devices for bluetooth tethering:  on the second device (host-router) we install the BlueDUN app to enable the bluetooth DUN profile [generally not natively supported].

Installation:

1. Create the BT pairing between the client device (with BlueVPN installed) and the host device (with BlueDUN installed).   For an unknown Android limitation it is a best practice removing any space in the Bluetooth device names before the pairing ( for example:  rename "My Phone" to "MyPhone" )

Settings / Wireless and Network / Bluetooth settings / Turn on bluetooth if off and make the device visible on both / Scan for devices;  when the name of the other device appears in the bottom list, click on it ( maybe you need to insert a paring code, for example 1234 ) and confirm.   Insert the same code, if necessary, on the host device and confirm.






2. Make sure you have a valid internet connection and the BlueDUN service running on host device

[ 3. Create a new VPN L2TP connection on client device - only for Android 2.x and 3.x ]

Settings Wireless and Network / VPN settings / Add VPN / Add L2TP VPN  


set VPN name = BlueVPN   and the VPN server = 127.0.0.1 ; disable the L2TP secret and leave empty the DNS search domains parameter.

4. Enter the BlueVPN setting panel and set:

      Authentication type =  None 
      Modem compatibility = diabled
      LCP compatibility = diabled
      Bluetooth insecure socket = disabled
      Primary DNS = 0.0.0.0
      Secondary DNS = 0.0.0.0




Normal usage:

[ 0. Enable the wifi/mobile data connection on client (required only to allow the VPN connection opening, but not used for data transfers) - only for Android 2.x and 3.x ]

This is a limitation of Android 2.x and 3.x: even if the VPN is enabled, the traffic is not routed toward it if the wireless connectivity is down.

1. Open the BlueDUN app on host device and start the service.



2. Open the BlueVPN app on client, click the host name in the BT device list

On Android ICS devices, the first time you click a button in the list, you may get a message that asks to confirm the VPN connection creation.   Check "I trust this application" and confirm; than click again the host device name on the device list. 


at  this point, the application tries to open the bluetooth connection with the host device and open the VPN  called "BlueVPN" to route the network traffic.


if everything goes right, you should see the stop button and the message "BlueVPN connected with ...."; otherwise, click on the animated central image to go back to the main menu. 


The VPN is really connected only if you can see on the notification panel a "key" icon and the traffic statistics by clicking on it (please don't disconnect the VPN direclty from here, but click the stop button when you have finished).



If BlueVPN does not connect automatically (Honeycomb), start it manually from the system settings (set any username and password):

Settings Wireless and Network / VPN settings / BlueVPN



While BlueVPN is connected you can open a browser and navigate the internet throught the bluetooth tethering.




Saturday, May 5, 2012

BlueDUN: Connect Windows 7 PCs to internet via bluetooth through Android phones

This post shows how to install and configure Bluetooth and pair your computer with an Android mobile phone to enable the internet connection.

Prerequisites are that you have already installed the bluetooth adapter on your windows 7 computer and turned on the bluetooth interface.

The pairing process can be started both from computer and phone. If you choose to start from phone you need also to enable in the Bluetooth Settings  the option: "Allow Bluetooth devices to find this computer".
In this example, I will choose to start the pairing from your computer.


In the notification area, click on the small arrow to reveal a whole set of additional icons. Then, right click on the Bluetooth icon and click on "Show Bluetooth Devices"


Now you can see the list of the previously paired devices, but, before clicking "Add a device" to create a new pairing with your phone it is necessary to turn on the BlueDUN service on phone.


Open the BlueDUN app and enable the "Discoverable" option on preference panel (click the menu button to access to the preferences); now when you start the service you should get the message "Bluetooth permission request" asking you to enable the bluetooth visibility status for a limited time. 





If the BlueDUN service is running on the phone, you can click the "Add a device" button on PC; this starts the "Add a Device" wizard, which automatically scans for new devices, including Bluetooth ones.
After a few seconds, your phone should show up in the list of available devices. If it doesn’t, then you need to make sure Bluetooth is enabled on the phone and the phone is set as discoverable.

Select your phone and click Next.




The wizard displays a code that you need to type on your mobile phone, so that the pairing is completed.



On your mobile phone, you are notified that your computer wants to connect via Bluetooth. Press OK, then type the code.   Once the code is entered, the pairing is created and Windows automatically searches for drivers for all Bluetooth profiles available on your mobile phone, then installs them.



To check the discovered and installed BT profiles, you can right-click the phone you’ve just added and choose Properties:



Note:  the "Dial Up Network (
DUN)" profile will be available on phone only when the BlueDUN service is running; if you pair the devices in a different condition, you will not be able the create a new internet connection on PC.   In this case, remove the old pairing and create a new one following the above steps.



Make sure the DUN profile is also selected and click OK to confirm.
Now it is the time to create a new internet connection to access the internet throught the  bluetooth phone tethering:  right-click again your phone and then choose "Dial-Up Networking" > "Create a dial-up connection…"




after clicking that, it will ask for what Modem device to use in your dial-up choose the last one, if it doesn’t work, try the others...



now enter the mandatory dial-up number ( for example  *99***1#  is the mostly used ), and enter a name for your dial-up connection… no need for username and password with the BlueDUN app …


after entering the details, click Connect, it will try to dial the number in your phone and registering your connection to networks server, and after that it will test your connection…




On the BlueDUN app you should see the "Modem negotiating.." message and soon after the panel with connection statistics indicating the connection was established with success.



Now your done! Click close button to close the window, and Open your browser to start surfing the web, Enjoy!




Reference:  http://www.7tutorials.com/transfer-files-between-devices-your-windows-7-pc-bluetooth