2015-09-25 10:45:39

by Lad, Prabhakar

[permalink] [raw]
Subject: rfcomm sockets

Hi,

I am using 5.34 bluez-5 stack on linux kernel version 3.14. when I
create rfcomm connection and do cat /dev/rfcomm0 and from other
terminal send AT commands to rfcomm0 I get proper response and other
characters continuously(> ??? ...) echoed from rfcomm0.
If I do the same from bluez4-101 I get proper response with no other characters.

What is the proper way to do rfcomm communication ? I am trying to
connect to a OBD device via rfcom socket.


Cheers,
--Prabhakar Lad


2015-09-28 09:32:40

by Lad, Prabhakar

[permalink] [raw]
Subject: Re: rfcomm sockets

Hi Marcel,

On Fri, Sep 25, 2015 at 4:05 PM, Marcel Holtmann <[email protected]> wrote:
> Hi Prabhakar,
>
>> I am using 5.34 bluez-5 stack on linux kernel version 3.14. when I
>> create rfcomm connection and do cat /dev/rfcomm0 and from other
>> terminal send AT commands to rfcomm0 I get proper response and other
>> characters continuously(> ??? ...) echoed from rfcomm0.
>> If I do the same from bluez4-101 I get proper response with no other characters.
>>
>> What is the proper way to do rfcomm communication ? I am trying to
>> connect to a OBD device via rfcom socket.
>
> the /dev/rfcomm0 is a TTY. You have to set it to the right mode (most cases raw mode) to make sure that no extra characters are inserted. If you use rfcomm connect command, then the --raw switch might help.
>
Thanks the raw flag did the trick.

Cheers,
--Prabhakar Lad

2015-09-25 15:05:20

by Marcel Holtmann

[permalink] [raw]
Subject: Re: rfcomm sockets

Hi Prabhakar,

> I am using 5.34 bluez-5 stack on linux kernel version 3.14. when I
> create rfcomm connection and do cat /dev/rfcomm0 and from other
> terminal send AT commands to rfcomm0 I get proper response and other
> characters continuously(> ??? ...) echoed from rfcomm0.
> If I do the same from bluez4-101 I get proper response with no other characters.
>
> What is the proper way to do rfcomm communication ? I am trying to
> connect to a OBD device via rfcom socket.

the /dev/rfcomm0 is a TTY. You have to set it to the right mode (most cases raw mode) to make sure that no extra characters are inserted. If you use rfcomm connect command, then the --raw switch might help.

Regards

Marcel