<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent posts to Discussion</title><link>https://sourceforge.net/p/pobd-logger/discussion/</link><description>Recent posts to Discussion</description><atom:link href="https://sourceforge.net/p/pobd-logger/discussion/feed.rss" rel="self"/><language>en</language><lastBuildDate>Wed, 15 Aug 2018 06:33:19 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/pobd-logger/discussion/feed.rss" rel="self" type="application/rss+xml"/><item><title>Automatic shutdown</title><link>https://sourceforge.net/p/pobd-logger/discussion/pobd-logger-users/thread/b87718b7/?limit=25#d1a0</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Hi David,&lt;/p&gt;
&lt;p&gt;Here is a quick and dirty patch to the &lt;code&gt;pobd_logger&lt;/code&gt; script to address your specific problem. I have included the context diff inline below, and also as an attachment should the inline version get mangled. The changes are simple enough that you could just make the changes manually using your favorite editor, or you could also use the &lt;code&gt;patch&lt;/code&gt; utility if you are familiar with that.&lt;/p&gt;
&lt;p&gt;(Anyone else following this thread should ignore this patch!)&lt;/p&gt;
&lt;p&gt;If you are lazy, the only important change is to the "if" statement on line #3850 (the changes to lines #1282 and #3854 just modify the information printed to the screen to be consistent with what the modified program will do).&lt;/p&gt;
&lt;p&gt;Be sure to enable the &lt;code&gt;TERMINATE&lt;/code&gt; feature in your config. The 0x10 PID should work based on your previous message.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="gd"&gt;--- pobd_logger.orig    2016-03-04 10:53:18.403425400 -0800&lt;/span&gt;
&lt;span class="gi"&gt;+++ pobd_logger 2018-08-14 23:15:35.854085581 -0700&lt;/span&gt;
&lt;span class="gu"&gt;@@ -1279,7 +1279,7 @@&lt;/span&gt;
         }
         # in verbose mode, announce that the termination condition is enabled
         if ($verbose) {
&lt;span class="gd"&gt;-          printf STDOUT "Auto termination enabled (NO DATA from PID 0x%02x %d consecutive times)\n", $opt_no_data_pid, $opt_no_data_count;&lt;/span&gt;
&lt;span class="gi"&gt;+          printf STDOUT "Auto termination enabled (CAN ERROR from PID 0x%02x %d consecutive times)\n", $opt_no_data_pid, $opt_no_data_count;&lt;/span&gt;
         }
         # toggle the termination command enabled flag
         $opt_no_data = 1;
