# How do I use my mobile phone to connect to the internet?

## herbert12345

Hi,

I want to use my mobile phone (LG KU990) to connect to the internet. This should be possible via bluetooth, though connecting the phone via an USB cable is an option. Searching the web I found the following article: 

http://www.spiration.co.uk/post/1307/Ubuntu%20Linux%20-%20Bluetooth%20and%20GPRS%20dialup%20connection,

which is based on Ubuntu and slightly dated. Nevertheless the required software appears to exist on my system. Using

```

hcitool scan

```

I can see my phone and 

```

sdptool browse <Address>

```

shows me that a dialup-service exists on my phone.

The problem here is that creating a connection to the phone using

```

hcitool cc <Address>

```

does not appear to create a stable connection: When I type hcitool con shortly after creating the connection, the connection appears and a few seconds later it is gone.

I finally was able to pair my cell phone with my computer using blueman and transmit a file. Nevertheless following the process described in the mentioned article I was not able to get a working internet connection. I have created the following config files:

```

debug

noauth

connect "/usr/sbin/chat -v -f /etc/chatscripts/bluetoothconn"

usepeerdns

/dev/rfcomm0 115200

defaultroute

crtscts

lcp-echo-failure 0

```

and

```

TIMEOUT 35

ECHO    ON

ABORT   'nBUSYr'

ABORT   'nERRORr'

ABORT   'nNO ANSWERr'

ABORT   'nNO CARRIERr'

ABORT   'nNO DIALTONEr'

ABORT   'nRINGINGrnrnRINGINGr'

''      rAT

OK      'AT+CGDCONT=2,"IP","btmobile.bt.com"'

OK      ATD*99***2#

CONNECT ""

```

and also

```

rfcomm0{

device 00:22:A9:47:F9:62;

channel   8;

comment "DialUp internet";

}

```

following the quoted article. After having done everything I can type

```

pon bluetoothconn

```

and get no error message. But when I disconnect from LAN using NetworkManager, my internet connection is gone.

What am I doing wrong? By the way I am using Kernel 2.6.30-r1 and PPP support is activated. Also, I have bluez version 4.39, ppp version 2.4.4-r22

Thanks in advance for all help,

Christoph

P.S.:

Most GUI bluetooth tools like kdebluetooth don't work emitting some DBUS error message. DBUS version is 1.2.12

----------

## poly_poly-man

I've never had to go through ppp on my phone... an HTC kaiser running windows mobile.

Basically, if you set it up so that activesync's "advanced network functionality" is present, plugging into the USB gives you a rndis network device instead of a usb-to-serial converter device. From there, start up the internet connection sharing program, launch the connection, and use a dhcp client on the network device on your computer. 

So, even though you appear to not have a winmo phone, the moral of this story: Make sure internet sharing is actually enabled on the phone, and try to get it to recognize as a network device instead of a serial port.

----------

## herbert12345

Thanks for your reply. Indeed my phone is not a winmo phone. There is no configuration option on conection sharing. The manual tells me to use the software from the driver CD, but that is of course for windows.

----------

## szczerb

No, poly - you're most likely wrong.

First you need to sort out the dbus problem. Make your file look like that (and make sure you're in the plugdev group):

```
szczerb@nomad ~ $ cat /etc/dbus-1/system.d/bluetooth.conf 

<!-- This configuration file specifies the required security policies

     for Bluetooth core daemon to work. -->

<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"

 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">

<busconfig>

  <!-- ../system.conf have denied everything, so we just punch some holes -->

  <policy user="root">

    <allow own="org.bluez"/>

    <allow send_destination="org.bluez"/>

    <allow send_interface="org.bluez.Agent"/>

  </policy>

  <policy at_console="true">

    <allow send_destination="org.bluez"/>

  </policy>

  <policy group="plugdev">

    <allow send_destination="org.bluez"/>

  </policy>

  <policy context="default">

    <deny send_destination="org.bluez"/>

  </policy>

</busconfig>
```

Get rid of all that bluetooth config that you did in /etc/bluetooth

Then emerge blueman-1.10. It's a nice GUI tool.

Then use it to associate with the phone.

Emerge wvdial. It's used not to make you use pppd by hand.

Then right click on your phone. Connect to Serial ports -> Dialup service.

That's my wvdial.conf for a k800i:

```
nomad szczerb # cat /etc/wvdial.conf 

[Dialer Defaults]

Modem = /dev/rfcomm0

Init1 = ATH

Init2 = ATE1

Init3 = AT+CGDCONT=1,"IP","internet"

Dial Command = ATD

Phone = *99***1#

Stupid mode = yes

Username = "blank"

Password = "blank"
```

You might have to google for init strings that work with your phone. Then just 'wvdial' as root.

If you're lucky and poly was right, then you just need to right click in blueman and connect to network access -> network access point, after enabling the connection in your phone (like I do with my G500. the k800i also has this bt service but I think that it's there to work the other way around  :Smile:  ). But I seriously doubt that.

----------

## herbert12345

Thank you for your reply. The DBUS config did help a lot. I can now use blueman as normal user, which is good. However running wvdial did not do any good:

```

--> WvDial: Internet dialer version 1.60             

--> Cannot get information for serial port.          

--> Initializing modem.                              

--> Sending: ATH                                     

ATH                                                                                                                                                            

OK                                                                                                                                                             

--> Sending: ATE1                                                                                                                                              

ATE1                                                                                                                                                           

OK                                                                                                                                                             

--> Sending: AT+CGDCONT=1,"IP","internet"                                                                                                                      

AT+CGDCONT=1,"IP","internet"                                                                                                                                   

OK                                                                                                                                                             

--> Modem initialized.                                                                                                                                         

--> Sending: ATD*99***1#                                                                                                                                       

--> Waiting for carrier.                                                                                                                                       

CONNECT                                                                                                                                                        

--> Carrier detected.  Starting PPP immediately.                                                                                                               

--> Starting pppd at Mon Jun 22 23:59:59 2009                                                                                                                  

--> Pid of pppd: 4819                                                                                                                                          

--> pppd: �[7f]                                                                                                                                                

--> pppd: �[7f]                                                                                                                                                

--> Disconnecting at Tue Jun 23 00:00:00 2009                                                                                                                  

--> The PPP daemon has died: Fatal pppd error (exit code = 1)                                                                                                  

--> man pppd explains pppd error codes in more detail.                                                                                                         

--> Try again and look into /var/log/messages and the wvdial and pppd man pages for more information.                                                          

--> Auto Reconnect will be attempted in 5 seconds                                                                                                              

--> Cannot open /dev/rfcomm0: Input/output error 

```

With those messages repeating over and over again (except for the first line).

man pppd tells me that error code 1 means "An immediately fatal error of some kind occurred, such as an essential system call failing, or running out of virtual memory."

Any suggestions? (Do I have to set any routes or something? I am usually connecting through a router via NetworkManager, which does all configurations without me having to interfere).

----------

## szczerb

No you won't have to set anything. Doesn't pppd leave anything in /var/log/messages? Did you set a correct APN and possibly username and pass for your gsm provider?

----------

