2

When connecting to a Bluetooth serial port from Ubuntu:

adi@Poppy:~$ sudo rfcomm -r connect 0
Connected /dev/rfcomm0 to 1C:3E:84:FE:4F:69 on channel 8
Press CTRL-C for hangup

on the client side I receive the following data which is automatically sent from Ubuntu on connect:

41 54 5e 53 51 50 4f 52 54 3f 0d 41 54 0d 41 54 0d 41 54 0d 7e 00 78 f0 7e 7e 00 78 f0 7e

AT^SQPORT?
AT
AT
AT
~

This interferes with what I want to do so I need to prevent Ubuntu from sending any unsolicited data to the client.

Thanks.

BaCaRoZzo
  • 7,502
  • 6
  • 51
  • 82
Adrian
  • 331
  • 1
  • 4
  • 16

2 Answers2

1

After connecting to a port, minicom can function only with root(and that confused me). For any other user I get:

adi@Poppy:~$ minicom -D /dev/rfcomm1
minicom: cannot open /dev/rfcomm1: Device or resource busy

adi@Poppy:~$ ls -lsa /dev/rfcomm1 
0 crw-rw-rw- 1 root dialout 216, 1 aug  3 19:46 /dev/rfcomm1

So I did this:

adi@Poppy:~$ sudo fuser /dev/rfcomm1
[sudo] password for adi: 
/dev/rfcomm1:          696

adi@Poppy:~$ ps -p 696
  PID TTY          TIME CMD
  696 ?        00:00:00 ModemManager

Aha, got you!

After killing the process, what do you think? No AT commands on connect.

Adrian
  • 331
  • 1
  • 4
  • 16
1

Another method, setting up a new rule in udev system can help.

In /etc/udev/rules.d/90-rfcomm.rules, please put the following line:

KERNEL=="rfcomm[0-9]*", ENV{ID_MM_DEVICE_IGNORE}="1"

iPAS
  • 4,603
  • 1
  • 17
  • 5