Announcement

Collapse
No announcement yet.

How-To: Ubuntu 9.04: build, configure, and run

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

  • How-To: Ubuntu 9.04: build, configure, and run

    Here's what I did starting from a default base Ubuntu 9.04 install on my laptop to make this a functional piece of software.

    I started with the obdgpslogger-0.5.tar.gz file that I downloaded on Saturday June 6 2009 at 09:42 am. There have been updates to the source code repository since then, so YMMV.

    You will almost certainly want to check out the latest version from the svn repository regardless of which tar.gz file you download - updates are constantly being made.

    edit: updated the attached file. (04)
    edit: updated the attached file - more clarifications. (05)
    edit: added complete udev device setup instructions. (06)
    edit: fixed typos and updated udev rules. (07)
    Attached Files

  • #2
    That's fantastic stuff, thank-you!

    A couple things that might make your life easier:
    OBD reported NO DATA for cmd 10: NO DATA
    That would have led to you not getting any data logged at all, a problem that has since been resolved in svn.

    Set the OBDII USB (FTDI) device to the appropriate /dev/ttyUSB* device
    Set the GPS device to the appropriate /dev/ttyUSB* or /dev/rfcomm* device
    Those can be configured permanantly in one of two ways:
    1) At compile-time, by modifying OBD_DEFAULT_SERIALPORT and OBD_DEFAULT_GPSPORT. Instead of running "cmake ..", run "ccmake .." and it'll present you a UI through which you can change options
    2) In the svn version, you can configure it after compile-time by editing ~/.obdgpslogger and adding the lines
    Code:
    obddevice={full path to your obd device}
    gpsdevice={full path to your gps device}
    Thank-you very much!
    Gary (-;
    OBDGPSLogger, for logging OBDII and/or GPS data
    OBDSim, an OBDII/ELM327 software simulator
    mp3car forums: obdgpslogger, obdsim

    Comment


    • #3
      Thanks for the tweaks, I'll add it to my howto

      Originally posted by chunkyks View Post
      That's fantastic stuff, thank-you!

      A couple things that might make your life easier:

      That would have led to you not getting any data logged at all, a problem that has since been resolved in svn.



      Those can be configured permanantly in one of two ways:
      1) At compile-time, by modifying OBD_DEFAULT_SERIALPORT and OBD_DEFAULT_GPSPORT. Instead of running "cmake ..", run "ccmake .." and it'll present you a UI through which you can change options
      2) In the svn version, you can configure it after compile-time by editing ~/.obdgpslogger and adding the lines
      Code:
      obddevice={full path to your obd device}
      gpsdevice={full path to your gps device}
      Thank-you very much!
      Gary (-;
      When I retrieved the latest subversion source, I was getting seg. faults:
      $ ./obdgpslogger -t -s /dev/ttyUSB0
      Segmentation fault (core dumped)
      $ gdb ./obdgpslogger ./core
      (gdb) backtrace
      #0 0xb7e87ebd in fclose () from /lib/tls/i686/cmov/libc.so.6
      #1 0x080b44b4 in obd_loadConfig ()
      #2 0x0804d60a in main ()
      (gdb)

      I tracked this down to my not having a config file (~/.obdgpslogger).

      If I can make a suggestion for a patch in obdconfigfile.c - can't close a file stream that doesn't exist:

      change lines 91-95:
      Code:
      	if(NULL != f) {
      		obd_parseConfig(f,c);
      	}
      
      	fclose(f);
      to
      Code:
      	if(NULL != f) {
      		obd_parseConfig(f,c);
      		fclose(f);
      	}
      Thanks again for your info!

      Comment


      • #4
        Thanks! Committed to svn.

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

        Comment


        • #5
          smokeybreeze, you can control the usb device name assigned to usb devices using udev - so that you don't have to care what order they are plugged in.

          I thought I had wikid this somewhere but can't find it. If you google for udev rules you'll find lots of info on how to add your own udev rule files in /etc/udev/rules.d for each device you want a fixed serial port name for (as well as do things like run scripts on insertion and removal).

          For example a made a rule to give memory cards for my gopro hero camera the fixed name of /dev/hero and runs a script to archive the pictures/video when I insert it.

          Code:
          # rule to match Sandisk memory card used by gopro hero camera
          KERNEL=="sd*1", BUS=="usb", SUBSYSTEMS=="scsi", DRIVERS=="sd", ATTRS{model}=="SDDR-113", ATTRS{vendor}=="SanDisk", SYMLINK+="hero"  RUN+="/home/cgalpin/bin/hero_copy.sh %k"

          Comment


          • #6
            thanks cgalpin, I'll be adding the udev options to the howto in the near future - didn't include them in the initial rev due to the added complexity. I wanted the shortest path in the initial howto publication.

            Comment


            • #7
              newly updated how-to file with complete udev configuration.

              Comment


              • #8
                That's great and very helpful, thank-you!

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

                Comment


                • #9
                  Excellent!

                  First, please consider putting this on http://wiki.openice.org since it would be easier for people to find and take advantage of it, but also allow others to contribute over time. This post will be much harder for people to find.

                  Second, a couple questions about it

                  1. Can you explain why your rule must come after the gpsd rules? I was thinking if anything you'd want your rule to run first (although I can't give you a specific reason why )
                  2. Is there a specific reason you run /lib/udev/gpsd.hotplug.wrapper in your rule? It shouldn't be needed for either since the gpsd udev rules do it for the gps, and it shouldn't affect the obdpro. You should be able to omit the RUN+= on both imo

                  hth
                  charles

                  Comment


                  • #10
                    Originally posted by cgalpin View Post
                    Excellent!

                    First, please consider putting this on http://wiki.openice.org since it would be easier for people to find and take advantage of it, but also allow others to contribute over time. This post will be much harder for people to find.

                    Second, a couple questions about it

                    1. Can you explain why your rule must come after the gpsd rules? I was thinking if anything you'd want your rule to run first (although I can't give you a specific reason why )
                    2. Is there a specific reason you run /lib/udev/gpsd.hotplug.wrapper in your rule? It shouldn't be needed for either since the gpsd udev rules do it for the gps, and it shouldn't affect the obdpro. You should be able to omit the RUN+= on both imo

                    hth
                    charles
                    I thought it should come before the gpsd rules also, but that didn't work for me. If my udev rules came before the gpsd rules, I found something such as the following resulted:

                    /dev/gps -> usbdev3.5_ep00
                    /dev/gps0 -> ttyUSB0
                    /dev/obd -> usbdev3.6_ep00
                    /dev/gps1 -> ttyUSB1

                    This meant that /dev/[gps,obd] were invalid serial devices, and gps0 would become gps1 if it were symlinked to ttyUSB1. Placing the udev rules after the gpsd rules solved these issues for me. I haven't researched this further yet.

                    As for the hotplug wrapper RUN rule, I included it out of benign ignorance. I have since tested the udev rules and found it to have no effect - I have eliminated it from the current how-to.

                    Thanks for the comments. I've updated the how-to and re-uploaded it.

                    Comment


                    • #11
                      smokeybreeze: So is it all working for you now? Post screenshots and/or kml files! :-)

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

                      Comment


                      • #12
                        Originally posted by chunkyks View Post
                        smokeybreeze: So is it all working for you now? Post screenshots and/or kml files! :-)

                        Gary (-;
                        Here's an RPM/Position shot from a recent errand. My VAG-Com software also tells me that module 10 isn't available, so I need to figure out a way to calculate mpg without MAF sensor data. My VAG-Com software can, so I need to spend more time looking into this.

                        Comment


                        • #13
                          Cool! Good to see stuff working :-D

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

                          Comment


                          • #14
                            Hi!

                            This looks promising. I'll be trying it a matter of minutes.

                            Wish me luck!
                            My project: double indash, Golf IV
                            http://www.mp3car.com/vbulletin/showthread.php?p=841754

                            Comment

                            Working...
                            X