2006-08-01 00:12:07

by John Gruenenfelder

[permalink] [raw]
Subject: [Bluez-users] Pairing problem with Plantronics headset

I am attempting to use btsco with my Plantronics M2500 headset. I am using
the most recent Debian bluez-utils packages (3.1-3).

The headset's passkey/pin is "0000" which I have set in both
/etc/bluetooth/hcid.conf as:
passkey "0000";

and in /etc/bluetooth/passkeys/default as just "0000".

When I turn on the headset, put it in pairing mode, and then attempt to run
btsco, I get the following from btsco:

-----
./btsco 00:03:89:6E:C9:11
Error: Failed to connect to SDP server: Permission denied
Assuming channel 2

Can't connect RFCOMM channel: Permission denied
-----

In the system logs the only new entries generated are:

Jul 31 19:32:52 Redtail hcid[5743]: pin_code_request (sba=00:16:41:89:98:00, dba=00:03:89:6E:C9:11)
Jul 31 19:32:52 Redtail hcid[5743]: Calling PasskeyAgent.Request: name=:1.5, path=/org/bluez/passkey_agent_5755
Jul 31 19:32:56 Redtail hcid[5743]: pin_code_request (sba=00:16:41:89:98:00, dba=00:03:89:6E:C9:11)
Jul 31 19:32:56 Redtail hcid[5743]: Calling PasskeyAgent.Request: name=:1.5, path=/org/bluez/passkey_agent_5755

To me, these seem to indicate that the PIN is being requested, but perhaps not
being returned properly? I also tried creating a passkey explicitly for this
device as:
/etc/bluetooth/passkeys/00:03:89:6E:C9:11

But the log messages were the same for this instance. What am I doing wrong?
Thanks in advance.


--
--John Gruenenfelder Research Assistant, UMass Amherst student
Systems Manager, MKS Imaging Technology, LLC.
Try Weasel Reader for PalmOS -- http://gutenpalm.sf.net
"This is the most fun I've had without being drenched in the blood
of my enemies!"
--Sam of Sam & Max

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users


2006-08-01 01:06:45

by John Gruenenfelder

[permalink] [raw]
Subject: Re: [Bluez-users] Pairing problem with Plantronics headset

On Tue, Aug 01, 2006 at 04:20:19AM +0200, Marcel Holtmann wrote:
>Hi John,
>
>run "hcidump -X -V" and try again to see what is going on.
>
>Regards
>Marcel

Thanks for the quick reply. I ran the above command and saw in the output
that the requested pin was being delivered as 0000. But I also noticed that
the length was 5 bytes.

Looking closer, I see that the pin is actually 0000 plus 0x0A. I had set the
pin by:
echo "0000" > default

But that tacked on a linefeed. Using "echo -n" instead solved the problem and
now the headset pairs and I get audio via btsco. Thanks.


--
--John Gruenenfelder Research Assistant, UMass Amherst student
Systems Manager, MKS Imaging Technology, LLC.
Try Weasel Reader for PalmOS -- http://gutenpalm.sf.net
"This is the most fun I've had without being drenched in the blood
of my enemies!"
--Sam of Sam & Max

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2006-08-01 14:15:17

by manojt ambe

[permalink] [raw]
Subject: Re: [Bluez-users] Problem developing bluetooth program

Are you sure channel 40 exists on your device. Try
sdptool browse <bdaddr> or sdptool records command to
find out.
Also i think try following to fill in sockaddr_rc. It
may remove some unwanted characters.

char *bdaddr_str;
bdaddr_t bdaddr;
struct sockaddr_rc addr;
int channel=3D40;

bdaddr_str =3D "00:11:67:39:05:0F";
str2ba(bdaddr_str, &bdaddr);

memset(&addr, 0, sizeof(addr));
addr.rc_family =3D AF_BLUETOOTH;
bacpy(&addr.rc_bdaddr, bdaddr);
addr.rc_channel =3D channel;

thanks,
Manoj

--- Mate Soos <[email protected]> wrote:

> Hi!
> =

> I have been having problems developing a bluetooth
> program of mine. The
> problem, simply put: I open an RFCOMM socket with
> socket(), bind(),
> connect(), and whatever I do, the connect() will
> fail with Invalid
> Argument. I have now made this *extremely simple*
> program, and I am
> having the same damn problem:
> =

> #include <bluetooth/bluetooth.h>
> #include <bluetooth/rfcomm.h>
> #include <iostream>
> #include <errno.h>
> #include <string.h>
> #include <sys/socket.h>
> =

