View Single Post
Posts: 20 | Thanked: 71 times | Joined on Sep 2009
#1
For various weird reasons I'm not using a SIM card on N900 at the moment, and would love to get internet connection via Bluetooth from another phone.

I actually did succeed in this, although it works only in X Terminal, not in any GUI apps.

What I'm missing is:
How to create a "dummy" connection that would be visible to the list in "Internet Connection" dialog that is opened from Status Menu?

There used to be a way to do that in N810, N800 (type = DUMMY), but that doesn't work in N900, at least not in the same way.

........

Some info how to get as far as I did, if somebody wants to hack around.

First, I installed "maemo-pc-connectivity" (v0.5) with Application Manager. This is not really necessary otherwise, but I couldn't figure out how to make "bnep0" device appear.

Then I tried to set up the bluetooth tethering using that pc-connectivity app. It really didn't work, as it complains about PAND etc, which is obviously out of date for Fremantle. That would have only worked in N800 or so. But now the "bnep0" is there

The "manual setup" script that people used in N810 is also outdated for Fremantle, due to move from Bluez 3.x to Bluez 4.x. The API changed totally. And there's very little up-to-date documentation.

Luckily I am able to activate the connection from the other-phone-side, so I don't really need dbus-bluez API to work fully. But if somebody is interested, here's the Fremantle version for the script linked above:

Code:
find_connection(){
#find or create connection                                                                                                                                    
if dbus_method org.bluez / org.bluez.Manager.DefaultAdapter ; then
    ADAPTER=$(dbus_result)
    echo default adapter $ADAPTER

    if dbus_method org.bluez ${ADAPTER} org.bluez.Adapter.FindDevice string:"${BTADDR}" ; then
        DEVICE=$(dbus_result)
        echo device $DEVICE

        if dbus_method org.bluez ${DEVICE} org.bluez.Network.Connect string:"${PAN_ROLE}" ; then
            CONN=$(dbus_result)
            echo connection $CONN
        fi
    fi
fi
}
That works fine except the org.bluez.Network -part, which seems to be totally missing ?!? (My N900 has Sales firmware).

Anyways, what I really needed to run is the network setup, which is simply these lines:

Code:
#!/bin/sh

BNEPDEV=bnep0
IP=XXX.XXX.XXX.XXX
GW=XXX.XXX.XXX.XXX

ifconfig $BNEPDEV $IP up
route add default gw $GW
And that's it. The $IP and $GW variables depend on the device you connect to (i.e. the "another phone"). There are some default suggestions in the N810 version of the script if you want to take a look.
 

The Following 6 Users Say Thank You to msoini For This Useful Post: