Request: How to set up USB GPS Receiver and gpsd

Discussion in 'Acer Aspire One' started by Rapax, Jan 3, 2009.

  1. Rapax

    Rapax

    Joined:
    Nov 13, 2008
    Messages:
    51
    Likes Received:
    0
    Would really appreciate a quick tutorial on how to do it and what to look for. I had my USB GPS receiver running with a SuSE Laptop years ago, but can't remember how I did it.
     
    Rapax, Jan 3, 2009
    #1
  2. Rapax

    skycat

    Joined:
    Jan 1, 2009
    Messages:
    7
    Likes Received:
    0
    Hi. I set up a bluetooth GPS under linux (fedora) a couple of years back on a Dell D410. I will be fitting up USB GPS in the not to distant future, but until then here's what I remember of how it's done.

    1. Get the bluetooth link to the GPS working.

    1.1 Login as root.
    Code:
    su -
    1.2 Switch on your bluetooth GPS gadget and find its MAC address viz:
    Code:
    hcitool scan
    
    which will show you which bluetooth devices are within earshot:-
    Code:
    Scanning ...
    	00:12:34:56:78:90	Manufacturer & type of your GPS gadget.
    
    Find your GPS device and make a note (copy) of its MAC address. The MAC address is the colon separated hexadecimal number. In my example this is 00:12:34:56:78:90

    1.3 Tell your linux system to make a connection to the GSP whenever the communication port /dev/rfcomm0 is opened by an application.
    Code:
    gedit /etc/bluetooth/rfcomm.conf
    ..and slap in the following lines substituting your GPS's MAC address..
    Code:
    rfcomm0 {
    	# Automatically bind the device at startup
    	bind yes;
    
    	# Bluetooth address of the device
    	device 00:12:34:56:78:90;
    
    	# RFCOMM channel for the connection
    	channel	1;
    
    	# Description of the connection
    	comment "Whatever you'd like as a comment";
    }
    
    1.4 Tell the kernel bluetooth system to read the previously edited file and thereby recognise the GPS.
    Code:
    rfcomm bind all
    NOTE this command should be run by your distro on boot, but somehow later releases of fedora neglect to do so. You might have to add the command to a boot up script. /etc/rc.d/rc.local is a good place.

    1.5 Test your handy work! The following command will open a link to the GPS and then spew what it say on to your screen.
    Code:
    cat /dev/rfcomm0
    You should see something like:
    Code:
    $GPGLL,0000.0000,S,00000.0000,W,194818.428,V,A*42
    
    $GPGSA,A,1,,,,,,,,,,,,,0.0,0.0,0.0*30
    
    $GPGSV,2,1,06,2,,,,4,,,,20,,,,23,,,*79
    
    $GPGSV,2,2,06,25,,,24,27,,,,,,,,,,,*7B
    
    $GPRMC,194818.428,V,0000.0000,S,00000.0000,W,0.00,0.00,030109,,,A*7E
    
    $GPZDA,194818.428,03,01,2009,01,00*5D
    
    Control-C will stop the test.

    2.1 Install the GPS daemon "gpsd".
    Code:
    yum install gpsd
    2.2 Start the GPS daemon
    Code:
    gspd /dev/rfcomm0
    2.3 Test your handywork again
    Code:
    telnet localhost 2947
    show
    
    ..and once again you should see a burst of NEMA style gibberish like:
    Code:
    GPSD,S=1,O=GGA 1231013969.321 0.005 53.711652 -1.868958 216.70 80.00 42.40 ? ? 0.000 ? 160.00 ? 3,W=1
    GPSD,O=GLL 1231013969.321 0.005 53.711652 -1.868958 216.70 80.00 42.40 ? ? 0.000 ? 160.00 ? 3
    GPSD,O=GSA 1231013969.321 0.005 53.711652 -1.868958 216.70 80.00 42.40 ? ? 0.000 ? 160.00 ? 3
    GPSD,Y=GSV 1231013969.321 10:2 51 259 27 1:4 37 196 26 1:7 53 138 34 1:8 25 177 33 1:10 29 293 0 0:13 53 65 0 0:23 26 68 0 0:25 58 97 0 0:27 26 184 25 1:29 11 328 0 0:
    GPSD,O=RMC 1231013969.321 0.005 53.711652 -1.868958 216.70 80.00 42.40 214.7700 0.000 0.000 ? 160.00 ? 3
    GPSD,O=GGA 1231013970.320 0.005 53.711652 -1.868957 216.70 80.00 42.40 ? ? 0.000 ? 160.16 ? 3
    GPSD,O=GLL 1231013970.320 0.005 53.711652 -1.868957 216.70 80.00 42.40 ? ? 0.000 ? 160.16 ? 3
    GPSD,O=GSA 1231013970.320 0.005 53.711652 -1.868957 216.70 80.00 42.40 ? ? 0.000 ? 160.16 ? 3
    
    Afterthought: a USB version of the above should be loads easier as you don't need to do the bluetooth stuff in section 1, just find the name of the USB serial link to the GPS, which will be something like
    /dev/ttyUSB0

    Anyway, there you go. As easy as wetting the bed but with none of the inconvenience. Have fun.
     
    skycat, Jan 3, 2009
    #2
  3. Rapax

    Rapax

    Joined:
    Nov 13, 2008
    Messages:
    51
    Likes Received:
    0
    All I get is:

    GPSD, S=?,O=?,W=1

    Btw, you'll need to install telnet first. The AAO apparently doens't have it by default.
     
    Rapax, Jan 3, 2009
    #3
  4. Rapax

    skycat

    Joined:
    Jan 1, 2009
    Messages:
    7
    Likes Received:
    0
    Hmm.. sounds like gpsd can't open the the right USB serial link. What does
    Code:
    lsusb
    show? Also what does
    Code:
    find /dev -name 'ttyUSB*'
    give when the GPS is both plugged in and not plugged in? The correct port will only be there when the GPS is plugged in.
     
    skycat, Jan 4, 2009
    #4
  5. Rapax

    Rapax

    Joined:
    Nov 13, 2008
    Messages:
    51
    Likes Received:
    0
    Here's some info:

    With GPS plugged in
    dmesg:
    Code:
    usb 2-1: new full speed USB device using uhci_hcd and address 26
    usb 2-1: configuration #1 chosen from 1 choice
    
    lsusb:
    Code:
    Bus 001 Device 003: ID 0c45:62c0 Acer Crystal Eye Webcam
    Bus 001 Device 001: ID 0000:0000  
    Bus 005 Device 001: ID 0000:0000  
    Bus 004 Device 001: ID 0000:0000  
    Bus 003 Device 001: ID 0000:0000  
    Bus 002 Device 026: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
    Bus 002 Device 025: ID 09da:0006 A4 Tech Co., Ltd Optical Mouse WOP-35 / Trust 450L Optical Mouse
    Bus 002 Device 001: ID 0000:0000
    find /dev -name 'ttyUSB*'
    Code:
    dev/ttyUSB0
    
    After removing GPS
    dmesg:
    Code:
    usb 2-1: USB disconnect, address 26
    
    lsusb:
    Code:
    Bus 001 Device 003: ID 0c45:62c0 Acer Crystal Eye Webcam
    Bus 001 Device 001: ID 0000:0000  
    Bus 005 Device 001: ID 0000:0000  
    Bus 004 Device 001: ID 0000:0000  
    Bus 003 Device 001: ID 0000:0000  
    Bus 002 Device 025: ID 09da:0006 A4 Tech Co., Ltd Optical Mouse WOP-35 / Trust 450L Optical Mouse
    Bus 002 Device 001: ID 0000:0000 
    -----

    Seems like that 'Bus 002 Device 026: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port' is it. And there is only one ttyUSB, so that can't be the wrong one either.
    Any ideas?
     
    Rapax, Jan 4, 2009
    #5
  6. Rapax

    skycat

    Joined:
    Jan 1, 2009
    Messages:
    7
    Likes Received:
    0
    Aw! I can't help but feel I'm the blind leading the blind. I am truly sorry for my stupidity. I'd still like to help and I wonder what happens if. as root, you ask
    Code:
    cat /dev/ttyUSB?
    Is there a /dev/ttyUSB* device created by linux when you plug your GPS device in? That was what I hoped to discover with the shell command:- find .dev. -name 'ttyUSB*'.

    The fact that your GPS shows up in the command lsusb is good. I wonder if the /dev/ttyUSB* device is being created when you plug the GPS stick in?

    Let me know what you find. Good luck.
     
    skycat, Jan 5, 2009
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.