View Single Post
Posts: 9 | Thanked: 3 times | Joined on Oct 2010
#19
Originally Posted by jaromrax View Post

ok, one thing is clear. Only after I try to connect over BT with nm-applet to "mymaemoname"_Network, the interfaces become available on both sides. No problem to add few lines to local /etc/network/interfaces (like
allow-hotplug bnep0
iface bnep0 inet static
address 10.10.0.3
netmask 255.255.255.0
# gateway 10.10.0.2
)

I must launch the ifconfig manually on n900.
However - I can have a bnep0 connection for about 30 seconds and after I get disconnected.... nm-applet just rotates ... these 30sec. This I dont know where it comes from, it doesnt happen for debian->BT->n900->mobile broadband.

Next thing: to be able to run dbus-scripts, I realized that it must be installed (from -devel?). I am not going to go that far, I am quite happy with the stability now. Are there any other solutions to respond automatically on n900 side?

-----next edit ------------- sorry ---------------------
after a lot of google ......
nm-applet 0.8, although it says it is ok, it has an issue with PAN

The only question remains, howto set
ifconfig bnep0 up 10.10.0.2
on n900 when PAN is started... without loading stuff from extra-devel.....
thanks, if there is any advice
Hi all

"allow-hotplug bnep0"
in /etc/network/interfaces seems to be ignored by maemo5 when connecting the n900 with bluetooth.
I only managed to bring up bnep0 by a dbus script:

Code:
EVENT="$4"
UDI="$5"
HALDEV="$(echo $UDI | sed 's#.*/\([0-9a-zA-Z_]*\)#\1#')"
LOG="/tmp/tethering.log"
echo $* >> $LOG
#INETDEV="gprs0"
INETDEV="wlan0"
RUNFILE="/var/run/tethering.$HALDEV.pid"
IFACEFILE="/var/run/tethering.$HALDEV.iface"

if [ "$EVENT" = "DeviceAdded" ]; then
        IFACE=$(hal-get-property --udi $UDI --key net.interface)                                                                                                                   
       echo $IFACE >> $LOG
# ari:
# network-manager-gnome (nm-applet) establishs connection only
# when receiving an dhcp reply
        case $IFACE in
                bnep0 )
                        IF_ADDRESS=192.168.253.1
                        IF_RANGE=192.168.253.254,192.168.253.254
                        IF_GW=192.168.253.254
                ;;
                * )
                        exit 0
                ;;
        esac

        echo "$(date) Enabling tethering on interface $IFACE" >> $LOG
        echo "$IFACE" > $IFACEFILE
        ifconfig "$IFACE" "$IF_ADDRESS"
        route add default gw $IF_GW
# ari: to make "dummy network work!
         /usr/bin/run-standalone.sh dbus-send --type=method_call --system --dest=com.nokia.icd /com/nokia/icd com.nokia.icd.connect string:DUMMY uint32:0
# ari: to make network-manager-gnome work
        start-stop-daemon -S -p "$RUNFILE" -m -b -x /usr/sbin/dnsmasq -- -k -I lo -i "$IFACE" -a $IF_ADDRESS -z -F $IF_RANGE,3600

fi

if [ "$EVENT" = "DeviceRemoved" ]; then
        if [ ! -f "$IFACEFILE" ]; then
                exit 0
        fi
        IFACE="$(cat $IFACEFILE)"
        rm "$IFACEFILE"
        echo "$(date) Disabling tethering on device $IFACE" >> $LOG
        start-stop-daemon -K -p "$RUNFILE" -x /usr/sbin/dnsmasq
#ari to remove dummy network
         /usr/bin/run-standalone.sh dbus-send --system --dest=com.nokia.icd /com/nokia/icd_ui
 com.nokia.icd_ui.disconnect boolean:true                                              
        ifconfig "$IFACE" down
fi

exit 0
NetworkManager with nm-applet seems to wait for a dhcp response. If there is no one, the connection times out and the bnep0 interfaces on both sides (n900 and debian squeeze) are removed. That's why we start dnsmasq to deliver exactly one address to the pc.

If you want to use the bnep0 connection from any n900 application for internet access (on the pc masquerading and forwarding must be enabled), you must use the "dummy network" for Internet connection (package libicd-network-null) and send a connection message for dummy on the system dbus.

BUT: why does not "allow-hotplug bnep0" work?
On the debian squeeze side it works flawlessly.

Hope this helps

ari
 

The Following User Says Thank You to aldebarab For This Useful Post: