maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC) (https://talk.maemo.org/showthread.php?t=58570)

WorldKaoss 2010-08-20 23:05

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
I will do some further testing when I return back to town, I have just the phone with me, I'm on a trip for 3-5 days.

spectral 2010-09-18 04:15

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
I suppose the script will 'turn-on/enable' PAN on N900 but is there also a script to 'turn-off/disable' after using?

9000 2010-09-18 04:42

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by spectral (Post 819482)
I suppose the script will 'turn-on/enable' PAN on N900 but is there also a script to 'turn-off/disable' after using?

Actually you don't need to disable PAN. PAN doesn't really impose extra load over bluetooth usage. When you walk away from PAN's coverage, it'll disconnect automatically (actually this is annoying XD)

I didn't add the part to disable PAN because I reckon people would still want to use bluetooth (e.g. headset) even when they don't need PAN (Like I usually do).

If you really want to save battery, you can simple turn off bluetooth entirely by using bluezwitch I recommended in paragraph 3.5 of the instructions on the first page.

Let me know if you've further query. ^^

Red X 2010-10-11 09:47

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
can i use my broadband pc internet via bluetooth or usb cable on n900?

9000 2010-10-11 13:41

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by Red X (Post 838257)
can i use my broadband pc internet via bluetooth or usb cable on n900?

Actually it's even more easy to accomplish. All you've to do is to make it works the other way round.

First you should make your Windows sharing internet. I can't give you procedures on this, as different version of Windows has different setup. You must consult Windows experts on this. Of course, it'd be much easier if your PC is running Linux.

Second, you need to pair up the PAN such that the N900 and PC is within the same PAN. It's like your PC and N900 is in the same LAN. i.e. follow the procedures up to section 4.2.

After you established the PAN, you must setup the IP of your PC as followed:

Code:

IP: 192.168.1.2
Netmask: 255.255.255.0
Gateway: 192.168.1.1

and your N900: (INSTALL rootsh before running the following scripts)
Code:

root
ifconfig bnep0 down
ifconfig bnep0 192.168.1.1 netmask 255.255.255.0 up

You can ping 192.168.1.1 from your PC or ping 192.168.1.2 from your N900 to check if the network is setup properly.

Now you must setup the default route. All intranet and internet traffic will go thru the default, therefore you must make sure no other default exist.

In your N900:
Code:

root
route add default gw 192.168.1.2 bnep0

Note now that N900 is pointing the default gateway to your PC (192.168.1.2).

Finally, you can't browse web without DNS:

Code:

root
echo nameserver 8.8.8.8 >> /etc/resolv.conf
echo nameserver 8.8.4.4 >> /etc/resolv.conf

The above example is to setup your DNS with Google's public DNS, you can replace them with the DNS of your own ISP. YOU ONLY NEED TO DO IT ONCE.

I'm in a rush, may be you'd have question with the procedure above. Nevertheless feedback and I'll help you .

HRH_H_Crab 2010-11-10 15:34

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Hi, I'm very new to the N900 - loving the device so far.
Just posting to enquire whether this is still the "preferred" solution to setting up the N900 as a pan server?

It seems a bit clunky to me.

Also, where the heck can I get the pc-connectivity suite from?
It doesn't seem to be in any of the pre-configured repositories?

9000 2010-11-10 16:36

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by HRH_H_Crab (Post 869293)
Hi, I'm very new to the N900 - loving the device so far.
Just posting to enquire whether this is still the "preferred" solution to setting up the N900 as a pan server?

It seems a bit clunky to me.

You mean...there's other way to setup Bluetooth PAN hotspot now?

Quote:

Also, where the heck can I get the pc-connectivity suite from?
It doesn't seem to be in any of the pre-configured repositories?
I don't think you can find pc-connectivity in any repository, but you could probably find pc-connectivity-manager in the repositories.

HRH_H_Crab 2010-11-11 16:49

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
There seems to be an awful lot of contradictory posts about setting up the phone as a PAN server. I read your post, but then I saw this:

http://wiki.maemo.org/Fremantle_Unsu...tooth_profiles

I have removed "network" from the list of disabled plugins and my Macbook now sees the phone supports the PAN service. However its not picking up an IP address (it auto-configures itself from the 169 range) and bnep0 on the phone has no address bound.

I wonder if I need to manually configure IP on each side and mess around with iptables to get routing happening.

Either way this is one feature that worked a lot better on my ancient Sony Ericsson W595!

9000 2010-11-11 17:05

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by HRH_H_Crab (Post 870509)
There seems to be an awful lot of contradictory posts about setting up the phone as a PAN server. I read your post, but then I saw this:

http://wiki.maemo.org/Fremantle_Unsu...tooth_profiles

I have removed "network" from the list of disabled plugins and my Macbook now sees the phone supports the PAN service. However its not picking up an IP address (it auto-configures itself from the 169 range) and bnep0 on the phone has no address bound.

I wonder if I need to manually configure IP on each side and mess around with iptables to get routing happening.

Either way this is one feature that worked a lot better on my ancient Sony Ericsson W595!

Regarding the wiki you mentioned, I don't think you can find maemo-pan in N900's repositories....yet.

The article I wrote and the script I posted is exactly telling you how to establish PAN by manually configuring IP on both side. The iptables is just there to establish Internet sharing thingy. I could have packaged it but since I don't think there are too many people using PAN anyway....so...

As a matter of fact you're one of the very few people who are actually interested in PAN. Yep, N900 is awesome, but so far not much people would really appreciate its power. Bluetooth PAN is in fact perfect for tethering for N900, due to its extremely low power consumption.

Enjoy.

HRH_H_Crab 2010-11-11 19:27

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
The wiki doesn't actually mention anything about maemo-pan.
It just says if you remove "network" from the disabled plugins list in the bluetooth main.conf then PAN will work.

I'm going to install iptables and use your script and manually configure the network on both sides and see where that gets me.

Changing the subject totally, I lived in HK from 1977 until the early '90s!

Awesome place! ;)

