LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-08-2010, 04:19 PM   #1
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Rep: Reputation: 58
Rfcomm bluez


# rfcomm -a
rfcomm0: 00:1A:89:09:8C:77 channel 1 clean
rfcomm1: 00:07:E0:2E:99:43 channel 3 clean

Then I connect by the mobile, and:
# rfcomm -a
rfcomm0: 00:1A:89:09:8C:77 channel 1 clean
rfcomm1: 00:07:E0:2E:99:43 channel 3 clean
rfcomm2: 00:1BC:0F:5C:AB -> 00:07:E0:2E:99:43 channel 1 connected [reuse-dlc release-on-hup tty-attached]

What the heck is that rfcomm2, when that mobile is bound to rfcomm1?
Is it udev that makes fun of me? If so, how to bind the devices to specific rfcomm interfaces via udev?

# rpm -qa | grep blue
libbluetooth2-3.36-6.1
bluez-4.22-6.1.10
python-pybluez-0.16-3.1
bluez-test-4.22-6.1.10
bluez-compat-4.22-6.1.10
kdebluetooth4-0.3-9.3
libbluetooth3-4.22-6.1.10
 
Old 05-08-2010, 05:01 PM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
What is the contents of "/etc/bluetooth/rfcomm.conf"? Perhaps it is setting up some binds that you aren't aware of.
 
Old 05-08-2010, 06:10 PM   #3
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
Rfcomm.conf contains the same bindings, so it does not seem to matter, either.
I do not know why is that so, as /etc/sysconfig/bluetooth contains this option:
RFCOMM_ARGS="-f /etc/bluetooth/rfcomm.conf"

Other options in that file are effected, only rfcomm_args seem to be ignored by the system.
 
Old 05-08-2010, 10:12 PM   #4
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Your answer is not clear. The bindings in rfcomm.conf are the same as the ones you are seeing when you do "rfcomm -a", or they are the same as the ones you actually want to make.

If the rfcomm0 and rfcomm1 binds are in rfcomm.conf, then delete them. They are being recreated because that file is telling the system to recreate them at startup.
 
Old 05-09-2010, 04:30 AM   #5
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
The main problem is: I have two devices (Nokia N70 with gnubox and a palm T3) that connects to internet via the PC and bluetooth (rfcomm, dund, pand).
When both connects, they try to use the same rfcomm channel, and both fails.

So, I tried to bind them to specific rfcomm devices and channels, using two separate methods: rfcomm commands from console or rfcomm.conf, and also tried the combination of both.

The problem is: no matter what bindings I do, no matter how, the N70 and the palm use the same rfcomm channel, and both fails.

The general finding is that both devices insist on using channel 1, and the first free device number, not bound to anything by a console command, irrespective of rfcomm.conf.

So, if binding to specific rfcomm devices (and channels) fails by both methods, how to ensure that the two devices use separate channels?

Last edited by J_Szucs; 05-09-2010 at 04:41 AM.
 
Old 05-09-2010, 09:37 PM   #6
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
You don't have control over what RFCOMM channel the devices connect on, they will use whatever channel that particular service is setup for. But I don't understand where your problem is coming from, as if they are being bound to separate RFCOMM devices (rfcomm0 and rfcomm1), it doesn't matter if they are on the same channel.
 
Old 05-10-2010, 05:41 AM   #7
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
Well, I am totally confused now what this is all about. Some howtos call it "channel", some other call it "port number". Some say, a separate channel is needed for each device, others say nothing about that.

Anyway, when both devices try to connect to the internet via dund and ppp, both fail. So, what can be the reason, if not the fact that they use the same "channel"?

Is there a working setup (using dund and ppp) that can connect both mobile devices to the internet via bluetooth and through the PC?

Last edited by J_Szucs; 05-10-2010 at 05:47 AM.
 
Old 05-11-2010, 02:08 AM   #8
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
Well, I think, if the culprit is not the fact of using the same channel, then maybe it can be ppp device creation:
# Create a file called /etc/ppp/peers/dun with the following contents
* noauth
* 192.168.1.1:192.168.1.2
* crtscts 115200
* ms-dns
* lock

# Edit the file /etc/sysconfig/dund so you have the following configuration
* DUNDARGS='--listen --msdun call dun'

So far as I can judge, this will create one single ppp device: ppp0, with one single peer having ip address 192.168.1.2. Meanwhile there are two peers, so ip addresses will conflict.
Can a ppp device "handle" more peers?:
192.168.1.1:

Or should dund create a new ppp device for each mobile device connecting via bluetooth? Can it be done?

And also: if there are more than one mobile devices to connect, should dund be configured as a piconet master?

Edit:
Maybe I am getting closer to the solution: am I right that if I create options.rfcomm0 and options.rfcomm1 files in /etc/ppp, then ppp will create separate, ppp0 and ppp1 interfaces for the two connecting mobile devices?
Are these options files consulted even if "dundargs" has "call dun" option (meaning that arguments common for both connections should be in file "dun", and specific to each connection should be in files options.rfcommX)?

Last edited by J_Szucs; 05-11-2010 at 03:00 AM.
 
Old 05-12-2010, 07:54 AM   #9
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
No success. The palm gladly uses the new setup, but the n70 with gnubox cannot connect, even if it is alone. Even the rfcomm device is not created. I really wonder why creating two options files for the ppp devices (options.rfcomm0 and options.rfcomm1) prevents creation of the rfcomm device - and just for the n70...

Anyone knowing if it is theoretically possible to share the internet via a PC, using a single usb bluetooth dongle for two handhelds/phones?

I have already tried several configurations and wasted several days without success

P.S
My doubts: if I have two devices to connect to internet, do I have to:
- configure a piconet master?
- use option "pairing multi" in hcid.conf (= /etc/sysconfig/bluetooth nowadays?)
- add two SP services by sdptool? Specifying the same, or different channels?
- configure two ppp interfaces? Can those be created by dund?

Exactly what are the channel Nos to be given for sdptool and in rfcomm.conf? Must they match the channel No. of a service offered by the mobile device or can be arbitrary? If a service must be matched, then which service? Rfcomm?

Last edited by J_Szucs; 05-12-2010 at 08:33 AM.
 
Old 05-12-2010, 04:18 PM   #10
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
It turned out that the channel No. is totally irrelevant (though it does not hurt to specify any), as these are incoming connections to the PC. Several guys whose posts at different forums I used as reference used the channel No. in their configs - probably not knowing what they are doing.
It also turned out that due to a bug in my nokia n70 or gnubox, the n70 was not able to use the locally assigned ip addressed, so the ip address had to be configured on the ppp server.

Now both devices can connect to the internet, but still not simultaneously.

Here is my present config:
/etc/sysconfig/bluetooth:
RFCOMM_ENABLE="yes"
RFCOMM_EXEC="/usr/bin/rfcomm"
RFCOMM_ARGS="-f /etc/bluetooth/rfcomm.conf"
DUND_START="yes"
DUND_DAEMON="/usr/bin/dund"
DUND_DAEMON_ARGS="--listen --persist --msdun call btpeers"

/etc/bluetooth/rfcomm.conf:
rfcomm0 {
bind no;
device 00:1A:89:09:8C:77; #that's your palm's bluetooth hardware address (found above)
}
rfcomm1 {
bind no;
device 00:07:E0:2E:99:43; #that's your palm's bluetooth hardware address (found above)
}

/etc/ppp/peers/btpeers:
115200
local
ms-dns 213.46.246.53
netmask 255.255.255.0
noauth
debug

/etc/ppp/options.rfcomm0:
10.36.1.1:10.36.1.2

/etc/ppp/options.rfcomm1:
10.36.2.1:10.36.2.2

Firewall:
iptables -t nat -I POSTROUTING -o wlan0 -s 10.36.0.0/16 -j MASQUERADE
iptables -I FORWARD -i ppp0 -j ACCEPT
iptables -I FORWARD -o ppp0 -j ACCEPT
iptables -I FORWARD -i ppp1 -j ACCEPT
iptables -I FORWARD -o ppp1 -j ACCEPT

Given the above config, why cannot the two mobile devices simultaneously use the internet?

Edit:
Solved: I had to add the two routes in my firewall script:
route add -net 10.36.1.0 netmask 255.255.255.0 gw 10.36.1.1
route add -net 10.36.2.0 netmask 255.255.255.0 gw 10.36.2.1

Last edited by J_Szucs; 05-12-2010 at 05:23 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rfcomm blues CoderMan Gentoo 5 01-06-2011 05:14 AM
Bluetooth works, rfcomm doesn't Hangdog42 Slackware 2 09-09-2008 06:56 PM
Rfcomm connectivity problem prashantaghamkar Linux - Networking 0 10-29-2007 05:38 AM
bluesnarfer and rfcomm patricius Linux - Software 2 10-10-2007 12:12 AM
Problem with rfcomm on suse10.2 dtashmore SUSE / openSUSE 0 01-18-2007 02:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration