# [solved]bluetooth TCP/IP: connect to remote host from Gentoo

## DMoL

Hello!

I try to follow some instructions from [1] to connect my gentoo box (client role) to rasberry-pi box (server role).

I have already paired and marked "trusted" the related sides.

But when I try to connect to rasberry-pi via test-network (shipped in sources of bluez-5.25) I got the following error message:

```

/test-network  00:1A:7D:0A:BC:75

Traceback (most recent call last):

  File "./test-network", line 42, in <module>

    iface = network.Connect(service)

  File "/usr/lib64/python2.7/site-packages/dbus/proxies.py", line 70, in __call__

    return self._proxy_method(*args, **keywords)

  File "/usr/lib64/python2.7/site-packages/dbus/proxies.py", line 145, in __call__

    **keywords)

  File "/usr/lib64/python2.7/site-packages/dbus/connection.py", line 651, in call_blocking

    message, timeout)

dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "Connect" with signature "s" on interface "org.bluez.Network1" doesn't exist

```

The bnep0 local network interface isn't crated. As far as I can understand it even does not tries to connect. What should I do?

[1] https://wiki.gentoo.org/wiki/Bluetooth_Network_Aggregation_Point

Thanks for any help!

WBR[/code], basiliscosLast edited by DMoL on Sun Mar 22, 2015 4:46 pm; edited 1 time in total

----------

## lost+found

Hi, I'm also using the NAP setup from mentioned wiki. Since Bluez5 and/or recent /etc/init.d/bluetooth, I have to initialize the device to make it work.

```
# hciconfig        

hci0:   Type: BR/EDR  Bus: USB

        BD Address: 00:09:DD:XX:XX:XX  ACL MTU: 310:10  SCO MTU: 64:8

        DOWN 

        RX bytes:537 acl:0 sco:0 events:24 errors:0

        TX bytes:329 acl:0 sco:0 commands:22 errors:0

                                                                                                                                    

# hciconfig hci0 up                                                                                                       

# hciconfig

hci0:   Type: BR/EDR  Bus: USB                                                                                                      

        BD Address: 00:09:DD:XX:XX:XX  ACL MTU: 310:10  SCO MTU: 64:8                                                               

        UP RUNNING PSCAN                                                                                                            

        RX bytes:1056 acl:0 sco:0 events:49 errors:0                                                                                

        TX bytes:917 acl:0 sco:0 commands:47 errors:0                                                                               

           

```

Maybe this is the issue on your rasberry-pi (or gentoo box). From a desktop, applications like BlueDevil will do that automatically. This seems new behaviour according to this bug report.

I can't tell anything from the client roll perspective. I'm using the setup to connect an old cell phone to the network. Apps like Opera Mini and MidpSSH initiate the network connection. The phone is not rooted, so I can't test anything there.

----------

## DMoL

Finally I have managed to find the solution. 

Here is an original link http://www.xnos.org/linux/blue-linux/hardware/compaq-ipaq/rfcommppp-connection.html

I'm going to duplicate here - it might be useful for somebody if original page is gone. I assume the devices are already paired.

On gentoo box (server side):

```

rfcomm listen /dev/rfcomm0 5 (on 1st terminal)

pppd /dev/rfcomm0 115200 192.168.201.1:192.168.201.2 noauth nodetach (on another terminal).

```

That could be shortened to:

```

rfcomm watch /dev/rfcomm0 5 pppd /dev/rfcomm0 115200 192.168.201.1:192.168.201.2 noauth nodetach

```

On raspberry-pi box (client-side)

```

rfcomm connect /dev/bluetooth/rfcomm/0 00:A0:96:1F:21:81 5 (on 1st terminal)

pppd /dev/rfcomm0 115200 192.168.201.2:192.168.201.1 noauth nodetach

```

I've spent hours on determining how to do that with DUN/BNEP/PAN etc.; but I haven't found any reasonable solution. That's one is rather simple and useful for me.

wbr, basiliscos

----------

## lost+found

DMoL,

That's a brilliant way to have an extra NIC.   :Smile: 

The speed is not bad. Could be around 1.5 Mbps with Bluetooth v2.

Cheers!

----------

