Reply
Thread Tools
Slixor's Avatar
Posts: 79 | Thanked: 5 times | Joined on Jan 2008 @ England
#31
i run the script and it says

"line 107: sytax error: word unexpected (expecting "in")"
 
atlas95's Avatar
Posts: 40 | Thanked: 0 times | Joined on Jan 2008 @ France
#32
Originally Posted by pycage View Post
Yes, it's for Bluetooth networking. However, most of us use PAN to connect to their mobile phone. Some phones (mostly those running Windoze Mobile 5) don't support Bluetooth dialup which the Nokia tablets use for gaining internet access over the phone. Instead, the Windoze Mobile 5 phones support PAN. PAN is not directly supported by the Nokia tablets, so it's a bit difficult to set up.

And yes, you can also create private Bluetooth networks with PAN between your tablets and a computer.
Ok Thanks
I will try this for fun so...
 
Slixor's Avatar
Posts: 79 | Thanked: 5 times | Joined on Jan 2008 @ England
#33
Originally Posted by Slixor View Post
i run the script and it says

"line 107: sytax error: word unexpected (expecting "in")"
can anyone help?

heres the script:

Code:
#!/bin/sh
# use gainroot to become root and relaunch itself
if [ `id -u` != 0 ] ; then
#if not already root, call itself as root
        exec sudo gainroot <<EOF
exec $0 $*
EOF
        exit $?
fi
# real script follows

#BT MAC of PC/phone
BTADDR='00:09:DD:60:11:B6'
#bluetooth name of PC/phone, not important, just for infoprints
BTNAME="DH9JYJ2J"
#desired IP address of your tablet
IP=192.168.0.4
#default gateway - IP address of PC/phone
GW=192.168.0.3 
#DNS server
NS=10.6.101.1
# remote PAN role, one of NAP, GN
PAN_ROLE=GN 

infoprint(){
DBUS_SESSION_BUS_ADDRESS='unix:path=/tmp/session_bus_socket' dbus-send --session --print-reply --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint "string:$*" &
}

dbus_method(){
local dest=$1
shift
DBUS_REPLY=$(dbus-send 2>&1 --system --type=method_call --print-reply --dest="$dest" $* )
}

dbus_result(){
echo $DBUS_REPLY | cut -d ' ' -f 7 | tr -d \"
}

find_connection(){
#find or create connection
if dbus_method org.bluez /org/bluez org.bluez.Manager.ActivateService string:network ; then
    NET_BUS=$(dbus_result)
#    echo destination $NET_BUS
    if dbus_method "${NET_BUS}" /org/bluez/network org.bluez.network.Manager.FindConnection string:"${BTADDR}" ; then
        CONN=$(dbus_result)
    else
        if dbus_method "${NET_BUS}" /org/bluez/network org.bluez.network.Manager.CreateConnection string:"${BTADDR}" string:"$PAN_ROLE" ; then
        CONN=$(dbus_result)
        fi
    fi
fi
}


bnep_start(){
#find_connection
if [ "$CONN" != "" ] ; then
echo connection $CONN
if dbus_method "${NET_BUS}" ${CONN} org.bluez.network.Connection.Connect ; then
    BNEPDEV=$(dbus_result)
    echo connected to $BNEPDEV
    ifconfig $BNEPDEV $IP up
    if route -n | grep -q '^0.0.0.0' ; then
        echo "default gateway already set, skipping GW and DNS setting"
    else
        route add default gw $GW
        echo "nameserver $NS" >/tmp/resolv.conf.lo
    fi
    [ -t 1 ] || infoprint "Connected to $BTNAME"
fi
fi
}

bnep_stop(){
#find_connection
if [ "$CONN" != "" ] ; then
echo connection $CONN
if dbus_method "${NET_BUS}" ${CONN} org.bluez.network.Connection.Disconnect ; then
echo "OK, bringing down"
echo -n '' >/tmp/resolv.conf.lo
[ -t 1 ] || infoprint "$BTNAME disconnected"
fi
fi
}