&lt;span class="gu"&gt;@@ -3847,11 +3847,11 @@&lt;/span&gt;
       # check if the last PID is the one we are instructed to "watch"
       if (($last_pid == $opt_no_data_pid) || ($opt_no_data_pid eq 'any')) {
         # check if the last response for the PID was the "NO DATA" error msg
&lt;span class="gd"&gt;-        if ((!$last_pid_valid) &amp;amp;&amp;amp; ($last_hex_chars eq "NO DATA")) {&lt;/span&gt;
&lt;span class="gi"&gt;+        if ((!$last_pid_valid) &amp;amp;&amp;amp; ($last_hex_chars eq "CAN ERROR")) {&lt;/span&gt;
           # terminate if we have exceeded the user's specified count
           if (++$no_data_count &amp;gt;= $opt_no_data_count) {
             if ($verbose) {
&lt;span class="gd"&gt;-              printf STDOUT "Automatic exit: $opt_no_data_count consecutive NO DATA messages were received for PID 0x%02x\n", $opt_no_data_pid;&lt;/span&gt;
&lt;span class="gi"&gt;+              printf STDOUT "Automatic exit: $opt_no_data_count consecutive CAN ERROR messages were received for PID 0x%02x\n", $opt_no_data_pid;&lt;/span&gt;
             }
             # that's all folks!
             cleanup_exit($EXIT_NORMAL);
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Johnny</dc:creator><pubDate>Wed, 15 Aug 2018 06:33:19 -0000</pubDate><guid>https://sourceforge.net0108ce13826bf9e2a9ec026255e7befef456efdd</guid></item><item><title>Automatic shutdown</title><link>https://sourceforge.net/p/pobd-logger/discussion/pobd-logger-users/thread/b87718b7/?limit=25#82cc</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Hi David,&lt;/p&gt;
&lt;p&gt;You probably know that you can terminate pobd_logger by pressing CTRL+C. This is not a problem when running on a laptop, but on a headless system like the Raspberry Pi, this obviously isn't an option. (I'm am just guessing that you are referring to running on the RPi since you mentioned the &lt;code&gt;pobd_logger_stderr.log&lt;/code&gt; file).&lt;/p&gt;
&lt;p&gt;Getting pobd_logger to terminate by itself on the Rasperry Pi when the engine is turned off was a tricky problem that took a bit of doing. The current mechanism isn't perfect but worked on the handful of vehicles I tried it on. &lt;/p&gt;
&lt;p&gt;The code fragment in pobd_logger that implements the &lt;code&gt;TERMINATE&lt;/code&gt; command (documented in the &lt;code&gt;pobd_logger.cfg&lt;/code&gt; configuration file) currently just checks for a &lt;code&gt;"NO DATA"&lt;/code&gt; response, so it is no surprise that it doesn't terminate on its own for you.&lt;/p&gt;
&lt;p&gt;Fixing the code to allow for repeated &lt;code&gt;"CAN ERROR"&lt;/code&gt; messages instead shouldn't be too hard. I will try to post a quick fix for this in the next day or two, and then try to formulate something a bit more flexible for a future release.&lt;/p&gt;
&lt;p&gt;Congratulations on getting it (mostly) working on the RPi!&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Johnny</dc:creator><pubDate>Tue, 14 Aug 2018 06:43:38 -0000</pubDate><guid>https://sourceforge.net0c10747c12bbe888ff51f774a2736d1ba86bbcfd</guid></item><item><title>Automatic shutdown</title><link>https://sourceforge.net/p/pobd-logger/discussion/pobd-logger-users/thread/b87718b7/?limit=25#e9fb</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;When I turn off the engine, I currently get the following in the pobd_logger_stderr.log:&lt;br/&gt;
WARN: ELM error: mode 0x01 pid 0x10: CAN ERROR&lt;br/&gt;
It appears pobd_logger is still seeing what it considers "data" instead of no response from the pid query&lt;br/&gt;
Is there any way I can change the config or pobd_logger itself to terminate when it sees the CAN ERROR?&lt;br/&gt;
Thanks&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">David Cooley</dc:creator><pubDate>Thu, 09 Aug 2018 18:43:59 -0000</pubDate><guid>https://sourceforge.net8d785c9caed452868c52aa7342d28723fc0ae5e5</guid></item><item><title>Enhanced PID's</title><link>https://sourceforge.net/p/pobd-logger/discussion/pobd-logger-users/thread/35309e9f/?limit=25#f2db</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Hi David,&lt;/p&gt;
&lt;p&gt;Thanks for posting to the list. I get questions by email from time to time, but the user community does not get the benefit of the answers in those situations. So, I encourage user's with questions to post them here when possible.&lt;/p&gt;
&lt;p&gt;As far as logging Parameter IDs with a mode other than 0x01, the code isn't currently designed to do that. In principle, that is certainly possible, but it would involve quite a bit of work to implement. The main complication is that each mode/PID combination returns information in a different format that the programmer needs to know about up front, and design the code accordingly to decode it correctly to get the desired information.&lt;/p&gt;
&lt;p&gt;For example, Mode 0x01 PID 0x0F (intake air temp) returns a single 8 bit byte encoded as (Temp - 40) Celsius. Whereas, Mode 0x01 PID 0x24 (oxygen sensor 1) returns four 8 bit bytes with a more complicated encoding that produces two physical quantities - a voltage and short term fuel trim. For the standard mode 0x01 PIDs, these issues are not so hard to deal with as the required documentation is readily available on places like Wikipedia. Beyond that, just getting the requisite documentation is a huge hurdle in itself (e.g. not available at all, a trade secret, or only available under license at high cost).&lt;/p&gt;
&lt;p&gt;I have given some thought as to how to approach this issue from a programming perspective. What makes the most sense is to use Perl's object oriented features, class inheritance in particular. For example, a base "decoder" class to implement decoding of standard Mode 0x01 PIDs. Then a Pontiac (pick your manufacturer) "decoder" class that inherits all the methods of the base class, overloads those methods with specific "quirks", and implements new methods for PIDs specific to that manufacturer. This at least helps keep the code tidy, readable and maintainable if the required information is available.&lt;/p&gt;
&lt;p&gt;Anyhow, sorry I wasn't able to provide a more encouraging answer. It is what it is...&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Johnny</dc:creator><pubDate>Tue, 10 Jul 2018 00:32:14 -0000</pubDate><guid>https://sourceforge.net0d2de8b0fb9a0d4c24737b69dbf8def9e3a21ee6</guid></item><item><title>Enhanced PID's</title><link>https://sourceforge.net/p/pobd-logger/discussion/pobd-logger-users/thread/35309e9f/?limit=25#9bdf</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Is it possible to change the Mode used for the PID's?  Standard PID's are mode 01, but I have a few Mode 22 PID's I want to log for my 2006 pontiac GTO&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">David Cooley</dc:creator><pubDate>Sun, 08 Jul 2018 04:34:17 -0000</pubDate><guid>https://sourceforge.net500fb013ae402532c792e635ba81c33eb0d27c6c</guid></item><item><title>Raspberry Pi based OBD-II logger "appliance"</title><link>https://sourceforge.net/p/pobd-logger/discussion/pobd-logger-users/thread/3ee3dc7c/</link><description/><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Johnny</dc:creator><pubDate>Tue, 13 Oct 2015 06:02:55 -0000</pubDate><guid>https://sourceforge.net0bc1757900e5f5079b55816af641a38ca0255ad3</guid></item><item><title>The advantages of scantools with a USB interface</title><link>https://sourceforge.net/p/pobd-logger/discussion/pobd-logger-users/thread/4728a853/</link><description>&lt;div class="markdown_content"&gt;&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;My first scantool had a USB physical layer, mostly because the Bluetooth based units were not yet widely available at the time.  I have noticed that many of my friends who are otherwise knowledgeable about OBD-II are unaware of some of the advantageous features of USB scantools that I have came to appreciate by using them. This has motivated me to put together this post.&lt;/p&gt;
&lt;h2 id="disadvantages-of-usb-scantools"&gt;Disadvantages of USB Scantools&lt;/h2&gt;
&lt;p&gt;To be fair to those who are critical of USB scantools, they do have some less desirable attributes;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;You need to configure the software running on the host computer with the correct baud rate. This is often confusing for users with no experience with USB or legacy RS-232 serial devices. But this is a one time issue, and can be resolved by reading the manual, or by simple trial and error. Once you have identified the correct baud rate, and know how to configure it in your OBD-II software, there is no more pain.&lt;/li&gt;
&lt;li&gt;Tablet and Phablet devices are popular these days, but OBD-II software packages for these devices rarely have support for USB scantools. However, USB scantools do work quite well with the Raspberry Pi single board computer, and "out of the box" for the most part.&lt;/li&gt;
&lt;li&gt;There is the additional clutter associated with the cable that connects the scantool to the host computer.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="advantages-of-usb-scantools"&gt;Advantages of USB Scantools&lt;/h2&gt;
&lt;p&gt;For applications such as OBD-II logging, USB scantools offer some unique advantages when compared to those with a Bluetooth physical layer. The two most prominent advantages are; greater speed and more robust, reliable connections with the host computer. They also tend to be less expensive than Bluetooth scantools of comparable quality.&lt;/p&gt;
&lt;h3 id="greater-speed"&gt;Greater Speed&lt;/h3&gt;
&lt;p&gt;With regard to the speed advantage of USB scantools, Perl OBD-II Logger has a simple feature that can help quantify this. When the program exits, it prints some summary statistics to the stdout unit. One of the statistics is the average reply time for each of the PIDs that were logged. This is the average time it takes for the scantool to reply to a request from the host computer to return the value of a given PID. There are many different factors that determine the reply time, such as the vehicle ECU itself. Another is the inherent communication speed of the physical layer.&lt;/p&gt;
&lt;p&gt;Here are some example reply time statistics from a logging session that were collected using my favorite, and best performing Bluetooth scantool (a well known name brand).&lt;/p&gt;
&lt;pre&gt;Summary of PID logging statistics
                                      average
  pid  requests   overdue   replies reply time
 ==== ========= ========= ========= ==========
 0x04       301        21       301   0.031227
 0x05        31         4        31   0.030660
 0x0b      1199        35      1199   0.035938
 0x0c       600        33       600   0.031200
 0x0d      1797        37      1797   0.037195
 0x0e       600        20       600   0.032347
 0x0f        31         3        31   0.029178
 0x10      1795        32      1795   0.037678
 0x11       600        20       600   0.032282
 0x33         6         1         6   0.030730
 0x3c        41         5        41   0.033641
 0x43       300        21       300   0.030120
 0x44      1196        24      1196   0.036010
 0x45       598        22       598   0.031258
 0x46        21         2        21   0.034851
 0x49       300        20       300   0.030259
 ---- --------- --------- --------- ----------
total      9416       300      9416   0.034886
Total elapsed time: 0 hours 10 minutes  4.425 seconds
Average PID sample rate: 15.578 (samples/second)
&lt;/pre&gt;

&lt;p&gt;Here are some reply time statistics from a logging session in the &lt;em&gt;same&lt;/em&gt; vehicle as above, a trip of similar duration, but collected using my cheapest USB scantool (also a well known name brand).&lt;/p&gt;
&lt;pre&gt;Summary of PID logging statistics
                                      average
  pid  requests   overdue   replies reply time
 ==== ========= ========= ========= ==========
 0x04       395         6       395   0.020852
 0x05        40         2        40   0.025990
 0x0b      1577        11      1577   0.018967
 0x0c       788         8       788   0.019502
 0x0d      2364         9      2364   0.018996
 0x0e       788        11       788   0.019945
 0x0f        40         4        40   0.027082
 0x10      2363         8      2362   0.019105
 0x11       787         9       787   0.019387
 0x33         7         0         7   0.021131
 0x3c        53         5        53   0.021857
 0x43       393         8       393   0.020974
 0x44      1573         8      1573   0.019769
 0x45       786        10       786   0.020035
 0x46        27         4        27   0.024161
 0x49       393         9       393   0.020758
 ---- --------- --------- --------- ----------
total     12374       112     12373   0.019546
Total elapsed time: 0 hours 13 minutes 11.058 seconds
Average PID sample rate: 15.641 (samples/second)
&lt;/pre&gt;

&lt;p&gt;Note that the Bluetooth scantool takes &lt;em&gt;longer&lt;/em&gt; to respond than the USB scantool, 34.9 milliseconds versus 19.5 milliseconds on average, or about 75% longer. This speed advantage allows you to sample PIDs at higher effective rates with the USB scantool (everything else being equal).&lt;/p&gt;
&lt;p&gt;I have tried logging with some of the inexpensive Bluetooth scantools, like those available on Amazon and EBay. The only one of them that I got working reasonably well was much slower, with average reply times of more than 100 milliseconds.&lt;/p&gt;
&lt;h3 id="more-robust-communications"&gt;More Robust Communications&lt;/h3&gt;
&lt;p&gt;The greater simplicity of the physical layer of USB scantools translates into more robust communications with the host computer. Unlike Bluetooth scantools, they do &lt;em&gt;not&lt;/em&gt; suffer performance degradation due to things like fluctuating signal strength or radio frequency interference. &lt;/p&gt;
&lt;p&gt;Of the Bluetooth scantools I have tried, only one of them had (in my opinion) acceptable connectivity. One of the more common problems I saw with the inexpensive Bluetooth scantools was poor Bluetooth connectivity. On the other hand, none of my USB scantools have suffered from any connectivity issues, they always seem to stay connected just fine for me, and they are &lt;em&gt;fast&lt;/em&gt;.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Johnny</dc:creator><pubDate>Tue, 01 Sep 2015 07:13:23 -0000</pubDate><guid>https://sourceforge.net5b02c23cb6e9af068003cbc487ddea77dd87b7ed</guid></item></channel></rss>