Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Now with tasty hotplug

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

    Join Date
    Mar 2009
    Location
    Los Angeles
    Posts
    929

    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 (-;
    OBDGPSLogger, for logging OBDII and/or GPS data
    OBDSim, an OBDII/ELM327 software simulator
    mp3car forums: obdgpslogger, obdsim

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

    Join Date
    Mar 2009
    Location
    Los Angeles
    Posts
    929
    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 (-;
    OBDGPSLogger, for logging OBDII and/or GPS data
    OBDSim, an OBDII/ELM327 software simulator
    mp3car forums: obdgpslogger, obdsim

  3. #3
    Admin. Linux loser.
    Auto Apps:loading...
    Bugbyte's Avatar
    Join Date
    Sep 2004
    Location
    Corning, NY
    Posts
    7,364
    Blog Entries
    2
    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.
    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

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

    Join Date
    Mar 2009
    Location
    Los Angeles
    Posts
    929
    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 (-;
    OBDGPSLogger, for logging OBDII and/or GPS data
    OBDSim, an OBDII/ELM327 software simulator
    mp3car forums: obdgpslogger, obdsim

  5. #5
    Admin. Linux loser.
    Auto Apps:loading...
    Bugbyte's Avatar
    Join Date
    Sep 2004
    Location
    Corning, NY
    Posts
    7,364
    Blog Entries
    2
    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.
    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

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

    Join Date
    Mar 2009
    Location
    Los Angeles
    Posts
    929
    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 (-;
    OBDGPSLogger, for logging OBDII and/or GPS data
    OBDSim, an OBDII/ELM327 software simulator
    mp3car forums: obdgpslogger, obdsim

  7. #7
    Newbie
    Join Date
    Oct 2009
    Posts
    3
    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. =)

  8. #8
    Admin. Linux loser.
    Auto Apps:loading...
    Bugbyte's Avatar
    Join Date
    Sep 2004
    Location
    Corning, NY
    Posts
    7,364
    Blog Entries
    2
    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.
    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

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

    Join Date
    Mar 2009
    Location
    Los Angeles
    Posts
    929
    cidus, did you ever progress with this? How's it going?

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

  10. #10
    Newbie
    Join Date
    Oct 2009
    Posts
    3
    Hello guys,

    Sorry for the long delay. After I finished my project in December I got a new job for the government and have been really busy.

    So, I made a client application that runs alongside obdgpslogger and sends data through a socket connection to a server that reads the data and saves it on a PostgreSQL DB. It's really simple, there's not much functionality in it, but it works. =)

    You can check my article here: http://monografias.cic.unb.br/dspace...monografia.pdf

    It is in portuguese, but you can check out the sources as attachments in the end.

Page 1 of 2 12 LastLast

Similar Threads

  1. New Release 0.4: Now includes tasty GUI
    By chunkyks in forum OBDII GPS Logger
    Replies: 6
    Last Post: 04-17-2009, 11:08 PM
  2. Replies: 11
    Last Post: 08-14-2007, 12:01 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
  •