Active Topics

 


Reply
Thread Tools
thoughtfix's Avatar
Posts: 832 | Thanked: 75 times | Joined on Dec 2005 @ Phoenix, AZ
#1
Time to bust out my hacker boots.

I will write a shell script for the N800 PAN that will
  • Locate the phone's Device ID
  • Locate the phone's MAC
  • Build a shell script to start PAN
  • Build a shortcut to start the connection

I have heard several methods to do this from a dummy network connection to a terminal launched script. If people already have this working, could you please share:
  • How you got it to work
  • What your prerequisites were
  • How do you launch the connection

That'd help me a lot.
 

The Following User Says Thank You to thoughtfix For This Useful Post:
Posts: 52 | Thanked: 2 times | Joined on May 2007 @ Northeast USA
#2
I would be very interested in hearing how this turns out... please keep us posted... this sounds interesting.
 
Posts: 32 | Thanked: 0 times | Joined on Jun 2007
#3
I'm very interested in this too. I assume it would work on a 770, since there is really little difference when you're talking about PAN. Well, i guess, of course, the whole OS 2006/OS 2007 thing could be an issue. Hopefully not a big one. Either way, keep us updated.

BTW, I'm yet to really try anything related to PAN, though my Cing. 8125 uses it. I would give you more info if I had it.
 
Posts: 428 | Thanked: 54 times | Joined on Mar 2006 @ Washington DC
#4
i've yet to get pan running on os2007 hacker edition on my 770. pan works well under os2006 though. all documented on the forum.
 
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#5
for os2007 there is a workaround for non-working DUMMY connection type mentioned in blog of some clever guy, just setup 'dummy' ad-hoc wi-fi connection with manual ip address configuration and everything zeroed (to not to search for dhcp server and also to not to assign any IP address). This is done by clicking 'Advanced' button in connection setup and unchecking 'Auto-retrieve IP address' check box in 'IP Addresses' tab.

Connect it and then in the pan setup script shutdown wi-fi to save power (ad-hoc is power killer, wlan power saving mode is completely disabled in ad-hoc mode).

Here is my pan setup script modified for bringing such ad-hoc dummy connection down (see dummy_wlan_down function)

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
BTADDR='00:16:41:B7:B9:07'
BTNAME="FRANTA"
IP=192.168.2.2
GW=192.168.2.1
NS=10.6.101.1
IFACE=bnep0
PAN_ROLE=GN # remote PAN role, one of PANU, NAP, GN

#thanks to inz on #maemo IRC channel for this
infoprint(){
dbus-send >/dev/null 2>&1 --system --print-reply --dest=com.nokia.statusbar /com/nokia/statusbar com.nokia.statusbar.system_note_infoprint "string:$*" &
}

dummy_wlan_down(){
if ifconfig wlan0 | grep -q "UP BROADCAST RUNNING" ; then
# OK wlan is up, do we have IP set up? if not (=our dummy ad-hoc) bring wlan0 down
ifconfig wlan0 | grep -q "inet addr" || ifconfig wlan0 down
fi
}

bnep_start(){
dummy_wlan_down
#insmod just to be sure
insmod /mnt/initfs/lib/modules/current/bnep.ko
#start PAN Bluetooth connection
pand --connect $BTADDR -d $PAN_ROLE
# wait for the interface created by pand
s=60
echo -n "Waiting $s secs for $IFACE"
while [ $s -gt 0 ] ; do
        ifconfig $IFACE >/dev/null 2>&1 && break
        s=$((s-1))
        [ -t 1 ] && echo -n "."
        sleep 1
done
echo
if ifconfig $IFACE >/dev/null 2>&1 ; then
# bring it up
echo "OK, bringing $IFACE up"
ifconfig $IFACE $IP up
route add default gw $GW
echo "nameserver $NS" >/tmp/resolv.conf.lo
    [ -t 1 ] || infoprint "Connected to $BTNAME"
else
    echo "Error: $IFACE not available."
    [ -t 1 ] || infoprint "Connection failed"
fi
}

bnep_stop(){
echo "OK, bringing $IFACE down"
echo -n '' >/tmp/resolv.conf.lo
pand -K
sleep 1
rmmod bnep
[ -t 1 ] || infoprint "Disconnected"
}

COMMAND=$1
if [ "$COMMAND" = "" ] ; then
    if ifconfig $IFACE >/dev/null 2>&1 ; then
        COMMAND=stop
    else
        COMMAND=start
    fi
fi

case $COMMAND in
    start)      bnep_start ;;
    stop)       bnep_stop ;;