echo "Searching for $BTADDR ..."
[ -t 1 ] || infoprint "Searching for $BTADDR"
find_connection
if [ "$CONN" = "" ] ; then
    echo $DBUS_REPLY
    echo "Setting up connection to $BTADDR failed"
    [ -t 1 ] || infoprint "Connection to $BTADDR failed"
    exit
fi

COMMAND=$1
if [ "$COMMAND" = "" ] ; then
    dbus_method "${NET_BUS}" ${CONN} org.bluez.network.Connection.IsConnected
    if [ "$(dbus_result)" = "true" ] ; then
        COMMAND=stop
    else
        COMMAND=start
    fi
fi

case $COMMAND in
    start)      bnep_start ;;
    stop)       bnep_stop ;;
esac
 
Posts: 49 | Thanked: 7 times | Joined on Apr 2007
#34
[QUOTE=Slixor;126492]can anyone help?

I believe that is should read:

case "$COMMAND" in
start) bnep_start ;;
stop) bnep_stop ;;
esac

or

case "${COMMAND}" in
start) bnep_start ;;
stop) bnep_stop ;;
esac
 
Posts: 1 | Thanked: 0 times | Joined on Jan 2008
#35
Originally Posted by Slixor View Post
can anyone help?


Like KeF said before change line endings from Windows CRLF to Unix LF only
 
Posts: 26 | Thanked: 1 time | Joined on Jan 2008
#36
ATTENTION LINUX GURUS/USERS:

I believe all of you Linux Gurus/Users are trying to be very helpful to us newbies, but it doesn't look like it's helping us newbies with the lack of steps or proper instructions.

I see that SLIXOR has asked on numerous occasions and no one has stepped up to offer any help to this poor dude. I am in the same situation and I can understand his frustration. Everyone keeps posting that bluetooth pan is working great and what not, but no one is kind enough to explain what they did or post a walkthrough process.

Please HELP us dummies!

Thanks,
 
Posts: 60 | Thanked: 7 times | Joined on Jan 2008
#37
First, for the script to work, you need to have root access using gainroot. There are lots of threads on how to do that; search for them. If that whole idea scares you, it would be better to wait for Nokia to implement PAN.

Copy the script to your N800. Your home directory is a convenient place for now. I called mine pan.

Make the script executable by typing:
Code:
~ $ chmod  +x pan
now you can run it with:
Code:
~ $ ./pan
HTH
Walt
 
Posts: 5 | Thanked: 1 time | Joined on Jan 2008
#38
Hello all,

Could somebody tell me how to set up BT internet connection using belkin usb BT adapter on Windows XP and Nokia n810 tablet. I've used the script above, but when started it the result is: "The Service isnt supported by the remove device...connection to MAC addr. failed"

PAN_ROLE is set to GN.

Can somebody tell me how to fix it and how to turn on internet on my device using BT.

Thank you in advance to all of you.
I.V.
 
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#39
this is highly dependent on the bluetooth stack you use (i.e. software that came with your adapter). There are at least 4 of them I know
1. the microsoft one added in XP SP2 (not sure but this one may not support PAN at all)
2. widcomm stack
3. Toshiba stack
4. BlueSoleil stack

2. and 3. support PAN at least with recent versions but each is configured differently, never seen 4.

Since this is not specific to tablets so you may also search elsewhere and include you bt stack name. With widcomm try to google for 'widcomm PAN' or something similar.

Once you have it connected with your PC, you need to share your internet network connection with this (google for 'xp internet connection sharing').
__________________
Newbies click here before posting. Thanks.

If you really need to PM me with troubleshooting question please consider posting it to the forum instead. It is OK to PM me a link to such post then. Thank you.

Last edited by fanoush; 2008-01-31 at 11:51.
 

The Following User Says Thank You to fanoush For This Useful Post:
Posts: 9 | Thanked: 0 times | Joined on Jan 2008
#40
Originally Posted by Slixor View Post
i run the script and it says

"line 107: sytax error: word unexpected (expecting "in")"

Like you, I cannot run the script. Ive followed everything to the letter and it's either "permission denied" or "cannot find pan (my file)". How did you make your yours run? I've already becomeroot and I try to run the script off the memory card. Thanks.
 
Reply


 
Forum Jump


All times are GMT. The time now is 17:04.