Sunday, May 5, 2013

BlueVPN+, connect your Tablet to internet with a USB modem (3G or PSTN)

The BlueVPN+ app allows the use of 3G or PSTN modems attached to USB host port.  Not all tablets have the USB or microUSB port but they are provided only with a proprietary connector;  in these cases you need a OTG cable or adaptor from the special connector to USB female connector.







Prerequisites:

A) Make sure your USB device is switched to modem feature only and the auto running is disabled:

The following procedure must be executed before using the USB stick with BlueVPN

1) Connect the modem to a PC running Windows and make sure it works.

2) Download the  Hyper Terminal  application, extract the zip file and run  hypertrm.exe

[ for Windows XP  you can find HyperTerminal under  Star t>Programs>Accessories>Communications>HyperTerminal ]

3) In the "Connection Description" write any Name, say "Huawei" for example, and click OK. 


4)  Wait for the appearance of the window "Connect To" and in the "Connect using:" option select the name of your USB modem ( for example:  "HUAWEI Mobile Connect - 3G Modem" ) ;  click OK.



5)  Close the next window by pressing the "Cancel" button.




6)  On the toolbar of the program, press the last icon "Properties";  that opens the "Properties" window.
Select the  "Settings" tab and click the "ASCII Setup" button;  put a tick in the checkbox "Echo typed characters locally"
Click OK two times for closing the ASCII setup window and the Properties window.


7) In the main window you should see a flashing cursor:   turn on the CAPS LOCK,  type the command "AT" and press ENTER.  If comes the answer  "OK"  means the terminal is connected to the modem. 



8) Introduce one of the following 

For Huawey modems:

  AT^U2DIAG=0      (device-only modem)
  AT^U2DIAG=1       (the device as a modem + CD-ROM)
  AT^U2DIAG=255   (the device as a modem + CD-ROM + Card Reader)
  AT^U2DIAG=256   (the device as a modem + Card Reader).

For using the modem with a tablet the USB stick has to be configured as "device only modem"
Type the command  AT^U2DIAG=0 and press ENTER.



For ZTE modems:

   AT+ZCDRUN=8   (disable flash cd-drive)
   AT+ZCDRUN=9   (enable flash cd-drive)

9) After the response "OK" from the modem, close the window Hyper Terminal, answering "Yes" to the proposal to interrupt a session and refusing to stay connected.

10) Make sure that CD-ROM emulation is disabled.   To do this, disconnect the modem from the USB port and then reconnect it in the same port.   In "My Computer" should not appear a drive for the USB stick.

If you need to recover the modem to its original state, you have to repeat the whole procedure, but using the command AT^U2DIAG=255 (the device as a modem + CD-ROM + Card Reader).

All these actions are no more required since BlueVPN+ version 1.5:
The new versions include a file with parameters  for  most popular devices and sends the code for switching automatically the USB stick to the modem feature.   Probably you will need to confirm twice the USB exclusive access message because after the switch the device is disconnected and immediately reconnected with a different ID.


B) You need a powered USB hub if your Android device supplies low USB power

On some tablets there is often not enough power available for attached USB devices.
Wireless modems are among the devices with the highest power demand (500 mA straight).  Usually, only some larger tablets can provide that much power on their host ports (with Samsung, even the 10.1" devices are reportedly power-limited).  Smaller ones often have their limit at 100 mA which rules out using a large array of devices. One notable exception is the Nexus 7 which works fine with many 3G sticks attached directly.  To bypass the problem you can use a (self-)powered hub:




or alternatively a mobile power battery charger like that (Tekkeon TekCharge MP1820) showed in this video:




NOTE:  some USB devices require some time after the modem switch before accepting AT commands; in this case it is possible to increase the Connection Timeout parameter.



BlueVPN+  common configurations:


a) Phone with Bluetooth Modem:  [ also valid for BlueVPN ]

