Page 1 of 5 123 ... LastLast
Results 1 to 10 of 48

Thread: Using Bluetooth GPS

  1. #1
    Join Date
    Nov 2005
    Location
    N. Ireland
    Beans
    209
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Using Bluetooth GPS

    This how too describes how to get your bluetooth GPS device to work under linux

    This is my second how too and parts of the files needed were installed at different times ie the bluetooth a few months ago so if anyone has any problems / suggestions let me know

    Step 1

    install the needed bluetooth files:
    Code:
    sudo apt-get install bluez-pin
    sudo apt-get install bluez-utils
    Then edit the main bluetooth config file:
    Code:
    sudo gedit /etc/bluetooth/hcid.conf
    delete everything in the file and replace it with:
    Code:
    #
    # 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 user;
    
    	# Pairing mode
    	#   none  - Pairing disabled
    	#   multi - Allow pairing with already paired devices
    	#   once  - Pair once and deny successive attempts
    	pairing multi;
    
    	# PIN helper
    	pin_helper /usr/bin/bluepin;
    
    	# D-Bus PIN helper
    	#dbus_pin_helper;
    }
    
    # Default settings for HCI devices
    device {
    	# Local device name
    	#   %d - device id
    	#   %h - host name
    	name "Nino's Laptop";
    
    	# Local device class
    	class 0x3e0100;
    
    	# 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;
    
    	# 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;
    
    	# Authentication and Encryption (Security Mode 3)
    	#auth enable;
    	#encrypt enable;
    }
    restart the bluetooth services
    Code:
     sudo /etc/init.d/bluez-utils restart
    and now to test the bluetooth:
    Code:
    hcitool scan
    this should return a list of devices like:
    Code:
            00:16:4E:D7:AE:5F       Nokia N70
            00:12:62:AF:C0:6E       Nino
            00:11:67:80:41:96       BT-GPS
    Step 2

    With the bluetooth we need to create a serial connection between our GPS device and the computer

    to do this we first need some information on the device; the MAC code and the serial port.

    do a
    Code:
    hcitool scan
    and take the MAC address of the GPS unit in my case:
    00:16:4E7:AE:5F Nokia N70
    00:12:62:AF:C0:6E Nino
    00:11:67:80:41:96 BT-GPS

    so i want: 00:11:67:80:41:96

    to get the serial port do
    Code:
    sdptool browse 00:11:67:80:41:96
    which will return
    Code:
    Browsing 00:11:67:80:41:96 ...
    Service Name: Bluetooth Serial Port
    Service RecHandle: 0x10007
    Service Class ID List:
      "Serial Port" (0x1101)
    Protocol Descriptor List:
      "L2CAP" (0x0100)
      "RFCOMM" (0x0003)
        Channel: 1
    Language Base Attr List:
      code_ISO639: 0x656e
      encoding:    0x6a
      base_offset: 0x100
    Profile Descriptor List:
      "Serial Port" (0x1101)
        Version: 0x0100
    the channel we want is 1

    now create a file in /etc/bluetooth/ called rfcomm

    Code:
    sudo gedit /etc/bluetooth/rfcomm.conf
    adding an entry:
    Code:
    rfcomm4 {
            bind yes;
            device < GPS MAC ADDRESS>;
            channel 1;
            comment "Serial Port";
            }
    to start using the GPS type:
    Code:
    rfcomm connect 4
    if for some reason you get

    "Can't create RFCOMM TTY: Address already in use"

    do:
    Code:
    sudo rfcomm release 4
    again followed by
    Code:
    rfcomm connect 4
    that should display:

    nino@laptop:~$ rfcomm connect 4
    Connected /dev/rfcomm4 to 00:11:67:80:41:96 on channel 1
    Press CTRL-C for hangup

    any GPS software you are gonna use will make use of the /dev/rfcomm4

    Step 3

    Now to test the GPS install the GPS utils

    Code:
    sudo apt-get install gpsd-clients
    sudo apt-get install gpsd
    the GPSD is the daemon for the GPS reciever so we want to bind the service with the device:

    Code:
    gpsd /dev/rfcomm4
    and finally to see if were getting any information from the GPS device run

    Code:
    xgps


    if you want a tracking program have a looky at gpsdrive




    Enjoy

    Nino
    Last edited by ninocass; April 11th, 2007 at 11:54 AM.
    1. A computer is a machine for rearranging bits
    2. The Internet is a machine for moving bits from one place to another very cheaply and quickly

  2. #2
    Join Date
    Mar 2006
    Beans
    13
    Distro
    Kubuntu 6.10 Edgy

    Re: Using Bluetooth GPS

    I've done everything exactly like the howto, but when i type:

    rfcomm connect 4

    I'm getting this error:

    ruben-desktop:~$ rfcomm connect 4
    syntax error line 3
    Can't find a config entry for rfcomm4


    Can you help me?

  3. #3
    Join Date
    Aug 2006
    Beans
    1

    Re: Using Bluetooth GPS

    When editing the /etc/bluetooth/rfcomm.conf file you have to make sure you enter the information without the < Brackets >

    this is my rfcomm.conf file

    rfcomm4 {
    bind yes;
    device 00:08:1B:12:FA:BB;
    channel 1;
    comment "Serial Port";
    }



    Just on a side note, thanks to ninocass for a fantastic HowTo.

  4. #4
    Join Date
    Jul 2006
    Beans
    6

    Re: Using Bluetooth GPS

    Hi, first thanks for the howto.

    Following it, I manage to have my gps bt listed while scanning:

    Code:
    $> hcitool scan
    Scanning ...
    00:0D:B5:30:47:C3       BT-GPS-3047C3
    But than on the following browse commang I get nothing:
    Code:
    sdptool browse 00:0D:B5:30:47:C3
    Browsing 00:0D:B5:30:47:C3 ...
    I have usually to enter 0000 to pair on my PDA, is that necessary on linux as well?

    Bye!

  5. #5
    Join Date
    Aug 2006
    Beans
    11

    Re: Using Bluetooth GPS

    It failed in this stage

    Code:
    root@ed-laptop:/home/ed# hcitool scan
    Scanning ...
            00:0B:0D:xx:04:xx       HOLUX GPSlim236
    Code:
    root@ed-laptop:/home/ed# sdptool browse 00:0B:0D:xx:04:xx
    Failed to connect to SDP server on 00:0B:0D:xx:04:xx: Connection timed out
    Wondering why?

    I have tried "sdptool browse" with my Nokia N70 and tons of info come out.
    Wondering what was the problem.
    And thanks for the guide!

    REgards

  6. #6
    Join Date
    Aug 2006
    Beans
    11

    Re: Using Bluetooth GPS

    solved the problem
    i typed "sdptool browse" for 2 times
    it just work!

    Regards

  7. #7
    Join Date
    May 2006
    Beans
    85
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Using Bluetooth GPS

    I can get /dev/rfcomm4 up and running but none of the gps software will read any thing. Do you have to worry about baud rates or does gpsd do all that for you? Other wise i might just have crap reception on my gps. Will xgps, just have nothing if it can not see enought satellites? Any how i'm using a ASUS BT-100 if anyone has had any luck.

  8. #8
    Join Date
    Oct 2006
    Location
    European Union
    Beans
    283
    Distro
    Ubuntu Jaunty Jackalope (testing)

    Re: Using Bluetooth GPS

    Everything seems ok, but, like frankuzzo, I manage to have my gps bt listed while scanning, but then on the following browse command I get nothing. It just says
    sdptool browse 00:02:78:0A:4E:E9
    Browsing 00:02:78:0A:4E:E9 ...
    and then I'm back to the prompt.

    What am I doing wrong?
    Retire, miscreants, to your muddy billabongs and forget even passive attempts to educate windozian zombies: how can those of easy virtue, who simply stroll into a store and "buy" programs off the rack, compare to us?

  9. #9
    Join Date
    Oct 2006
    Location
    European Union
    Beans
    283
    Distro
    Ubuntu Jaunty Jackalope (testing)

    Re: Using Bluetooth GPS

    Turns out now it works, despite the fact that the browsing still does not give any answer from the unit.
    For me it works like this

    1) sudo hcitool scan (find unit)
    2) sudo sdptool browse 00:00:00:00:00:00 (whatever it is)
    3) sudo rfcomm release 0 (very important for me)
    4) sudo rfcomm connect 0
    ...connected /dev/rfcomm0 to 00:00:00:00:00:00 (whatever)
    ...Press CTRL-C for hangup

    and then on a separate terminal

    5) sudo gpsd /dev/rfcomm0
    6) sudo xgps

    (of course rfcomm.conf is configured)
    Retire, miscreants, to your muddy billabongs and forget even passive attempts to educate windozian zombies: how can those of easy virtue, who simply stroll into a store and "buy" programs off the rack, compare to us?

  10. #10
    Join Date
    Oct 2006
    Location
    Helsinki, Finland
    Beans
    35
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Using Bluetooth GPS

    You may try using sdptool records instead of browse. It worked for me.

    Well, I still get nothing. xgps says "no data arriving".

    Has anyone had the same problem and found a solution for it?

    EDIT: solved by rebooting the computer
    Last edited by dotsi; February 18th, 2007 at 07:20 PM.

Page 1 of 5 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •