1
votes

I am trying connect Ubuntu pc with device. While command entered, it returns various error including rfcomm connect address already in usehost is downrfcomm connect now in progress.

Device environment and procedure as below

Device environment

  • Linux 3.4
  • Bluez 5.19
  • bt addr xx:xx:xx:xx:38:A4

PC environment

  • Ubuntu 14.04
  • bluez 4
  • bt addr xx:xx:xx:xx:CF:F0

steps

device

  • insmod rfcomm.ko rtk_btusb.ko
  • dbus-daemon --config-file=/etc/dbus-1/system.conf
  • bluetoothd -C &
  • hciconfig hci0 up
  • hciconfig hci0 piscan
  • sdptool add SP
  • bluetoothctl scan on
  • bluetoothctl agent on
  • bluetoothctl default-agent
  • bluetoothctl trust xx:xx:xx:xx:CF:F0
  • bluetoothctl pair xx:xx:xx:xx:CF:F0
  • rfcomm bind 0 xx:xx:xx:xx:CF:F0 1
  • chmod 666 /dev/rfcomm0
  • rfcomm connect 0 xx:xx:xx:xx:CF:F0 1

PC

  • sdptool add SP
  • rfcomm bind 0 xx:xx:xx:xx:38:A4 1
  • chmod 666 /dev/rfcomm0
  • rfcomm watch 0 1

Device show Can't connect RFCOMM socket: Host is down

hciconfig -a output

hci0:   Type: BR/EDR  Bus: USB
        BD Address: 5C:F3:70:1B:38:A4  ACL MTU: 820:8  SCO MTU: 255:16
        UP RUNNING PSCAN ISCAN
        RX bytes:6888 acl:88 sco:0 events:230 errors:0
        TX bytes:4341 acl:84 sco:0 commands:87 errors:0
        Features: 0xff 0xff 0xff 0xfe 0xdb 0xff 0x7b 0x87
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
        Link policy: RSWITCH HOLD SNIFF PARK
        Link mode: SLAVE ACCEPT
        Name: 'BlueZ 5.19'
        Class: 0x000000
        Service Classes: Unspecified
        Device Class: Miscellaneous,
        HCI Version: 4.0 (0x6)  Revision: 0xe2f
        LMP Version: 4.0 (0x6)  Subversion: 0x9f73
        Manufacturer: Realtek Semiconductor Corporation (93)

Is any step missed in my procedure?

1
l2ping from PC to device work, but from device to PC show connection reset by peer after send 4 times.Jericho

1 Answers

0
votes

below steps works for me.

PC side

  • sdptool add SP
  • rfcomm -i hci0 watch 0 1 ./picocom /dev/rfcomm0

Device side

  • sdptool add SP
  • rfcomm connect 0 xx:xx:xx:xx:xx:F0 1 &
  • picocom /dev/rfcomm0

reference