WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Howto Tangogps with bluetooth-gps  (Read 3174 times)

Offline Onyarian

  • Sr. Member
  • ****
  • Posts: 336
Howto Tangogps with bluetooth-gps
« on: February 03, 2011, 12:12:12 PM »
Preparation:

** Find the mac of the bt-gps:
         load bluez.tcz
         put your bt-usb
         activate the bt-gps
         go to System Tools - Services and activate bluez

in a terminal:
Quote
tc@box:~$ hciconfig -a
hci0:   Type: BR/EDR  Bus: USB
        BD Address: xx:09:xx:50:xx:80  ACL MTU: 310:10  SCO MTU: 64:8
        UP RUNNING PSCAN
        RX bytes:693 acl:0 sco:0 events:23 errors:0
        TX bytes:340 acl:0 sco:0 commands:21 errors:0
        Features: 0xff 0xff 0x8f 0xfe 0x9b 0xf9 0x00 0x80
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
        Link policy: RSWITCH HOLD SNIFF PARK
        Link mode: SLAVE ACCEPT
        Name: 'box'
        Class: 0xXXXXXX
        Service Classes: Capturing, Telephony
        Device Class: Computer, Uncategorized
        HCI Version: 2.0 (0x3)  Revision: 0xc5c
        LMP Version: 2.0 (0x3)  Subversion: 0xc5c
        Manufacturer: Cambridge Silicon Radio (10)

and write in a paper the "Class: 0xXXXXXX"

Quote
tc@box:~$ sudo hciconfig hci0 up
tc@box:~$ hcitool scan
Scanning ...
        11:YY:33:YY:57:YY       BT-GPS


and write in a paper 11:YY:33:YY:57:YY


** create this three files:

create as root the file /usr/local/etc/bluetooth/hcid.conf
Quote
#
# HCI daemon configuration file.
#
# $Id: hcid.conf,v 1.4 2004/04/29 20:14:21 holtmann Exp $
#

# 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;

        # PIN helper
        # pin_helper /usr/local/bin/bluepincat;
        pin_helper /usr/local/etc/bluetooth/PIN;

        # D-Bus PIN helper
        # dbus_pin_helper;
}

# Default settings for HCI devices
device {
        # Local device name
        #   %d - device id
        #   %h - host name
        # name "ipaq";
        name "BlueZ %h (%d)";

        # Local device class
        class 0xZZZZZZ;

        # 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;
        #
        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 hold,sniff;
        #
        lp rswitch,hold,sniff,park;

        # Authentication and Encryption
        auth enable;
        encrypt enable;
}

in the line:        class 0xZZZZZZ;          put your    0xXXXXXX       from "Class: 0xXXXXXX"
important is the line:         pin_helper /usr/local/etc/bluetooth/PIN;

create as root the file /usr/local/etc/bluetooth/PIN
Quote
0000

this is normally the PIN of the bt-gps (4 zeros)

create as root the file /usr/local/etc/bluetooth/rfcomm.conf
Quote
#
# RFCOMM configuration file.
#

rfcomm0 {
   # Automatically bind the device at startup
   bind yes;

   # Bluetooth address of the device
   device xx:xx:xx:xx:xx:xx;

   # RFCOMM channel for the connection
   channel   1;

   # Description of the connection
   comment "BT GPS";
}

in the line:          device xx:xx:xx:xx:xx:xx;       put your       11:YY:33:YY:57:YY   from the   BT-GPS


**put in the file /opt/.filetool.lst  this three lines:

Quote
usr/local/etc/bluetooth/hcid.conf
usr/local/etc/bluetooth/PIN
usr/local/etc/bluetooth/rfcomm.conf

** reboot your PC

         load tangogps.tcz
         put your bt-usb
         activate the bt-gps
         go to System Tools - Services and activate bluez
         load gpsd.tcz

in a terminal:
Quote
tc@box:~$ sudo hciconfig hci0 up
tc@box:~$ sudo rfcomm bind rfcomm0
tc@box:~$ sudo gpsd /dev/rfcomm0 -F /var/run/gpsd.sock -P /var/run/gpsd.pi

and finally execute tangogps with his wbar icon

now you can see in the map your position and other information.


