Announcement

Collapse
No announcement yet.

Automating GPS device in linux

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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?
    My Install: 2001 WJ Jeep Grand Cherokee (Ubuntu Mobile, Angel Eyes, Flowmaster 40)

  • #2
    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

    Comment


    • #3
      is the sudo in the release command going to work?
      My Install: 2001 WJ Jeep Grand Cherokee (Ubuntu Mobile, Angel Eyes, Flowmaster 40)

      Comment


      • #4
        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.

        Comment


        • #5
          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
          My Install: 2001 WJ Jeep Grand Cherokee (Ubuntu Mobile, Angel Eyes, Flowmaster 40)

          Comment


          • #6
            help?
            My Install: 2001 WJ Jeep Grand Cherokee (Ubuntu Mobile, Angel Eyes, Flowmaster 40)

            Comment


            • #7
              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.

              Comment


              • #8
                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?
                My Install: 2001 WJ Jeep Grand Cherokee (Ubuntu Mobile, Angel Eyes, Flowmaster 40)

                Comment


                • #9
                  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.

                  Comment

                  Working...
                  X