GPS povezivanje/Ubuntu

Izvor: HrOpenWiki
Skoči na: orijentacija, traži

and now to test the bluetooth:

hcitool scan

this should return a list of devices like:

       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

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

sdptool browse 00:11:67:80:41:96

which will return

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

sudo gedit /etc/bluetooth/rfcomm.conf

adding an entry:

rfcomm4 {
       bind yes;
       device < GPS MAC ADDRESS>;
       channel 1;
       comment "Serial Port";

to start using the GPS type:

rfcomm connect 4

if for some reason you get

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


sudo rfcomm release 4

again followed by

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

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:

gpsd /dev/rfcomm4

and finally to see if were getting any information from the GPS device run