Sponsored links

Go Back   MP3Car.com > Mp3Car Technical > Engine Management, OBD-II, Engine Diagnostics, etc. > OBDII GPS Logger


Reply
 
Share Thread Tools Display Modes
Old 10-15-2009, 11:44 PM   #1
Mod - OBDII GPS Logger forum
 
Join Date: Mar 2009
Location: Los Angeles
Posts: 401
chunkyks is on a distinguished road
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 (-;

Last edited by chunkyks; 10-21-2009 at 11:11 AM.
chunkyks is offline   Reply With Quote
Advertisement
 
Advertisement
Sponsored links

Old 10-16-2009, 12:48 AM   #2
licensed to kill
 
kev000's Avatar
 
Join Date: Aug 2006
Location: Deep in the Rockies... coding in caves
Posts: 1,038
kev000 will become famous soon enough
great job. I'll do this inside LinuxICE to make things easier.

will obdgpslogger automatically create the path to the db?
__________________
LinuxICE - because my car already has enough windows (and because I like speed).
LinuxICE2 beta2 is released!!! get it now!
Follow OpenICE development
kev000 is offline   Reply With Quote
Old 10-16-2009, 12:59 AM   #3
Mod - OBDII GPS Logger forum
 
Join Date: Mar 2009
Location: Los Angeles
Posts: 401
chunkyks is on a distinguished road
Oops, forgot to add a thing about gpsd permissions. Fixed.

Gary (-;
chunkyks is offline   Reply With Quote
Old 10-16-2009, 01:01 AM   #4
Mod - OBDII GPS Logger forum
 
Join Date: Mar 2009
Location: Los Angeles
Posts: 401
chunkyks is on a distinguished road
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 (-;
chunkyks is offline   Reply With Quote
Old 10-17-2009, 01:14 PM   #5
Mod - OBDII GPS Logger forum
 
Join Date: Mar 2009
Location: Los Angeles
Posts: 401
chunkyks is on a distinguished road
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 (-;
chunkyks is offline   Reply With Quote
Old 10-21-2009, 08:58 AM   #6
Admin. Don't bug or I'll byte.
 
Bugbyte's Avatar
 
Join Date: Sep 2004
Location: Corning, NY
Posts: 6,142
Bugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to beholdBugbyte is a splendid one to behold
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?
__________________
Want to:
-Find out about the iBug?
-Stop being a newbie? Take a look at the FAQ Emporium?
-Find out about carPC's in just 5 minutes? View the Car PC 101 video
-Help me kill my car PC
-Watch live video streams from my mobile PC? Check it out here.
-Where is the iBug?
Bugbyte is offline   Reply With Quote
Old 10-21-2009, 11:11 AM   #7
Mod - OBDII GPS Logger forum
 
Join Date: Mar 2009
Location: Los Angeles
Posts: 401
chunkyks is on a distinguished road
It doesn't create /etc/obdgpslogger by default, just create one yourself. [Added that to the top post]

Gary (-;
chunkyks is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting OBDGPSlogger to run on the Sheeva Plug Bugbyte OBDII GPS Logger 31 10-21-2009 02:37 AM
Now with tasty hotplug chunkyks OBDII GPS Logger 7 10-06-2009 11:24 PM
udev rules for scantools kev000 OBDII GPS Logger 0 08-10-2009 11:31 PM



All times are GMT -5. The time now is 08:16 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.2
Copyright © 1999 - 2008 Mp3Car.com Inc.Ad Management by RedTyger
Message Board Statistics