Results 1 to 7 of 7

Thread: On gpsd, obdgpslogger, and udev hotplug

  1. #1
    SuperMod - OBDII GPS Logger forum
    Auto Apps:loading...

    Join Date
    Mar 2009
    Location
    Los Angeles
    Posts
    929

    On gpsd, obdgpslogger, and udev hotplug

    So, finally I have obdgpslogger and gpsd both working with udev hotplug, on ubuntu 9.04

    My USB OBDII devices are FTDI.
    My USB GPS device is pl2303.

    1) Making gpsd work

    a) Copy /lib/udev/rules.d/40-gpsd.rules to /etc/udev/rules.d/40-gpsd.rules
    b) Edit /etc/udev/rules.d/40-gpsd.rules. Comment out the line for idVendor 0403 and idProduct 6001, and modify the two pl2303 lines so that the permissions will let gpsd access it:
    Code:
    # Prolific Technology, Inc. PL2303 Serial Port
    SYSFS{idVendor}=="067b", SYSFS{idProduct}=="2303", SYMLINK="gps%n", MODE:="0666", RUN+="/lib/udev/gpsd.hotplug.wrapper"
    # ATEN International Co., Ltd UC-232A Serial Port [pl2303]
    SYSFS{idVendor}=="0557", SYSFS{idProduct}=="2008", SYMLINK="gps%n", MODE:="0666", RUN+="/lib/udev/gpsd.hotplug.wrapper"
    c) Edit /lib/udev/gpsd.hotplug.wrapper
    Take out the line
    Code:
    . /lib/udev/hotplug.functions
    and put this there instead:
    Code:
    wait_for_file() {
            [ -e "$1" ] && return 0
            local count=0
            while sleep 1; do
                    let count=count+1
                     [ -e "$1" ] && return 0
                    if [ $count -gt 60 ]; then
                            return 1
                    fi
            done
    }
    d) sudo dpkg-reconfigure gpsd
    Launch on boot - yes
    Leave the automatic device list empty
    Should gpsd handle devices automatically - yes
    Options to gpsd: "-F /var/run/gpsd.sock"


    2) Make obdgpslogger hotplug work

    a) Put this in /etc/udev/rules.d/40-ftdi.rules
    Code:
    SUBSYSTEM!="tty", GOTO="ftdi_rules_end"
    ACTION=="add", SYSFS{idVendor}=="0403", SYSFS{idProduct}=="6001", RUN+="/usr/local/bin/obdgpslogger -ms /dev/%k"
    LABEL="ftdi_rules_end"
    b) Configure obdgpslogger to do what you want
    Edit /etc/obdgpslogger [if it doesn't exist, just create it]. Set it to put the logfile in the right place:
    Code:
    log_file=/media/usbthumb/carlog.db
    If you have a device that defaults to 38400 instead of 9600 [eg, an OBDLink], then you also need to put that in the config file:
    Code:
    baudrate=38400
    The obdgpslogger half is covered in a bit more detail in doc/auto_launch in your svn checkout

    Gary (-;
    OBDGPSLogger, for logging OBDII and/or GPS data
    OBDSim, an OBDII/ELM327 software simulator
    mp3car forums: obdgpslogger, obdsim

  2. #2
    licensed to kill - FKA kev000
    Auto Apps:loading...
    tripzero's Avatar
    Join Date
    Aug 2006
    Location
    16.40618, 120.61106
    Posts
    2,560
    great job. I'll do this inside LinuxICE to make things easier.

    will obdgpslogger automatically create the path to the db?
    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.

  3. #3
    SuperMod - OBDII GPS Logger forum
    Auto Apps:loading...

    Join Date
    Mar 2009
    Location
    Los Angeles
    Posts
    929
    Oops, forgot to add a thing about gpsd permissions. Fixed.

    Gary (-;
    OBDGPSLogger, for logging OBDII and/or GPS data
    OBDSim, an OBDII/ELM327 software simulator
    mp3car forums: obdgpslogger, obdsim

  4. #4
    SuperMod - OBDII GPS Logger forum
    Auto Apps:loading...

    Join Date
    Mar 2009
    Location
    Los Angeles
    Posts
    929
    OBDGPSLogger doesn't automatically create a path to the db. The default is "./obdgpslogger.db". If you want it set to something else, that's what the config file /etc/obdgpslogger is for.

    Gary (-;
    OBDGPSLogger, for logging OBDII and/or GPS data
    OBDSim, an OBDII/ELM327 software simulator
    mp3car forums: obdgpslogger, obdsim

  5. #5
    SuperMod - OBDII GPS Logger forum
    Auto Apps:loading...

    Join Date
    Mar 2009
    Location
    Los Angeles
    Posts
    929
    Oh. And if gpsd.hotplug.wrapper doesn't exist on your system at all, try this one:
    Code:
    #! /bin/bash
    # $Id: gpsd.hotplug.wrapper 4669 2008-01-21 15:07:00Z esr $
    
    #debian addition:
    [ ! -r /etc/default/gpsd ] || . /etc/default/gpsd
    [ "$START_DAEMON" = "true" ] || exit 0
    [ "$USBAUTO" = "true" ] || exit 0
    
    
    if [ "$ACTION" == "remove" ] ; then
      if [ $(echo $DEVLINKS | grep -q /dev/gps) ] ; then
        exec /lib/udev/gpsd.hotplug "$ACTION" "$DEVNAME"
      fi
      exit 0
    fi
    
    # . /lib/udev/hotplug.functions
    wait_for_file() {
    	[ -e "$1" ] && return 0
    	local count=0
    	while sleep 1; do
    		let count=count+1
    		 [ -e "$1" ] && return 0
    		if [ $count -gt 60 ]; then
    			return 1
    		fi
    	done
    }
    
    # wait for /usr & /var to be mounted
    wait_for_file /usr/bin/python && \
    wait_for_file /var/run && \
      exec /lib/udev/gpsd.hotplug "$ACTION" "$DEVNAME"
    Gary (-;
    OBDGPSLogger, for logging OBDII and/or GPS data
    OBDSim, an OBDII/ELM327 software simulator
    mp3car forums: obdgpslogger, obdsim

  6. #6
    Admin. Linux loser.
    Auto Apps:loading...
    Bugbyte's Avatar
    Join Date
    Sep 2004
    Location
    Corning, NY
    Posts
    7,364
    Blog Entries
    2
    Configured everything except for the obdgpslogger part. I don't have /etc/obdgpslogger in my directory (step 2b).

    What does that mean? I've never run obdgpslogger before?
    Quote Originally Posted by ghettocruzer View Post
    I was gung ho on building a PC [until] just recently. However, between my new phone having internet and GPS and all...and this kit...Im starting to have trouble justfiying it haha.
    Want to:
    -Find out about the new iBug iPad install?
    -Find out about carPC's in just 5 minutes? View the Car PC 101 video

  7. #7
    SuperMod - OBDII GPS Logger forum
    Auto Apps:loading...

    Join Date
    Mar 2009
    Location
    Los Angeles
    Posts
    929
    It doesn't create /etc/obdgpslogger by default, just create one yourself. [Added that to the top post]

    Gary (-;
    OBDGPSLogger, for logging OBDII and/or GPS data
    OBDSim, an OBDII/ELM327 software simulator
    mp3car forums: obdgpslogger, obdsim

Similar Threads

  1. Now with tasty hotplug
    By chunkyks in forum OBDII GPS Logger
    Replies: 12
    Last Post: 07-09-2010, 10:46 AM
  2. Getting OBDGPSlogger to run on the Sheeva Plug
    By Bugbyte in forum OBDII GPS Logger
    Replies: 32
    Last Post: 04-22-2010, 04:49 PM
  3. udev rules for scantools
    By tripzero in forum OBDII GPS Logger
    Replies: 0
    Last Post: 08-10-2009, 10:31 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
  •