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-04-2009, 01:29 AM   #1
Mod - OBDII GPS Logger forum
 
Join Date: Mar 2009
Location: Los Angeles
Posts: 401
chunkyks is on a distinguished road
Now with tasty hotplug

Bugbyte, this post is mostly for you.

Put a couple small changes into obdgpslogger just now. It'll gracefully deal with it when you plug and unplug the device on a udev system. I've just run obdgpslogger for the first time, totally un-interactively hotplugged.

Build an updated svn checkout of obdgpslogger and "make install" it, on a machine with ftdi kernel module setup [ie, bugbyte's flashed plug, or any regular-flavored linux box]. Shove this in /etc/udev/rules.d/40-ftdiobdgpslogger.rules [or something like it]

Code:
. ACTION=="add", BUS=="usb", SYSFS{idVendor}=="0403", SYSFS{idProduct}=="6001", GROUP:="users", MODE:="0660", RUN+="/usr/local/bin/obdgpslogger -s /dev/%k -d /tmp/cookies.db -b 38400" .

If you have an OBDPro, then skip the "-b 38400" bit. I need to write the autonegotiate code one of these days, but ... baby steps.

It'll create a logfile /tmp/cookies.db. If you want something different, I suggest removing the "-d /tmp/cookies.db" bit altogether, and putting "log_file=/path/to/logfile.db" in /etc/obdgpslogger instead.

Lots of hoodoo. Short version is that now there's one line in each of two files that will let you do basically "Exactly what you want" to make obdgpslogger hotplug. The intended path for the actual users once they've done setup is:

1) plug in usb thumb drive.
2) Plug in obdII dongle
3) Drive wherever you're going
4) unplug OBDII dongle
5) unplug UBD thumb drive

Note the severe lack of "user types in a bunch of stuff" like the current path involves. Thanks again to mp3car for springing me a sheeva that finally galvanised me into making all this stuff work :-D

Gary (-;

Last edited by Enforcer; 10-04-2009 at 02:35 PM.
chunkyks is offline   Reply With Quote
Advertisement
 
Advertisement
Sponsored links

Old 10-04-2009, 02:03 PM   #2
Mod - OBDII GPS Logger forum
 
Join Date: Mar 2009
Location: Los Angeles
Posts: 401
chunkyks is on a distinguished road
I documented how to make obdgpslogger launch automatically on systems with and without the ftdi kernel driver. It's in doc/auto_launch in your updated svn checkout, or here:
doc/auto_launch

Gary (-;
chunkyks is offline   Reply With Quote
Old 10-04-2009, 08:46 PM   #3
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
Outstanding, Gary! I'll try this out as soon as time permits. My main issue is that I have to shlep the stuff out to the car and try to access the plug without a monitor. I think I have to get a WiFi dongle for it first so I can ssh into it when I'm in the car.

I can use an inverter for proof of concept testing until I decide I'm ready to make the 12v mod to it.

Question - I don't suppose the path could be to a server out on the interweb, could it? No, I guess not as it isn't designed for that. I'm just thinking about my long term goal to put the data out on servers where the real processing and storage can take place in real time or near real time like 'record and transmit every 30 seconds' or at some user defined interval.

I guess that gets tricky with connectivity changes and so forth. That may be something more appropriate for some type of 'connection manager' program that handles the interaction with the server. Okay, I'm rambling. I'll stop now.
__________________
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-04-2009, 11:13 PM   #4
Mod - OBDII GPS Logger forum
 
Join Date: Mar 2009
Location: Los Angeles
Posts: 401
chunkyks is on a distinguished road
Quote:
Question - I don't suppose the path could be to a server out on the interweb, could it? No, I guess not as it isn't designed for that. I'm just thinking about my long term goal to put the data out on servers where the real processing and storage can take place in real time or near real time like 'record and transmit every 30 seconds' or at some user defined interval.

I guess that gets tricky with connectivity changes and so forth. That may be something more appropriate for some type of 'connection manager' program that handles the interaction with the server. Okay, I'm rambling. I'll stop now.


No, it can't be. But... I know of at least one person who's trying to implement periodic uploads via internets as part of his university project. I'm not sure how keen I am on doing it myself, but there is a really easy way to make a completely stateless system on the box running obdgpslogger that does what you want. It hinges on CSV rather than actual databases, so the schema stuff won't come through perfectly, but ... really, it's unlikely that'll be a problem. I implemented the CSV stuff you see here to make exactly this task a whole lot easier. Here's what you do:

Write a small program/script that does thus:
1) Take note of current time, call it curr_time.
2) obd2csv anything in the database up to and including the curr_time:
obd2csv --end curr_time --gzip --out /tmp/curr_time.csv.gz
3) Attempt to upload that .csv.gz file to a remote server
3a) If it works, purge the uploaded rows from the database:
DELETE FROM obd WHERE time<=curr_time
DELETE FROM gps WHERE time<=curr_time
3b) If it didn't work, don't purge rows
4) Delete temp csv file.
5) Rinse repeat.

Easy. Stateless. Works as much or as little as you like - whether you attempt upload once a week or once every 30s, it will gracefully deal with it.


I'm actually suffering some udev teething problems right now, when I plug in both gps and OBDII devices and have gpsd running. working on it though!

Gary (-;
chunkyks is offline   Reply With Quote
Old 10-05-2009, 08:44 AM   #5
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
See, that's a great solution! I can manage something like that for sure.

I've been giving quite a bit of thought to what the role of a 'helper' PC like the Sheeva should be in a CloudCar environment and this is the direction I think makes the most sense. I won't clog this thread with my ramblings but I'm thinking of formalizing the project into something that others can understand and contribute to. OBD2gpslogger is definitely part of it.

BTW, the person who is working on this for a project - is he/she on the forums? I know mp3car was interested in working with universities on open source projects that contribute to car pc computing.
__________________
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-05-2009, 08:27 PM   #6
Mod - OBDII GPS Logger forum
 
Join Date: Mar 2009
Location: Los Angeles
Posts: 401
chunkyks is on a distinguished road
I don't think they're currently a forum user.

I will point them towards this thread; I'll leave it up to them to reply with details or stuff.

Gary (-;
chunkyks is offline   Reply With Quote
Old 10-06-2009, 10:07 AM   #7
Newbie
 
Join Date: Oct 2009
Posts: 1
cidus is an unknown quantity at this point
Hey there,

I'm the guy Gary mentioned. My graduation project is a telemetry system for automobiles. I'm using obdgpslogger as the basis as it's very much awesome =) And saves me a lot of work hehe!

I'll basically be developing a client application that does what Gary described and a server application that receives the data and put in a database. Maybe also I'll develop a basic web interface for analysis of the data.

Right now I'm learning the networking programming needed. I think I got the hang of it, I'm sending files between hosts on my local network.

In a week or two I think I'll have a simples prototype =)

BTW, nice forum you guys have here. I'll be coming along to share and ask questions. =)
cidus is offline   Reply With Quote
Old 10-06-2009, 11:24 PM   #8
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
Welcome! I'd love to talk to you about using this as a component of cloud computing. I see the smartphone as the controller to a cloud computing architecture that does more or less what you are working on here - using obdgpslogger to upload engine data and gps data to a compute server on the web.

We should talk about what your project is and whether mp3car can help out with it.
__________________
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
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
New Release 0.4: Now includes tasty GUI chunkyks OBDII GPS Logger 6 04-18-2009 12:08 AM
Tasty midtweeters, you will want to have teh intercourse with them Megalomaniac Car Audio 11 08-14-2007 01:01 PM



All times are GMT -5. The time now is 08:33 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