esac
it is still two step process
1. connect to dummy ad-hoc connection
2. execute bnep setup script (from menu shortcut or osso-xterm)

1. disconnect dummy ad-hoc connection
2. execute bnep setup script

example menu shortcut setup script :
Code:
#!/bin/sh
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

cd `dirname $0`
SHORTCUT=franta-bnep.desktop
SHORTCUT_NAME="PAN connection to FRANTA"
SHORTCUT_SCRIPT=`pwd`/franta-bnep

cat >$SHORTCUT <<EOF
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=$SHORTCUT_NAME
X-Osso-Type=application/x-executable
Exec=$SHORTCUT_SCRIPT
EOF
mv $SHORTCUT /usr/share/applications/hildon/

Last edited by fanoush; 2007-06-14 at 07:22.
 

The Following User Says Thank You to fanoush For This Useful Post:
Posts: 428 | Thanked: 54 times | Joined on Mar 2006 @ Washington DC
#6
I see there's been some bug activity on maemo for my bug

https://bugs.maemo.org/show_bug.cgi?id=1195
 
thoughtfix's Avatar
Posts: 832 | Thanked: 75 times | Joined on Dec 2005 @ Phoenix, AZ
#7
I added to the bug. It's currently listed as a 770 bug, so I don't know what the priority level will be. Best case scenario is that an installable .deb can patch this and be installable on IT2006 and IT2007 - that way neither have to wait for a new firmware.
 
thoughtfix's Avatar
Posts: 832 | Thanked: 75 times | Joined on Dec 2005 @ Phoenix, AZ
#8
It's marked as WONTFIX now. Take a look at this summary.

I'll start on that proposal ASAP. Who wants to add comments?
 
thoughtfix's Avatar
Posts: 832 | Thanked: 75 times | Joined on Dec 2005 @ Phoenix, AZ
#9
Proposal to add Bluetooth PAN support to Nokia Internet Tablets

Abstract:
One of the primary advantages to Nokia Internet Tablets over web-capable phones is the ability to get online regardless of carrier or data service technology. The Tablets do not require a contract or monthly fee. This is a perfect compliment to Smartphones in that the smartphone can provide features not included in the Internet Tablets: calendars, task management, contact management, and the Bluetooth uplink to the Internet.

Some smartphone platforms are ditching the Bluetooth Dial-Up Networking feature in favor of Bluetooth Personal Area Networking. PAN can fully replace and enhance DUN and it is likely that future devices and carriers will support PAN over DUN. The Nokia Internet Tablets currently support DUN only, leaving users with PAN-only phones unable to connect through their phones. They must rely on spotty WiFi hotspot coverage.

To stay future focused, enhance market appeal, and retain current consumer loyalty, it is sensible for the Maemo team to add Bluetooth PAN functionality to Nokia Internet Tablets.

Proposal:
Enhance the current Phone applet and Connection Manager to include Bluetooth PAN support. This will include

* The ability for the Bluetooth pairing wizard to detect PAN functionality.
* The ability for the user to select PAN for internet access. Currently, connection types are Packet Data, Data Call, and WiFi. PAN would be added to this.
* Adding seamless connection scripts to the Connection Manager so a PAN connection is as easy as a DUN or WiFi connection.

This can be in the form of an installable .deb package or as a firmware update. Creating it as an installable .deb would be faster to market and not require modification to the maemo source tree. However, it may be more difficult for users to install, understand, or use.

Technical requirements:
Most of the technical details on adding PAN have already been worked out by users. There are already workarounds that allow users to add their own connection scripts to use a PAN phone. There are disadvantages to these scripts:

* They require firmware modification of the Internet Tablet.
* They require root access on the tablet - something dangerous for novice or intermediate users.
* The scripts are not well documented and may be inconsistent between users or tablets.

The scripts can be used by Maemo developers as a basis on which to deploy this functionality. With all the hard work done, it's just a matter of cleaning up the scripts, creating an installer, and adding a few buttons to the Connection Manager. Resources:

* https://bugs.maemo.org/show_bug.cgi?id=1195
* http://www.internettablettalk.com/fo...74&postcount=5

Last edited by thoughtfix; 2007-06-15 at 18:39.
 

The Following User Says Thank You to thoughtfix For This Useful Post:
Posts: 428 | Thanked: 54 times | Joined on Mar 2006 @ Washington DC
#10
great, so he won't fix it, and we're screwed then? what's the point of a proposal if they refuse to even consider to add the enhancement?
 
Reply


 
Forum Jump


All times are GMT. The time now is 11:39.