<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi Mark,<br>
<br>
Thinking about this more, I believe what I have done is correct.
The OVMS OBD2ECU task is representing itself to the HUD / Dongle as
an ECU, and ECUs run at one speed. My speed is 500kbps. I should
never be connected to a car's ECU, as there could be a conflict in
answering polls. Fortunately, the connectors won't match up (both
female). I also never transmit unless requested by the device to do
so. Don't mind just sitting there, minding my own business (no
timeouts for inactivity).<br>
<br>
The HUD I have does 500k, so we're good. It actually tries 250k,
probably among others, before finding me on 500k. It will also try
extended framing if standard doesn't evoke a response (I support
both types). My question was whether 500k is a universally
supported speed, and that seems to be the case. The one ICE car
that I own (2013 Honda CRV) also runs 500k for its ECU. <br>
<br>
As you note, since any particular car's ECU is always fixed, it's
the HUD's job to adapt, not mine. They connect to me, not the other
way around. I don't think I need to emulate every ECU, just the
OVMS ECU. Also, if I were to try different speeds, while the device
was doing the same, we might never meet up. Best to just sit where
I'm known to be, and let them find me. Are there any devices that
we need to support that can't adapt to 500k?<br>
<br>
When I use an OBDII Dongle (OBDWiz in my case), it also scans
through the space of ECU speeds and protocols, starting at the low
end, to find and connect to me. That has worked perfectly every
time (no CAN bus stoppage). 'can can3 status' shows no errors
logged after it has connected (Rx error & overflow counters are
zero), same with the HUD. So I'm puzzled why your testing has shown
different results. I have seen some occasions where after
physically connecting and reconnecting things the communication
stops, but that could also be a flaky cable / connectors. It's been
through a lot of mechanical use, but haven't found a repeatable way
to reproduce it.<br>
<br>
Hopefully we'll get some feedback from users (all positive!) when
the OBDII cables hit FastTech. If there's a need to support a
different speed, we can add that as an optional parameter to the
start command line, after the bus name.<br>
<br>
Greg<br>
<br>
<br>
<div class="moz-cite-prefix">Mark Webb-Johnson wrote:<br>
</div>
<blockquote type="cite"
cite="mid:1C7ABDD0-5F46-4CDD-BDBD-3A0C666859EF@webb-johnson.net">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
The OBDII client should determine the bus speed and the ECU side
only needs to support one speed.
<div class=""><br class="">
</div>
<div class="">Clients typically do this in one of two ways:</div>
<div class=""><br class="">
</div>
<div class="">
<ol class="MailOutline">
<li class="">Set CAN controller to ‘listen’ mode, then loop
through supported bus rates, listening for a correctly
formatted CAN message to let you know you found the right
rate. If found, exit the loop.<br class="">
<br class="">
</li>
<li class="">Set CAN controller to ‘active’ mode, then loop
through supported bus rates, polling for OBDII data and
ignoring errors. If you get a valid response, exit the loop.</li>
</ol>
<div><br class="">
</div>
<div>Obviously #1 is the least noisy approach, and the least
likely to interfere with other vehicle systems, but won’t work
on purely active polling can buses with nothing else active on
the bus. I guess some clients may employ both approaches.</div>
<div><br class="">
</div>
<div>I suspect that your HUD is working cleanly because it tries
500K rate first, so doesn’t generate errors.</div>
<div><br class="">
</div>
<div>It would probably be worth us transmitting a CAN bus heart
beat every few seconds when obd2ecu is started, 12v external
power is on, but we haven’t heard from the HUD in a while.
That would probably help clients lock onto us quicker.</div>
<div><br class="">
</div>
<div>Regards, Mark.</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 24 May 2018, at 4:54 AM, Greg D. <<a
href="mailto:gregd2350@gmail.com" class=""
moz-do-not-send="true">gregd2350@gmail.com</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" class="">
<div text="#000000" bgcolor="#FFFFFF" class=""> Hi Mark,<br
class="">
<br class="">
The OBD2ECU task assumes that "all" HUDs and such
devices operate at 500k. Are you aware of any that
don't (can't) operate at that speed? I was hoping I
wouldn't have to support multiple speeds, especially
autosensing them.<br class="">
<br class="">
BTW, I have not seen any problems connecting an OBDII
Dongle to the OVMS and letting it do its default scan
through the various rates in order to connect. It just
takes longer than it would if (as I usually do) tell it
what rate and frame size to use. The various frames and
speeds tried before figuring out the right one don't
seem to bother it.<br class="">
<br class="">
Greg<br class="">
<br class="">
<br class="">
<div class="moz-cite-prefix">Mark Webb-Johnson wrote:<br
class="">
</div>
<blockquote type="cite"
cite="mid:899F4225-F718-480B-95C3-154954D3FC98@webb-johnson.net"
class="">
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" class="">
I am also now seeing this.
<div class=""><br class="">
</div>
<div class="">Trying out the OBD2ECU HUD cables, I was
having problems getting it to work. Those HUDs try
to transmit at different baud rates, to probe for
what is correct, and that is causing errors at our
end. Once we get those errors, seemingly we can’t
recover. A ‘can can3 start active 500000’ fixes the
issue and the HUD connects.</div>
<div class=""><br class="">
</div>
<div class="">It looks something like this:</div>
<div class=""><br class="">
</div>
<blockquote style="margin: 0 0 0 40px; border: none;
padding: 0px;" class="">
<div class="">
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">OVMS# can
can3 status</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">CAN:
can3</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">Mode:
Active</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">Speed:
500000</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">Interrupts:
1</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">Rx pkt:
0</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">Rx err:
105</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">Rx ovrflw:
0</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">Tx pkt:
0</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">Tx delays:
0</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">Tx err:
0</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">Tx ovrflw:
0</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">Err flags:
0x8000</span></font></div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">Or this:</div>
<div class=""><br class="">
</div>
<blockquote style="margin: 0 0 0 40px; border: none;
padding: 0px;" class="">
<div class="">
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">OVMS# can
can3 status</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">CAN:
can3</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">Mode:
Active</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">Speed:
250000</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">Interrupts:
146</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">Rx pkt:
0</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">Rx err:
128</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">Rx ovrflw:
0</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">Tx pkt:
0</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">Tx delays:
0</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">Tx err:
0</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">Tx ovrflw:
0</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">Err flags:
0x800b</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">E (713021)
canlog: Error can3 intr=1 rxpkt=0 txpkt=0
errflags=0x8000 rxerr=1 txerr=0 rxovr=0
txovr=0 txdelay=0</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">E (713021)
canlog: Error can3 intr=2 rxpkt=0 txpkt=0
errflags=0x8000 rxerr=2 txerr=0 rxovr=0
txovr=0 txdelay=0</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">E (713021)
canlog: Error can3 intr=3 rxpkt=0 txpkt=0
errflags=0x8000 rxerr=4 txerr=0 rxovr=0
txovr=0 txdelay=0</span></font></div>
</div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">...</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">OVMS# can
can3 status<br class="">
CAN: can3<br class="">
Mode: Active<br class="">
Speed: 250000<br class="">
Interrupts: 3757<br class="">
Rx pkt: 1<br class="">
Rx err: 128<br class="">
Rx ovrflw: 0<br class="">
Tx pkt: 1<br class="">
Tx delays: 0<br class="">
Tx err: 0<br class="">
Tx ovrflw: 0<br class="">
Err flags: 0x800b</span></font></div>
<div class=""><font class="" face="Andale Mono"><span
style="font-size: 14px;" class="">...<br
class="">
OVMS# can can3 status<br class="">
CAN: can3<br class="">
Mode: Active<br class="">
Speed: 250000<br class="">
Interrupts: 3775<br class="">
Rx pkt: 10<br class="">
Rx err: 128<br class="">
Rx ovrflw: 0<br class="">
Tx pkt: 10<br class="">
Tx delays: 0<br class="">
Tx err: 0<br class="">
Tx ovrflw: 0<br class="">
Err flags: 0x800b</span></font></div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">And then the can bus dead (until ‘can
start …’ to reset it).</div>
<div class=""><br class="">
</div>
<div class="">Good news is that with those HUDs, it is
very easy to recreate the fault condition. I’ll see
what I can do to find out what is going on. My guess
is we are not clearing the MCP2515 error condition
correctly. I will try to find out what is going
on...</div>
<div class=""><br class="">
</div>
<div class="">Regards, Mark.</div>
<div class=""><br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On 14 May 2018, at 6:17 PM, Tom
Parker <<a href="mailto:tom@carrott.org"
class="" moz-do-not-send="true">tom@carrott.org</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">On 14/05/18 20:36, Stein Arne
Sordal wrote:<br class="">
<br class="">
<blockquote type="cite" class="">I also
tried to raise the stack size to 6144.<br
class="">
It seems like it got worse…Can buses (RX)
stops working more often. TX is fine.<br
class="">
</blockquote>
<br class="">
I don't see an improvement either. I wrote
the new firmware with updated sdkconfig at
about 3pm yesterday and it rebooted and lost
the state of charge metric at 8:45pm, the
car woke up at midnight and started
charging, providing data for the SOC metric,
during the charge there were a couple of
gaps in the telemetry, charging finished at
3:10am and the OVMS rebooted at 3:45. The
OVMS then stopped sending telemetry
completely at 7:20 am when the car was
switched back on. I had a chance to plug a
laptop in and the module was unresponsive on
the serial port.<br class="">
<br class="">
I'm not sending the monotonic metric so it's
only possible to see the first reboot after
the car is switched off (when it forgets the
SOC).<br class="">
<br class="">
I've built a version of the firmware with
most things turned off (and found vehicle
depends on webserver and webserver depends
on OTA) I'll see how that goes tonight.<br
class="">
<br class="">
Otherwise I'll get the datalogger out and/or
try the sdcard logger again.<br class="">
<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
OvmsDev mailing list<br class="">
<a
href="mailto:OvmsDev@lists.openvehicles.com"
class="" moz-do-not-send="true">OvmsDev@lists.openvehicles.com</a><br
class="">
<a class="moz-txt-link-freetext"
href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev"
moz-do-not-send="true">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a><br
class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
<br class="">
<fieldset class="mimeAttachmentHeader"></fieldset>
<br class="">
<pre class="" wrap="">_______________________________________________
OvmsDev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OvmsDev@lists.openvehicles.com" moz-do-not-send="true">OvmsDev@lists.openvehicles.com</a>
<a class="moz-txt-link-freetext" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev" moz-do-not-send="true">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a>
</pre>
</blockquote>
<br class="">
</div>
_______________________________________________<br
class="">
OvmsDev mailing list<br class="">
<a href="mailto:OvmsDev@lists.openvehicles.com" class=""
moz-do-not-send="true">OvmsDev@lists.openvehicles.com</a><br
class="">
<a class="moz-txt-link-freetext" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a><br
class="">
</div>
</blockquote>
</div>
<br class="">
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
OvmsDev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OvmsDev@lists.openvehicles.com">OvmsDev@lists.openvehicles.com</a>
<a class="moz-txt-link-freetext" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a>
</pre>
</blockquote>
<br>
</body>
</html>