to see if all goes ok before execute tangogps you can see in a terminal:
Quote
tc@box:~$ cat /dev/rfcomm0
  Nh)@Ë`P±%I Q²1@Ð %ÑÈî?Lq ç'ÞmÁ¹Ã#D^°
$SkyTraq,Venus6
$Kernel,v1.4.8,0000067E,19322105,I,16.367667MHz
$ver,010822,rev,081023
$GPGGA,195526.999,4159.7036,N,00250.0672,E,0,00,0.0,247.4,M,0.0,M,,0000*62
$GPGSA,A,1,,,,,,,,,,,,,0.0,0.0,0.0*30
$GPGSV,3,1,12,26,75,002,,28,54,079,,05,46,193,,15,38,304,*7D
$GPGSV,3,2,12,27,35,260,,08,34,053,,09,14,253,,10,10,162,*78
$GPGSV,3,3,12,21,08,297,,17,05,125,,07,04,063,,18,02,324,*70
$GPRMC,195526.999,V,4159.7036,N,00250.0672,E,000.0,000.0,030211,,,N*7D
$GPVTG,000.0,T,,M,000.0,N,000.0,K,N*02
$GPGGA,195527.999,4159.7036,N,00250.0672,E,0,00,0.0,247.4,M,0.0,M,,0000*63
$GPGSA,A,1,,,,,,,,,,,,,0.0,0.0,0.0*30
$GPGSV,3,1,12,26,75,002,,28,54,079,,05,46,193,,15,38,304,*7D
$GPGSV,3,2,12,27,35,260,,08,34,053,,09,14,253,,10,10,162,*78
$GPGSV,3,3,12,21,08,297,,17,05,125,,07,04,063,,18,02,324,*70
$GPRMC,195527.999,V,4159.7036,N,00250.0672,E,000.0,000.0,030211,,,N*7C
$GPVTG,000.0,T,,M,000.0,N,000.0,K,N*02
$GPGGA,195528.999,4159.7036,N,00250.0672,E,0,00,0.0,247.4,M,0.0,M,,0000*6C
...

stop with ctrl-Z


Hope it helps somebody  :)

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 11063
Re: Howto Tangogps with bluetooth-gps
« Reply #1 on: February 03, 2011, 09:40:00 PM »
Impressive  :)

Offline ^thehatsrule^

  • Administrator
  • Hero Member
  • *****
  • Posts: 1726
Re: Howto Tangogps with bluetooth-gps
« Reply #2 on: February 06, 2011, 04:43:22 PM »
Quote
stop with ctrl-Z
Did you mean ctrl C?

Offline Onyarian

  • Sr. Member
  • ****
  • Posts: 336
Re: Howto Tangogps with bluetooth-gps
« Reply #3 on: February 07, 2011, 08:04:16 AM »
Quote
Did you mean ctrl C?

Well, you can use both, the difference is that with ctrl-z only stops the output of information, when you repeat the command you see more of the transmitted information , and so you can control when it makes the connection to the satellites, terminating the connection with the BT-GPS when you close the window. And ctrl-c simply breaks the connection with BT-GPS directly.


ctrl-Z
Quote
tc@box:~$ cat /dev/rfcomm0
 ¡Nx)@L       $`P±%I Q2±@Ð eÑÈî;Lqš§'ÞeŹÃ#D^°žŸnÉÈ¢`ÝEç ªi¯×øp÷5CDÄ"á`rÐ6F
         PÔõÈm0`Agð

$SkyTraq,Venus6

$Kernel,v1.4.8,0000067E,19322105,I,16.367667MHz

$ver,010822,rev,081023

$GPGGA,151737.999,4210.8896,N,00300.5836,E,0,00,0.0,82.9,M,0.0,M,,0000*52

$GPGSA,A,1,,,,,,,,,,,,,0.0,0.0,0.0*30

$GPGSV,3,1,12,13,72,028,,04,63,249,,10,50,305,,07,45,163,*7B

$GPGSV,3,2,12,23,39,054,,02,39,302,,20,21,107,,08,18,183,*74

$GPGSV,3,3,12,16,06,057,,05,05,295,,30,04,041,,17,00,210,*70

$GPRMC,151737.999,V,4210.8896,N,00300.5836,E,000.0,000.0,070211,,,N*7F

$GPVTG,000.0,T,,M,000.0,N,000.0,K,N*02

^Z[1]+  Stopped                    cat /dev/rfcomm0

tc@box:~$  cat /dev/rfcomm0
$GPGSV,3,3,13,16,06,054,,05,05,296,,30,04,041,,17,00,211,*70

$GPRMC,151737.999,V,4210.8896,N,00300.5836,E,000.0,000.0,070211,,,N*7F

$GPVTG,000.0,T,,M,110.0,N,011.0,K,N*02

^Z[2]+  Stopped                    cat /dev/rfcomm0
tc@box:~$


ctrl-C
Quote
tc@box:~$ cat /dev/rfcomm0
  ¡Nx)@
        Ë`P±%I Q²±@Ð %ÑHõ

$SkyTraq,Venus6

$Kernel,v1.4.8,0000067E,19322105,I,16.367667MHz

$ver,010822,rev,081023

$GPGGA,151902.999,4210.8896,N,00300.5836,E,0,00,0.0,82.9,M,0.0,M,,0000*5A

$GPGSA,A,1,,,,,,,,,,,,,0.0,0.0,0.0*30

$GPGSV,3,1,12,13,72,029,,04,62,248,,10,50,306,,07,46,163,*7A

$GPGSV,3,2,12,02,39,302,,23,38,054,,20,21,108,,08,19,183,*7B

$GPGSV,3,3,12,16,06,056,,05,06,295,,30,04,040,,17,00,210,*73

$GPRMC,151902.999,V,4210.8896,N,00300.5836,E,000.0,000.0,070211,,,N*77

$GPVTG,000.0,T,,M,000.0,N,000.0,K,N*02

^C
tc@box:~$

Offline ^thehatsrule^

  • Administrator
  • Hero Member
  • *****
  • Posts: 1726
Re: Howto Tangogps with bluetooth-gps
« Reply #4 on: February 13, 2011, 12:47:12 PM »
C is for sigint.. Z is for backgrounding and you can resume running with `fg`