tgwtoronto 2010-11-11 20:30

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Hi,

I've got an N900 up and working with Bluetooth PAN as per your details above and it seems to work perfectly, my question is if there is an easy way to auto enable the PAN setup on the N900 when a device connects?

I was originally using DUN to connect from my PC to the N900 for connectivity and I've got an iPAD and a few other devices now that I want to use from time to time via PAN to the N900 and they all seem to want to do DHCP once they connect so I was looking for away to do that.

Any thoughts?

Thanks
Tom

9000 2010-11-12 03:08

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by HRH_H_Crab (Post 870674)
The wiki doesn't actually mention anything about maemo-pan.
It just says if you remove "network" from the disabled plugins list in the bluetooth main.conf then PAN will work.

IIRC you don't need to touch the corresponding option in main.conf if you follow my procedures. Thank you for your feedback.

Quote:

Originally Posted by HRH_H_Crab (Post 870674)
I'm going to install iptables and use your script and manually configure the network on both sides and see where that gets me.

Actually it's easier than you thought. Good luck.

Quote:

Changing the subject totally, I lived in HK from 1977 until the early '90s!

Awesome place! ;)
Good to hear that. ^^ Please kindly feedback if possible. Thanks.

9000 2010-11-12 06:25

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by tgwtoronto (Post 870746)
Hi,

I've got an N900 up and working with Bluetooth PAN as per your details above and it seems to work perfectly, my question is if there is an easy way to auto enable the PAN setup on the N900 when a device connects?

I was originally using DUN to connect from my PC to the N900 for connectivity and I've got an iPAD and a few other devices now that I want to use from time to time via PAN to the N900 and they all seem to want to do DHCP once they connect so I was looking for away to do that.

Any thoughts?

Thanks
Tom

What I'm doing now is to create a Queen Beecon icon to trigger the script in section 4.3.1:

1) Have you PC/iPad join the N900's PAN
2) Make sure you've connected to the Internet, press the Queen Beecon button that triggers the script

Just two steps to reestablish your PAN for tethering.

However, I understand that you want DHCP and the script would be triggered automatically when the PAN is established. I'll see what I can do and update you later after research.

HRH_H_Crab 2010-11-12 09:09

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
I wonder whether it would make things even simpler if we could somehow make use of bridging?

When I use PAN with my SE, the device that I am connecting to the PAN picks up an address from the providers network range - its almost as though the phone is just bridging the connection it gets across the PAN?

9000 2010-11-12 10:29

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by HRH_H_Crab (Post 871243)
I wonder whether it would make things even simpler if we could somehow make use of bridging?

When I use PAN with my SE, the device that I am connecting to the PAN picks up an address from the providers network range - its almost as though the phone is just bridging the connection it gets across the PAN?

Are you sure it is PAN, not DUN?

What is SE BTW?

Can you show me the screenshot?

HRH_H_Crab 2010-11-13 09:17

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by 9000 (Post 871339)
Are you sure it is PAN, not DUN?

What is SE BTW?

Can you show me the screenshot?

SE = Sony Ericsson and I am sure it is PAN and not DUN. I used a script on my "client" device (Sharp Zaurus) which issued the command "pand" from bluez-compat to issue the connection.

I can't show a screenshot unfortunately.

9000 2010-11-13 09:33

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by HRH_H_Crab (Post 872227)
SE = Sony Ericsson and I am sure it is PAN and not DUN. I used a script on my "client" device (Sharp Zaurus) which issued the command "pand" from bluez-compat to issue the connection.

I can't show a screenshot unfortunately.

If it is a scipt can you show me here?