> int main() {
> int s;
> int channel=3D40;
> char addr[40],addr2[40];
> strcpy(addr,"00:11:67:39:05:0F");
> strcpy(addr2,"00:11:67:39:36:BB");
> =

> =

> std::cerr << "RfcommSocket::connectToHost from "
> << addr2 << " to
> addr: "<< addr << "," << channel << std::endl;
> sockaddr_rc rem_addr, loc_addr;
> =

> if( (s =3D ::socket(PF_BLUETOOTH, SOCK_STREAM,
> BTPROTO_RFCOMM)) < 0 ) {
> std::cerr << "Can't create socket" <<
> strerror(errno) << errno
> << std::endl;
> return -1;
> }
> =

> memset(&loc_addr, 0, sizeof(loc_addr));
> loc_addr.rc_family =3D AF_BLUETOOTH;
> str2ba(addr2,&loc_addr.rc_bdaddr);
> if (bind(s, (struct sockaddr *) &loc_addr,
> sizeof(loc_addr)) < 0 ) {
> std::cerr << "Can't bind socket"<< =

> strerror(errno) << errno <<
> std::endl;
> return -1;
> }
> =

> memset(&rem_addr, 0, sizeof(rem_addr));
> rem_addr.rc_family =3D AF_BLUETOOTH;
> str2ba(addr,&rem_addr.rc_bdaddr);
> rem_addr.rc_channel =3D channel;
> if(::connect(s, (struct sockaddr *)&rem_addr,
> sizeof(rem_addr)) < 0 ){
> std::cerr << "Can't connect." <<
> strerror(errno) << errno <<
> std::endl;
> close(s);
> return -1;
> }
> std::cerr << "Connected." << std::endl;
> return 0;
> }
> =

> Output of program:
> =

> RfcommSocket::connectToHost from 00:11:67:39:36:BB
> to addr:
> 00:11:67:39:05:0F,40
> Can't connect.Invalid argument22
> =

> Output of hciconf -a:
> =

> hci0: Type: USB
> BD Address: 00:11:67:39:36:BB ACL MTU: 678:8
> SCO MTU: 48:10
> UP RUNNING PSCAN ISCAN INQUIRY
> RX bytes:418 acl:0 sco:0 events:22 errors:0
> TX bytes:339 acl:0 sco:0 commands:22
> errors:0
> Features: 0xbf 0xfe 0x8d 0x78 0x08 0x18 0x00
> 0x00
> Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2
> HV3
> Link policy:
> Link mode: SLAVE ACCEPT
> Name: 'masodik'
> Class: 0x3e0100
> Service Classes: Networking, Rendering,
> Capturing
> Device Class: Computer, Uncategorized
> HCI Ver: 1.2 (0x2) HCI Rev: 0x1fe LMP Ver:
> 1.2 (0x2) LMP Subver:
> 0x1fe
> Manufacturer: Integrated System Solution
> Corp. (57)
> =

> hci1: Type: USB
> BD Address: 00:11:67:39:05:0F ACL MTU: 678:8
> SCO MTU: 48:10
> UP RUNNING PSCAN ISCAN
> RX bytes:13012 acl:110 sco:0 events:356
> errors:0
> TX bytes:5061 acl:110 sco:0 commands:102
> errors:0
> Features: 0xbf 0xfe 0x8d 0x78 0x08 0x18 0x00
> 0x00
> Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2
> HV3
> Link policy:
> Link mode: SLAVE ACCEPT
> Name: 'elso'
> Class: 0x3e0100
> Service Classes: Networking, Rendering,
> Capturing
> Device Class: Computer, Uncategorized
> HCI Ver: 1.2 (0x2) HCI Rev: 0x1fe LMP Ver:
> 1.2 (0x2) LMP Subver:
> 0x1fe
> Manufacturer: Integrated System Solution
> Corp. (57)
> =

> =

> I have *really* read through all the revelant
> details, I have been
> reading the libbluetooth sourcecode nonstop(!), I
> have copy-pasted
> several examples, no luck. It always gives me this
> stupid error, and I
> am totally fed up with it. I have been getting it
> for the past 1.5
> weeks, and I work 4 hours per day on this. Any
> ideas?
> =

> I really appreciate all help,
> =

> M=E1t=E9 So=F3s
> =

>
-------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get
> the chance to share your
> opinions on IT & business topics through brief
> surveys -- and earn cash
>
http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3DDE=
VDEV
> _______________________________________________
> Bluez-users mailing list
> [email protected]
>
https://lists.sourceforge.net/lists/listinfo/bluez-users
> =



__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around =

http://mail.yahoo.com =


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3DDE=
VDEV
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2006-08-01 10:50:21

by Mate Soos

[permalink] [raw]
Subject: [Bluez-users] Problem developing bluetooth program

Hi!

I have been having problems developing a bluetooth program of mine. The
problem, simply put: I open an RFCOMM socket with socket(), bind(),
connect(), and whatever I do, the connect() will fail with Invalid
Argument. I have now made this *extremely simple* program, and I am
having the same damn problem:

#include <bluetooth/bluetooth.h>
#include <bluetooth/rfcomm.h>
#include <iostream>
#include <errno.h>
#include <string.h>
#include <sys/socket.h>

int main() {
int s;
int channel=3D40;
char addr[40],addr2[40];
strcpy(addr,"00:11:67:39:05:0F");
strcpy(addr2,"00:11:67:39:36:BB");


std::cerr << "RfcommSocket::connectToHost from " << addr2 << " to
addr: "<< addr << "," << channel << std::endl;
sockaddr_rc rem_addr, loc_addr;

if( (s =3D ::socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM)) < 0 ) {
std::cerr << "Can't create socket" << strerror(errno) << errno
<< std::endl;
return -1;
}

memset(&loc_addr, 0, sizeof(loc_addr));
loc_addr.rc_family =3D AF_BLUETOOTH;
str2ba(addr2,&loc_addr.rc_bdaddr);
if (bind(s, (struct sockaddr *) &loc_addr, sizeof(loc_addr)) < 0 ) {
std::cerr << "Can't bind socket"<< strerror(errno) << errno <<
std::endl;
return -1;
}

memset(&rem_addr, 0, sizeof(rem_addr));
rem_addr.rc_family =3D AF_BLUETOOTH;
str2ba(addr,&rem_addr.rc_bdaddr);
rem_addr.rc_channel =3D channel;
if(::connect(s, (struct sockaddr *)&rem_addr, sizeof(rem_addr)) < 0 ){
std::cerr << "Can't connect." << strerror(errno) << errno <<
std::endl;
close(s);
return -1;
}
std::cerr << "Connected." << std::endl;
return 0;
}

Output of program:

RfcommSocket::connectToHost from 00:11:67:39:36:BB to addr:
00:11:67:39:05:0F,40
Can't connect.Invalid argument22

Output of hciconf -a:

hci0: Type: USB
BD Address: 00:11:67:39:36:BB ACL MTU: 678:8 SCO MTU: 48:10
UP RUNNING PSCAN ISCAN INQUIRY
RX bytes:418 acl:0 sco:0 events:22 errors:0
TX bytes:339 acl:0 sco:0 commands:22 errors:0
Features: 0xbf 0xfe 0x8d 0x78 0x08 0x18 0x00 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy:
Link mode: SLAVE ACCEPT
Name: 'masodik'
Class: 0x3e0100
Service Classes: Networking, Rendering, Capturing
Device Class: Computer, Uncategorized
HCI Ver: 1.2 (0x2) HCI Rev: 0x1fe LMP Ver: 1.2 (0x2) LMP Subver:
0x1fe
Manufacturer: Integrated System Solution Corp. (57)

hci1: Type: USB
BD Address: 00:11:67:39:05:0F ACL MTU: 678:8 SCO MTU: 48:10
UP RUNNING PSCAN ISCAN
RX bytes:13012 acl:110 sco:0 events:356 errors:0
TX bytes:5061 acl:110 sco:0 commands:102 errors:0
Features: 0xbf 0xfe 0x8d 0x78 0x08 0x18 0x00 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy:
Link mode: SLAVE ACCEPT
Name: 'elso'
Class: 0x3e0100
Service Classes: Networking, Rendering, Capturing
Device Class: Computer, Uncategorized
HCI Ver: 1.2 (0x2) HCI Rev: 0x1fe LMP Ver: 1.2 (0x2) LMP Subver:
0x1fe
Manufacturer: Integrated System Solution Corp. (57)


I have *really* read through all the revelant details, I have been
reading the libbluetooth sourcecode nonstop(!), I have copy-pasted
several examples, no luck. It always gives me this stupid error, and I
am totally fed up with it. I have been getting it for the past 1.5
weeks, and I work 4 hours per day on this. Any ideas?

I really appreciate all help,

M=E1t=E9 So=F3s

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3DDE=
VDEV
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2006-08-01 02:20:19

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] Pairing problem with Plantronics headset

Hi John,

> I am attempting to use btsco with my Plantronics M2500 headset. I am using
> the most recent Debian bluez-utils packages (3.1-3).
>
> The headset's passkey/pin is "0000" which I have set in both
> /etc/bluetooth/hcid.conf as:
> passkey "0000";
>
> and in /etc/bluetooth/passkeys/default as just "0000".
>
> When I turn on the headset, put it in pairing mode, and then attempt to run
> btsco, I get the following from btsco:
>
> -----
> ./btsco 00:03:89:6E:C9:11
> Error: Failed to connect to SDP server: Permission denied
> Assuming channel 2
>
> Can't connect RFCOMM channel: Permission denied
> -----
>
> In the system logs the only new entries generated are:
>
> Jul 31 19:32:52 Redtail hcid[5743]: pin_code_request (sba=00:16:41:89:98:00, dba=00:03:89:6E:C9:11)
> Jul 31 19:32:52 Redtail hcid[5743]: Calling PasskeyAgent.Request: name=:1.5, path=/org/bluez/passkey_agent_5755
> Jul 31 19:32:56 Redtail hcid[5743]: pin_code_request (sba=00:16:41:89:98:00, dba=00:03:89:6E:C9:11)
> Jul 31 19:32:56 Redtail hcid[5743]: Calling PasskeyAgent.Request: name=:1.5, path=/org/bluez/passkey_agent_5755
>
> To me, these seem to indicate that the PIN is being requested, but perhaps not
> being returned properly? I also tried creating a passkey explicitly for this
> device as:
> /etc/bluetooth/passkeys/00:03:89:6E:C9:11
>
> But the log messages were the same for this instance. What am I doing wrong?
> Thanks in advance.

run "hcidump -X -V" and try again to see what is going on.

Regards

Marcel



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users