Results 1 to 9 of 9

Thread: Automating GPS device in linux

  1. #1
    Low Bitrate yam125's Avatar
    Join Date
    Oct 2008
    Location
    Tracy, Ca
    Posts
    109

    Automating GPS device in linux

    before i use any gps app i have to run

    Code:
    sudo rfcomm release 4
    
    rfcomm connect 4
    
    gpsd -n /dev/rfcomm4
    what can i do to automate this?

  2. #2
    Low Bitrate
    Join Date
    Mar 2000
    Location
    Northville, MI, USA
    Posts
    65
    Do you have a start script for gpsd? Just add those lines to your start script, and you're done. You can either create a shell script to start gpsd, or better yet, have gpsd start in a boot script.

    Look up info on init scripts. You can usually copy one for a different service, and modify it for your own needs.

    -Chris

  3. #3
    Low Bitrate yam125's Avatar
    Join Date
    Oct 2008
    Location
    Tracy, Ca
    Posts
    109
    is the sudo in the release command going to work?

  4. #4
    Constant Bitrate
    Join Date
    May 2008
    Posts
    223
    Quote Originally Posted by yam125 View Post
    is the sudo in the release command going to work?
    If you're putting those in an init script, it will be run as root anyway and you can remove the "sudo" from that line.

  5. #5
    Low Bitrate yam125's Avatar
    Join Date
    Oct 2008
    Location
    Tracy, Ca
    Posts
    109
    here is my /etc/init.d/gpssamp.sh

    Code:
    #!/bin/sh
    rfcomm release 4
    rfcomm connect 4
    gpsd -n /dev/rfcomm4
    to put it there i used

    Code:
    cd /etc/init.d/
    
    sudo gedit gpssamp.sh
    
    sudo update-rc.d gpssamp.sh defaults
    update-rc.d: warning: /etc/init.d/gpssamp.sh missing LSB style header
     System startup links for /etc/init.d/gpssamp.sh already exist.
    
    sudo chmod +x gpssamp.sh
    works just fine when manually started but wont do it on start

    Code:
     sudo  /etc/init.d/gpssamp.sh
    [sudo] password  : 
    Connected /dev/rfcomm4 to 00:12:0E:80:D8:xx on channel 1
    Press CTRL-C for hangup
    then close terminal(bc i dont have a control key)

    then i can run roadnav and it picks the reciver up

  6. #6
    Low Bitrate yam125's Avatar
    Join Date
    Oct 2008
    Location
    Tracy, Ca
    Posts
    109
    help?

  7. #7
    licensed to kill - FKA kev000
    Auto Apps:loading...
    tripzero's Avatar
    Join Date
    Aug 2006
    Location
    16.40618, 120.61106
    Posts
    2,494
    have a look at /etc/init.d/skeleton for a proper init script. That should give you a base to start from when creating your script.
    Former author of LinuxICE, nghost, nobdy.
    Current author of Automotive Message Broker (AMB).
    Works on Tizen IVI. Does not represent anyone or anything but himself.

  8. #8
    Low Bitrate yam125's Avatar
    Join Date
    Oct 2008
    Location
    Tracy, Ca
    Posts
    109
    the skeleton file looks really scary, after some searching I found a Start up script generator:

    http://rob.pectol.com/content/view/17/33/

    Also can I link to the script file from the sessions (System \ Preferences\ Sessions \ Startup Programs) menu?

  9. #9
    licensed to kill - FKA kev000
    Auto Apps:loading...
    tripzero's Avatar
    Join Date
    Aug 2006
    Location
    16.40618, 120.61106
    Posts
    2,494
    Quote Originally Posted by yam125 View Post
    ...
    Also can I link to the script file from the sessions (System \ Preferences\ Sessions \ Startup Programs) menu?
    yep, that's easy enough
    Former author of LinuxICE, nghost, nobdy.
    Current author of Automotive Message Broker (AMB).
    Works on Tizen IVI. Does not represent anyone or anything but himself.

Similar Threads

  1. Replies: 105
    Last Post: 12-10-2014, 04:41 PM
  2. How to setup iGuidance GPS for RoadRunner
    By MatrixPC in forum RR FAQ
    Replies: 31
    Last Post: 05-22-2009, 09:29 AM
  3. Getting Started with GPS
    By grepzen in forum The FAQ Emporium
    Replies: 12
    Last Post: 09-26-2006, 06:54 AM
  4. GPS device diagnostic
    By lastberserker in forum GPS
    Replies: 12
    Last Post: 05-12-2005, 02:15 PM
  5. Replies: 6
    Last Post: 01-21-2005, 03:12 PM

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
  •