Monday, March 15, 2010

RFCOMM connection using backtrack4


There are still many questions on the web when it comes to RFCOMM connections. In this tutorial i will explain some of the basic methods to get you up and running with RFCOMM connection to an external bluetooth GPS and read NMEA data.

First, switch on the GPS and identify the BT address.

hcitool scan hci0

Now, edit /etc/bluetooth/rfcomm.conf to appear like the image above.


Restart your BT services:

root@ronnieflip:~$ /etc/init.d/bluetooth stop
root@ronnieflip:~$ /etc/init.d/bluetooth start

You should now be able to bind your GPS to /dev/rfcomm0, like this:

root@ronnieflip:~$ rfcomm bind 0

Confirm your connection:

root@ronnieflip:~$ rfcomm
rfcomm0: 00:11:22:33:44:55 channel 1 clean

....watch the NMEA strings coming from your GPS:

root@ronnieflip:~$ cat /dev/rfcomm0
$GPGGA,111748.000,5907.6964,N,01121.1787,E,1,06,1.2,57.7,M,40.1,M,,0000*6F
$GPRMC,111748.000,A,5907.6964,N,01121.1787,E,0.00,94.94,160807,,,A*50$GPVTG,94.94,T,,M,0.00,N,0.0,K,A*3D

3 comments:

  1. Have a doubt as to remove rfcom saved, set up just like seeing the image as one of his videos and classes do not know how to remove them has a 6-well please email me ajude.Meu: grandemartelo@hotmail.com

    ReplyDelete
  2. bro you got any bluetooth script to (newbies) for backtrack 4.i still cant do it...thank(newbies)

    ReplyDelete
  3. Brother your blog helped me a lot..
    Thnx for sharing these..
    I have a problem..
    After configuring all when i'm typing
    cat /dev/rfcomm0

    A pop up in my phone is coming and asking for passcode.
    I dont know the passcode.From Where i can have the passcode and the blue tooth name of my PC.
    One thing I have changed the hcid.conf file to the following
    #
    # HCI daemon configuration file.
    #

    # HCId options
    options {
    # Automatically initialize new devices
    autoinit yes;

    # Security Manager mode
    # none - Security manager disabled
    # auto - Use local PIN for incoming connections
    # user - Always ask user for a PIN
    #
    security auto;

    # Pairing mode
    # none - Pairing disabled
    # multi - Allow pairing with already paired devices
    # once - Pair once and deny successive attempts
    pairing multi;

    # Default PIN code for incoming connections
    passkey "1234";
    }

    # Default settings for HCI devices
    device {
    # Local device name
    # %d - device id
    # %h - host name
    name "device1";

    # Local device class
    class 0x000000; //My Backtrack PC class name got from "hciconfig -a"

    # Default packet type
    #pkt_type DH1,DM1,HV1;

    # Inquiry and Page scan
    iscan enable; pscan enable;

    # Default link mode
    # none - no specific policy
    # accept - always accept incoming connections
    # master - become master on incoming connections,
    # deny role switch on outgoing connections
    lm accept,master;

    # Default link policy
    # none - no specific policy
    # rswitch - allow role switch
    # hold - allow hold mode
    # sniff - allow sniff mode
    # park - allow park mode
    lp rswitch,hold,sniff,park;
    auth enable;
    encrypt enable;
    }


    and tried to enter the pass code "1234".But its not working.

    ReplyDelete