Modem compatibility:   generally OFF        ( if enabled removes the <cr><lf> before AT commands )
Modem Line Feed:    generally ON              ( if disabled removes the <lf> in AT commands )
AT Initialization:  E0V1&C1&D2
Connection Timeout:   3000 ms                    ( repeat the AT initialization if not received a reply after some ms )
Inter-character delay:   0 ms                         ( increase the value only for very slow devices )
Modem speed:    [not important]
LCP Compatibility:   generally OFF
BlackBerry Compatibility:  generally OFF  (ON for Blackberry phones and if you get issues during negotiation )
Phone Number:    *99***1#  or  *99#   (  #777 for CDMA )
Access Point:   service provider  APN  ( <empty> for CDMA 
Authentication Type:  Password Authentication  ( or Challenge-Handshake )
UserName:  account for the service provider (generally the email) / <empty>
Password:   password for the account / <empty>
Primary / Secondary DNS:  0.0.0.0  (automatically assigned) 
Bluetooth Insecure Socket:   OFF  (ON if you get issues with bluetooth channel) 
DUN service channel:    0  (number >0  if you get issues with bluetooth channel) 

b) Android Smartphone with BlueDUN:  [ also valid for BlueVPN ]

Modem compatibility:   generally OFF        ( if enabled removes the <cr><lf> before AT commands )
Modem Line Feed:    generally ON              ( if disabled removes the <lf> in AT commands )
AT Initialization:  [not important]
Connection Timeout:   3000 ms                    ( repeat the AT initialization if not received a reply after some ms )
Inter-character delay:   0 ms                         ( increase the value only with very slow devices )
Modem speed:    [not important]
LCP Compatibility:  OFF
BlackBerry Compatibility:  OFF
Phone Number:   [not important]  
Access Point:   [not important]
Authentication Type:  None
UserName:   <empty>
Password:    <empty>
Primary / Secondary DNS:  0.0.0.0  (automatically assigned) 
Bluetooth Insecure Socket:   OFF  (ON if you get issues with bluetooth channel) 
DUN service channel:    0  (number >0  if you get issues with bluetooth channel) 

c) PSTN Modem:

Modem compatibility:   generally OFF        ( if enabled removes the <cr><lf> before AT commands )
Modem Line Feed:    generally ON              ( if disabled removes the <lf> in AT commands )
AT Initialization:  E0V1&C1&D2
Connection Timeout:   3000 ms                    ( repeat the AT initialization if not received a reply after some ms )
Inter-character delay:   0 ms                         ( increase the value only for very slow devices )
Modem speed:   less or equal to 115200 bauds
LCP Compatibility:  OFF
BlackBerry Compatibility: OFF
Phone Number:   number of service provider
Access Point:  <empty>
Authentication Type:  Password Authentication
UserName:  account for the service provider (generally the email) / <empty>
Password:   password for the account / <empty>
Primary / Secondary DNS:  0.0.0.0  (automatically assigned)

d) USB Stick Modem:

Modem compatibility:   generally ON         ( if enabled removes the <cr><lf> before AT commands )
Modem Line Feed:    generally ON              ( if disabled removes the <lf> in AT commands )
AT Initialization:  E0V1&C1&D2
Connection Timeout:   3000 ms                    ( repeat the AT initialization if not received a reply after some ms )
Inter-character delay:   0 ms                         ( increase the value only for very slow devices )
Modem speed:   460800 or  921600 bauds
LCP Compatibility:  OFF
BlackBerry Compatibility: OFF
Phone Number:   *99***1#  or  *99#   
Access Point:  service provider  APN
Authentication Type:  Password Authentication
UserName:   <empty>
Password:    <empty>
Primary / Secondary DNS:  0.0.0.0  (automatically assigned)
Modem switch code:   required only if the device is not included inside the internal list; the text is similar to the following 


    MessageContent=5553424312345678000000000000061e000000000000000000000000000000
    MessageContent2=5553424312345679000000000000061b000000020000000000000000000000
    NeedResponse=1
    Interface=0

The message content strictly depends on the device brand and modem:  you can find some examples here:

For the APN list please refer to the following document: