LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Problem using bluetooth mobile as modem/rfcomm connection refused. (http://www.linuxquestions.org/questions/linux-networking-3/problem-using-bluetooth-mobile-as-modem-rfcomm-connection-refused-463292/)

pingu 07-12-2006 09:37 AM

Problem using bluetooth mobile as modem/rfcomm connection refused.
 
I have a USB bluetooth dongle, mobile is SonyEricsson K608i, distro is Mandriva 2006.
First time I connected it worked fine - well, I had to launch gnome-phone-manager, select settings -> apply, and the phone worked fine as a bluetooth-modem.
Next bootup it doesn't work. I believe there's a problem with rfcomm, the channel is closed and refuses to connect.
In short, here's what I get:
Code:

[root@edgar ~]# rfcomm show
rfcomm0: 00:16:20:0A:72:C7 channel 1 closed  (adress=phone)

[root@edgar ~]# rfcomm connect 0
Can't connect RFCOMM socket: Connection refused

[root@edgar ~]# hciconfig scan
hci0:  Type: USB  BD Address: 00:09:DD:10:76:B2 ACL MTU: 192:8 SCO MTU: 64:8  (adress=USB dongle)
UP RUNNING PSCAN ISCAN
RX bytes:2834 acl:36 sco:0 events:98 errors:0
TX bytes:1335 acl:32 sco:0 commands:38 errors:0

[root@edgar ~]# l2ping 00:16:20:0A:72:C7
Ping: 00:16:20:0A:72:C7 from 00:09:DD:10:76:B2
(data size 44) ... 44 bytes from 00:16:20:0A:72:C7 id 0 time 89.83ms

A little longer explanation: First time: I didn't change any hcid/rfcomm config-file. Just put in the dongle, used gnome-phone-manager and then dialup with kppp. Closing connection with kppp and /dev/rfcomm0 was deleted, had to use gnome-phone-manager again as above.
When next time it didn't work, I searched the 'net for info and changed my config-files (see bottom): Phone connects, request for PIN in phone and computer. Phone adds computer ok. Using kppp, phone says: "edgar wants to connect to Internet. Accept?"
Yes -> phone says ok, computer says "connection refused".
When issuing "rfcomm connect 0 ", the phone asks for permission to access, I press "Yes", phone says "connection refused by the other unit". Terminal output:
"Can't connect RFCOMM socket: Connection refused "

The PIN in /etc/bluetooth/pin is correct (four digits only).
My config files:
Code:

# RFCOMM configuration file.
rfcomm0 {       
bind yes;       
device 00:16:20:0A:72:C7;
#        channel        1;       
comment "Sony Ericsson k608i"; } 

# HCI daemon configuration file.
options {       
autoinit yes;       
security user;       
pairing multi;       
pin_helper /bin/bluepin;       
dbus_pin_helper; }
device {       
name "Sony %h-%d";       
class 0x3e0100;       
iscan enable; pscan enable;       
lm accept;       
lp rswitch,hold,sniff,park; }

And please forgive me for not googling more before asking - it is a bit difficult without a working internet connection...

mesharam.amit 07-12-2006 09:49 AM

hi there

as per u r problem ,it just because of bluetooth service.
do one thing goes in terminal mode & just type the command

service bluetooth stop then type

rfcomn o/p will be nothing......

then type service bluetooth start

then type rfcomn

the o/p will be look like this

rfcomm0: 00:16:20:0A:72:C7 channel 1 clean

then type pppd call gprs

if the problem arises again do above step one more time . hope it will solve u r prob.

mesharam.amit 07-12-2006 10:04 AM

solution for bluetooth dongle
 
hi there

as per u r problem ,it just because of bluetooth service.
do one thing goes in terminal mode & just type the command

service bluetooth stop then type

rfcomn o/p will be nothing......

then type service bluetooth start

then type rfcomn

the o/p will be look like this

rfcomm0: 00:16:20:0A:72:C7 channel 1 clean

then type pppd call gprs

if the problem arises again do above step one more time . hope it will solve u r prob

pingu 07-12-2006 11:47 AM

Thanks for your suggestion, however no luck so far:
I get the channel clean, as you said. But I can't use the command "pppd call gprs" since it isn't configured.
Anyway, I tried to connect with rfcomm and kppp, but still "connection refused".
I also tried without any config-files, thus:
Code:

# mknod -m666 /dev/rfcomm0 c 216 0
# rfcomm bind 0 00:16:20:0A:72:C7
# rfcomm connect 0 00:16:20:0A:72:C7
Can't connect RFCOMM socket: Connection refused

So it binds correctly, but then there's a permission error. Maybe this is not a bluetooth/rfcomm issue?
Fedora has SELinux, does Mandriva has something like it? Can't find anything, really, except firewall (which is stopped).
(BTW, I always restart bluetooth services when changing config. However there's an error stopping l2p: "module in use".)

pingu 07-12-2006 02:44 PM

Now I booted Debian Sarge, same machine.
The steps I reported works fine!
Code:

# mknod -m666 /dev/rfcomm0 c 216 0
# rfcomm bind 0 00:16:20:0A:72:C7
# rfcomm connect 0 00:16:20:0A:72:C7
Connected /dev/rfcomm0 to 00:16:20:0A:72:C7 on channel 1
Press CTRL-C for hangup

This has to be a security issue, correct me if I'm wrong but I do believe bluetooth and rfcomm works fine.
"Connection refused"...
Hmmmmm....

pingu 07-13-2006 04:37 PM

... now I booted into Debian again, guess what:
Code:

# mknod -m666 /dev/rfcomm0 c 216 0
# rfcomm bind 0 00:16:20:0A:72:C7
# rfcomm connect 0 00:16:20:0A:72:C7
Can't connect RFCOMM socket: Connection refused

What's going on here??? :scratch:
First time it just works (as is normal with Linux), then next time "connection refused" - both Mandriva and Debian?!!???!!?

pingu 07-15-2006 03:08 AM

SOLVED!
Quote:

First time it just works (as is normal with Linux), then next time "connection refused" - both Mandriva and Debian?
... which made me start to think. The problem started when I switched OS's - the same as happens with SSH, key is no longer valid when set up in different system.
So I found there should be a /etc/bluetooth/link_key - only in Mandriva the location is /var/lib/lib/bluetooth/<USB dongle adress>/link_key.
I deleted that file => fixed!
(Only thing left now is to set the speed, 115kbit/s is what WinXP allows but I believi in Linux I can set it higher - I should have 384 kb/s.)

pingu 07-15-2006 03:13 AM

SOLVED!
Quote:

First time it just works (as is normal with Linux), then next time "connection refused" - both Mandriva and Debian?
... which made me start to think. The problem started when I switched OS's - the same as happens with SSH, key is no longer valid when set up in different system.
So I found there should be a /etc/bluetooth/link_key - only in Mandriva the location is /var/lib/lib/bluetooth/<USB dongle adress>/link_key.
I deleted that file => fixed!
(Only thing left now is to set the speed, 115kbit/s is what WinXP allows but I believi in Linux I can set it higher - I should have 384 kb/s.)


All times are GMT -5. The time now is 11:50 AM.