HRH_H_Crab 2010-11-13 09:40

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
well, first things first back to your method:
i'm not having much luck.
here is one problem for starters:

BusyBox v1.10.2 (Debian 3:1.10.2.legal-1osso30+0m5) built-in shell (ash)
Enter 'help' for a list of built-in commands.

Nokia-N900-51-1:~# apt-get install pc-connectivity-manager
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package pc-connectivity-manager
Nokia-N900-51-1:~#

How can I install the pc-connectivity-manager?

I should note (in case it is useful information for anyone):

When I was messing around on my own, and had removed "network" from the list of disabled plugins in /etc/bluetooth/main.conf issuing a request to connect to the network on my N900 from my Mac brought up a bnep0 interface on my phone and caused my Mac to autoconfigure an interface.

With "network" disabled, any attempt to initiate a connection causes an error message on my Mac (Bluetooth Network unavailable) and no bnep0 is brought up on the phone.

I am guessing therefore that "pc-connectivity-manager" must somehow replace the role of the bluetoothd network plugin and provide the pan server on the phone side?!

Regarding the script for my Z:

#!/bin/bash
pand --connect <phonebluetoothmac> --service NAP --autozap
ifdown bnep0
ifup bnep0

(with bnep0 set to use dhcp in /etc/network/interfaces ofc.)

9000 2010-11-13 10:34

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
You need to enable extras-devel in your repositories list and then update in order to get that pc-connectivity-manager. Actually you need that repository in order to get iptables. I'll add that step when I get home thanks for your feedback.

HRH_H_Crab 2010-11-13 10:42

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
I had no problem installing iptables with "apt-get install iptables".

(even without extras-devel)

9000 2010-11-13 11:00

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Let check your source list first:

Code:

Nokia-N900:~# cat /etc/apt/sources.list.d/hildon-application-manager.list
deb https://downloads.maemo.nokia.com/fremantle/ssu/apps/ ./
deb https://downloads.maemo.nokia.com/fremantle/ssu/mr0 ./
deb https://downloads.maemo.nokia.com/fremantle1.2/ovi/ ./
deb http://repository.maemo.org/extras/ fremantle-1.3 free non-free
deb http://repository.maemo.org/extras-devel/ fremantle free non-free
deb http://repository.maemo.org/extras-testing/ fremantle free non-free
deb https://downloads.maemo.nokia.com/fremantle/ovi/ ./


HRH_H_Crab 2010-11-13 11:02

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
O.K.
I am making real progress now using your method! :D

From a clean boot of my N900 using my Macbook as client:

I immediately initiate a PAN request from the Mac, it connects.
I then run your script.
I can ping 192.168.1.1 and successfully ssh into the N900 from the PAN.

BUT...

The phone isn't asking to start an internet connnection.
I'm going to start my gprs0 interface before initiating the PAN and see how that works...

HRH_H_Crab 2010-11-13 11:14

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
First, the repos:

Code:

Nokia-N900-51-1:~# cat /etc/apt/sources.list.d/hildon-application-manager.list
deb https://downloads.maemo.nokia.com/fremantle/ssu/apps/ ./
deb https://downloads.maemo.nokia.com/fremantle/ssu/205 ./
deb https://downloads.maemo.nokia.com/fremantle1.2/ovi/ ./
deb http://repository.maemo.org/extras/ fremantle-1.2 free non-free
deb http://moff.mozilla.com/latest-beta/maemo/multi/ fremantle release
deb http://repository.maemo.org/extras-devel fremantle free non-free

I tried starting my gprs connection prior to running your script.
If I do that I can't PAN to the phone.
Otherwise the PAN works fine, but the script doesn't prompt me to start an internet connection.

HRH_H_Crab 2010-11-13 11:54

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Ugh. I read back through the thread and looked at WorldKaoss' posts.
He seemed to have the same problems.
I can't get my head round this pc-connectivity-manager thing.
I'm ticking the box for bluetooth in the "none" profile but it just keeps complaining that the phone won't pair.

edit: just found your post which says no need to configure anything there. :confused:

Oh well.
I've made some progress I guess. At least I can establish a point to point PAN connection even if there is no internet sharing.

I guess I'll leave this for a while and come back to it. :(

9000 2010-11-13 13:44

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by HRH_H_Crab (Post 872297)
O.K.
I am making real progress now using your method! :D

From a clean boot of my N900 using my Macbook as client:

I immediately initiate a PAN request from the Mac, it connects.
I then run your script.
I can ping 192.168.1.1 and successfully ssh into the N900 from the PAN.

BUT...

The phone isn't asking to start an internet connnection.
I'm going to start my gprs0 interface before initiating the PAN and see how that works...

If the PAN is successfully established and you could ping from both sides then it's already 90% success. It makes no different whether the gprs0 was activated before or after the script. The script must be activated after pairing up, though.

In this caes, there are two possible obstacles get in your way:

1) The default routing of your Mac is not the N900, or the DNS was not setup probably. You would like to check this out
2) The iptables on N900 was not running successfully. You may issue the following command alone after the 4.3.1 script to see if there's any error in iptables:

Code:

iptables -F
iptables -t nat -F
iptables -t nat -A POSTROUTING -o gprs0 -j MASQUERADE

Quote:

Originally Posted by HRH_H_Crab (Post 872329)
Ugh. I read back through the thread and looked at WorldKaoss' posts.
He seemed to have the same problems.
I can't get my head round this pc-connectivity-manager thing.
I'm ticking the box for bluetooth in the "none" profile but it just keeps complaining that the phone won't pair.

WorldKaoss's problem is very different from yours. Obviously there's something in the Windows 7's setting got in his way, however he does not seem to want to pursuit the case any further.

If you could establish PAN and could ping from both side then you can forget pc-connectivity-manager. I'm sure the removal of 'network' from the DisablePlugins did the trick as well. From my experience telling people with no Linux experience to edit a system file is thousand times more dangerous than install a package. It's good that you've experience in Linux.

Good luck and tell me the result.

HRH_H_Crab 2010-11-14 11:23

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
The thing is - imagine I have not started gprs0.
I get the PAN working and then open a shell on the Mac.
I start pinging the phone and it is of course successful.
So I then start gprs on the phone... immediately my pings from the Mac fail.

Surely this can't be routing or DNS on the Mac side? The route to the phone shouldn't change after I start gprs! And I haven't even start dealing with domain names yet so DNS can't be an issue.

Very hard to work out how enabling gprs seems to break the PAN.

HRH_H_Crab 2010-11-14 11:47

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
I've got it working! :D
Adding DNS seems to have fixed things.
Sorry to have put you through all this grief! ;)

Thanks so much for your hard work!

9000 2010-11-14 12:23

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by HRH_H_Crab (Post 873041)
I've got it working! :D
Adding DNS seems to have fixed things.
Sorry to have put you through all this grief! ;)

Thanks so much for your hard work!

That's great. Welcome to the PAN party. I think you're one of the very few people in the world actually use PAN for tethering. :D

mauron85 2011-01-26 20:06

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
For DHCP and Auto DNS configuration, you can inspire from:
http://wiki.maemo.org/N900_USB_router

Just add before stand-alone command:

Code:

dnsmasq -I lo -z -a 192.168.1.1 -F 192.168.1.64,192.168.1.127

PS: tested and it works with Windows 7, but probably you'll have to renew dns lease:
Code:

ipconfig /renew "Name of PAN Adapter"

9000 2011-01-27 01:08

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by mauron85 (Post 929290)
For DHCP and Auto DNS configuration, you can inspire from:
http://wiki.maemo.org/N900_USB_router

Just add before stand-alone command:

Code:

dnsmasq -I lo -z -a 192.168.1.1 -F 192.168.1.64,192.168.1.127

PS: tested and it works with Windows 7, but probably you'll have to renew dns lease:
Code:

ipconfig /renew "Name of PAN Adapter"

I'll experiment with it and then update the script in #1. Thanks for your hints.

anapospastos 2011-02-08 15:27

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Can I share my N900's internet connection with a sony ericsson k850 over bluetooth?

9000 2011-02-08 16:16

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by anapospastos (Post 939046)
Can I share my N900's internet connection with a sony ericsson k850 over bluetooth?

As far as I know k850 can establish a bluetooth PAN. You may refer to the thread here for the instructions. Just connect to N900 as if it's connecting to a PC.

anapospastos 2011-02-10 10:17

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by 9000 (Post 939100)
As far as I know k850 can establish a bluetooth PAN. You may refer to the thread here for the instructions. Just connect to N900 as if it's connecting to a PC.

I set up the k850 but I need the settings for N900.

9000 2011-02-10 10:30

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Have you followed my instructions on #1?

anapospastos 2011-02-10 12:48

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by 9000 (Post 940783)
Have you followed my instructions on #1?

I'm running the script but nothing happens. Also I don't know exactly the settings I should have on the K850.

9000 2011-02-10 12:54

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
The script is to be run after the devices are paired up. Have you paired them up?

anapospastos 2011-02-10 13:45

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Yeah the devices are paired but the script seems not running. On the k850 I see the message "Communication failure. Try again or contact your operator for support." so I do not have the correct settings also.

9000 2011-02-10 13:57

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Are you sure you're establishing a PAN with N900 not DUN?

anapospastos 2011-02-10 14:11

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Under streaming settings (on the k850) I ve set the PanUDefaultAccount with your settings described on the first post. It has also a proxy selection which is disabled.

9000 2011-02-10 14:17

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Try run the following as root:

Code:

iptables -L
ifconfig bnep0



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

vBulletin® Version 3.8.8