Reply
Thread Tools
MaddogG's Avatar
Posts: 234 | Thanked: 175 times | Joined on Jun 2010 @ Genova (Italy)
#11
Originally Posted by ampaze View Post
Very good. Now all I need is Bluetooth on my PC.
May I ask you why don't you use WiFi?
 
clasificado's Avatar
Posts: 466 | Thanked: 180 times | Joined on Feb 2010
#12
@MaddogG sometimes, you are in a computer that doesnt have wifi.
 
MaddogG's Avatar
Posts: 234 | Thanked: 175 times | Joined on Jun 2010 @ Genova (Italy)
#13
Originally Posted by clasificado View Post
@MaddogG sometimes, you are in a computer that doesnt have wifi.
Ok, but he doesn't have Bluetooth, too!
 
Posts: 1,341 | Thanked: 708 times | Joined on Feb 2010
#14
And I think still Bluetooth uses less energy even with these new powersave-modes in Wifi.

I nowadays have Bluetooth networking on always when at home and much of the maintaining and configuring I do over ssh from PC.
It does not take much battery having it connected via BT all the time, but I would guess (have not tried) doing same with WLAN would drain the battery.

I used to keep it connected through USB, but I am not happy N900's CPU running constantly at 500 Mhz when connected via USB. I hope there will be a hack in kernel-power for that some day.
 
MaddogG's Avatar
Posts: 234 | Thanked: 175 times | Joined on Jun 2010 @ Genova (Italy)
#15
Originally Posted by zimon View Post
And I think still Bluetooth uses less energy even with these new powersave-modes in Wifi.
This is a good reason, probably you are right...
 
Posts: 4 | Thanked: 6 times | Joined on Dec 2010 @ Cologne
#16
Originally Posted by zimon View Post
Doesn't that run that script also when just some other than network device is connected by Bluetooth?
You're right. But I think, calling ifconfig multiple times doesn't hurt though.


The reason I want to access my device via bluetooth is our restricted wifi at my work place. There, I can access the internet, but I cannot access my computer due to security policies. Sure, I can use the USB cable, but I often forget it at home.

It's nice to be able to access files on the phone via sftp without touching it by leaving it in the bag.
 
Posts: 1,341 | Thanked: 708 times | Joined on Feb 2010
#17
Originally Posted by sebhack View Post
You're right. But I think, calling ifconfig multiple times doesn't hurt though.
True, but if you also set up a default route, DNS-servers and Dummy-APN, like I have, it will hurt.

Would have to be something more specific so only started PAN connection would run the script.
If there would be pand program, one could just check with `pand -l` in the start of the script.
On PC side, I can see it is up:
Code:
# pand -l
bnep0 3C:F7:2A:XX:XX:XX PANU
 
Posts: 25 | Thanked: 5 times | Joined on Jul 2010
#18
Hi,
more than year later, I have the same question. I've started to play things as described elswhere on my debian squeeze, but soon I stucked on n900.

on root@n900:_________

/etc/bluetooth/main.conf and removed 'network,input,hal' from the
configuration option 'DisablePlugins'.

into /etc/network/interfaces I added

auto bnep0
iface bnup0 inet static
address 10.10.0.2
netmask 255.255.255.0
gateway 10.10.0.1

(even after reboot) I ran

ifup -f bnep0 (on ifup -v bnep0 it says 'interface already configured')
ifconfig bnep0 up 10.10.0.2
...ifconfig: SIOCGIFFLAGS: No such device

sabhack - did I forgot something?
thanks, j.

---edit----------------
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
Finaly, I removed my bluetooth-applet, installed "blueman" and used blueman-applet. It didnt work neither, BUT, right-click/local services, I ticked group network, for "pan support" I tried to tick blueman (maybe a bug..., doesnt remember the setting) AND right-click/plugins I checked "DhcpClient" which unchecked "NMPANSupport". Than, "group network" from blueman started to work, nm-applet remained untouched and unaware.
My previous DUN setting in nm-applet remained ok (no idea where it is stored).
------------------
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

Last edited by jaromrax; 2011-04-15 at 16:12.
 
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:
Posts: 30 | Thanked: 4 times | Joined on Nov 2009
#20
Originally Posted by MaddogG View Post
May I ask you why don't you use WiFi?
I do have a reason:
I want to connect to my N900 from an android phone though bluetooth (via ssh) and want to be able to use aircrack or vnc
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 22:37.