CAN-Do: a CAN-message Analysis Tool

My Nissan Leaf Forum

Help Support My Nissan Leaf Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
Gary,

About the recipe fields, taking the example of SOC

MsgID=5BC D#=0 Mask=0F Equals=05 : D#=1,Mask=FF,Shift=2 + D#=2,Mask=C0,Shift=-6

I would interpret that as SOC = ((D1 & 0xFF) << 2) + ((D2 & 0xC0) >> 6)
But what is the meaning of D#=0 Mask=0F Equals=05 ?

TIA, Sam
 
In the Recipe, the first "term" (like D#=7 Mask=0F Equals=05)
is a data-byte filter for messages to qualify for the Recipe.
It is enabled when D# is 1-8, disabled when D# = 0.

So, my sample Mask above, it would say use the message only if
D7 AND 0x0F = 0x05

In your example, the filter is disabled (D# = 0), so all the
messages (with the selected Message ID) are plotted.
 
I intend to add a "Scale Factor" and "Zero Value" to each Recipe Item.

This should allow us to compare different data values better.

I hope to use fields in the file that are currently reserved.

Probably, a "Scale Factor" = 0 will turn scaling OFF.
 
CAN-Do version 1.5.0 is now posted at
http://www.wwwsite.com/puzzles/cando/" onclick="window.open(this.href);return false;

It has a Scale Factor and a Raw Zero Value added to the Recipe Functions.
See examples (SOC Raw, SOC Percent, Pack Out Amps) in
the latest "Recipe File", V1.02 at the same URL.
 
1. While capturing CAN-Messages for a Log, one can watch
the CAN-Do dashboard if the Run Dashboard checkbox is checked.
About 1 million messages per hour are typical from the EV-CAN bus.

2. After Logging is stopped, you can save the in-memory messages
into a Log file, using either ".evc" for EV-CAN messages, or ".alc" for
a single file containing messages from 2 or more CAN buses.
 
Gary,
I'm trying to implement CAN-Do compatible logging in my CAN reader hardware.
I understand that the format that CAN-Do expects is

Sync Byte, MsgIDLo, MsgIDHi, D1, .... D8
Data count (0 to 8) is in the high nibble of MsgIDHi
Missing data bytes are 0xFF.

What is the value of your Sync Byte?
 
OK, I found from an old thread that your sync byte is
msgidLSB XOR msgidMSB XOR 0x53

But CAN-Do is still rejecting my messages.
Here is a sample message I sent to CAN-Do:

5BC 44 43 2C 3F C2 05 40 00

BC XOR 05 XOR 53 = EA

so I send the following byte stream:

EA BC 85 44 43 2C 3F C2 05 40 00

What am I doing wrong?

TIA
 
Seems correct for the message encoding.

Are you sending the message as eleven 8-bit bytes,
(8,N,1, no flow control) at 115200 baud?
(Not 33 or 22 ASCII characters.)

Have you tested sending "Hello" to a Terminal program?

How is the CAN-Do program reacting?
 
Yes, I wrote a small test program to send out the exact 8-bit bytes

EA BC 85 44 43 2C 3F C2 05 40 00

using the comm parameters that you specified. The program just loops continuously, sending the same byte stream out over and over again.

I just verified with a small C++ program under that the PC is receiving the exact bytes that I sent out. Also, as a secondary test, I tried sending out a "Hello" string to a terminal program, and that worked as well.

In CAN-Do, the Input and Output Control screen shows 0 in the field with tool tip "Number of EV-CAN messages received, and under Status of EV-CAN input, the numbers change continuously.
 
Perhaps the data is coming too fast for CAN-Do to keep up?

Or, the PC's serial input buffer is having overruns and characters
are gettig lost. How big is the Comm-Port buffer?

Did the characters come into the Test and Terminal program at 115200 baud?

I do not remember what makes the status numbers change,
but it could be counting the number of not-synced events.

So, try putting a 20 ms delay after each message in your sending loop.
 
I just added the Logging Port to my SOC-Meter, and tried to
do some Logging. I got strange results:
(I might have "broken" either CAN-Do receiving, or the SOC-Meter Log-sending.)

I am using SOC-Meter F1.08 and CAN-Do version 1.5.0
An earlier version of CAN-Do (like 1.4.4) might not be broken.

What versions are you using?

I will describe what I got:
With the LEAF ON and READY, but still in Park,

With the "Show Counts" checkbox checked, the wider pink field goes white
and shows message counts, updating about every 200 messages.

However, I got only about 200 additional messages every 10 or 20 seconds,
and a lot of activity in the shorter yellow field. It indicates status, and
I will look up what the numbers mean.

Then, when I "Stopped Input", and went to the Filters screen and
click "Get Msg IDs" (near the left, at the top), I get strange message IDs,
not the ones that I normally get.

So, it APPEARS that either CAN-Do is broken, or the SOC-Meter firmware is broken.

Try CAN-Do around version 1.44 and see if that works.
Based on your tests, I will look for a broken CAN-Do first.
More info later.
 
I just tried V1.41 (because I already had it downloaded), and it works somewhat better. I don't see any more of the weird corrupted packets, but it seems to be missing a lot of data. And when I display the dashboard, the only valid item displayed is the number of fuel bars.

Should bother I trying again with 1.4.4?
 
I think you can use CAN-Do 1.4.2 to see a bit more (RPM), if you wish.
However, I think CAN-Do 1.4.4 and on might be broken (for Comm-In Logging).

So, the recent 1.5.0, and the previous versions after 1.4.2, have broken Comm
message reading and I am fixing it now, and I will test it soon, then
put a new version 1.5.1 on-line, and post here. (about another hour or two)

Sorry for the inconvenience, Gary
 
I just tested with my latest version 1.5.1 of CAN-Do, found at:
http://www.wwwsite.com/puzzles/cando/" onclick="window.open(this.href);return false;
I tested Logging messages from the SOC-Meter's Logging Port.
There were some bugs in the version 1.5.0 of CAN-Do.

The Logging Port on the SOC-Meter ver F1.08 seems to work fine with CAN-Do
only IF you use a GOOD USB-to-RS232 cable, but NOT if you use a POOR one.

Using a POOR USB-to-RS232 cable, I got what looked like "garbage" messages.
Also, I "received" only about 100 messages in 15 seconds, not the normal
message rate that is more lke 500 messages per second!

So, make sure you get a "good" USB-to-RS232 adapter.
Those with the latest FTDI chip MIGHT be the better ones.

-------------- What is GOOD? ----------------
No, I have not tested any of these.
However, I would try #4 first (or #2), I think.

1. This "Windows 7 Compatible USB Serial Adapter FTDI Chip
RS232 DB-9 920K with TX/RX LED" MIGHT be good, but it
only has a short cable, and has female attachment hardware.

$18 at Amazon:
http://www.amazon.com/Windows-Compatible-Serial-Adapter-RS232/dp/B004WLA4P4/ref=sr_1_2?ie=UTF8&qid=1315460244&sr=8-2" onclick="window.open(this.href);return false;

2. This "36inch FTDI USB to Serial Cable for MA PC Linux with Windows Certified Drivers" has a 3-foot cable and appears to have the male attachment hardware (desired).

$19 at Amazon:
http://www.amazon.com/36inch-Serial-Windows-Certified-Drivers/dp/B004WM1WUY/ref=sr_1_6?ie=UTF8&qid=1315460244&sr=8-6" onclick="window.open(this.href);return false;

3. This "6ft. USB to RS232 Converter for Windows 7 (32/64bit) FTDI CHIP RX/TX LED" has a 6-foot cable, but has the female attachment hardware that might not mate well with the SOC-Meter's Logging Port mounting hardware.

$20 at Amazon:
http://www.amazon.com/6ft-RS232-Converter-Windows-64bit/dp/B004I6594Y/ref=sr_1_7?ie=UTF8&qid=1315460244&sr=8-7" onclick="window.open(this.href);return false;

4. This has a 10-foot cable and has the male attachment hardware (that we desire): "USB to RS232 Serial DB9 Cable Adapter FTDI Chipset 10 Feet Supports Windows 7 64bit"

$25 at Amazon:
http://www.amazon.com/Serial-Adapter-Chipset-Supports-Windows/dp/B003N9TYW0/ref=sr_1_14?ie=UTF8&qid=1315460244&sr=8-14" onclick="window.open(this.href);return false;

5. For those wanting to do 3 or 4-bus CAN logging, this "4 Port RS232 FT4232HL Professional USB to Serial Adapter with TX/RX LED and COM Retention FTDI Chip & Fast 920K Per Port Transfer Speed Certified Microsoft Windows 7 and 2008 Driver Included (32/64-Bit)" might be quite good.

$45 at Amazon:
http://www.amazon.com/FT4232HL-Professional-Retention-Certified-Microsoft/dp/B004ETDC8K/ref=sr_1_5?ie=UTF8&qid=1315460244&sr=8-5" onclick="window.open(this.href);return false;

-----
 
Gary,
I tried the 1.5.1, and it's still not logging properly for me.

1) I'm using a "good" serial adapter with FTDI chip
2) To test for data corruption, I wrote a program to dump the raw logging data to a file.
Next, I wrote another program to decode the raw data that I logged to the file.
There were no lost bytes or data corruption, the data decoded 100% error free.

I want to make sure that there's no discrepancy between the format that I'm outputting and what
CAN-Do expects. Could you please send me a log file of the raw data that's received on the serial port
by CAN-Do?

I've sent you an email with my data dumping utility, in case you don't have something convenient to use.

I would really like to get my hardware working with CAN-Do instead of writing a new program.
Thanks!
Sam
 
Email your raw log to me first.

I do not yet have a function to make a raw log file, but I can add one to CAN-Do, and add a function to read a raw log as well.

I will help you get this going.
See my PM.
 
garygid said:
Email your raw log to me first.

I do not yet have a function to make a raw log file, but I can add one to CAN-Do, and add a function to read a raw log as well.

I will help you get this going.
See my PM.

I didn't receive a PM from you, but I just emailed the raw log.
 
The sync byte is not correct.

53 xor LL xor DH => sync byte

where the MsgID is HLL and the data-count is D

You are doing
53 xor LL xor 0H, then adding the D later.

Otherwise, looks good. :D
 
I had a feeling it was just a small discrepancy in format...
yes, I was doing MsgLo XOR MsgHi XOR 53h for the sync byte.
Good sleuthing.

I made the change in my code, and it talks to CAN-Do perfectly now! Thanks for the help.
It's easier to figure out the CAN messages when there's instant feedback on the live bus.
I spent several hours staring at my message logs yesterday, but wasn't able to glean anything new yet.

One thing I just noticed. The regen bargraph goes positive when I put the car in reverse, so the value that's displayed there is probably related to direction of current flow in the motor, rather than what's going in/out of the pack.

Also, I was looking into D4 of 50A as a candidate for temperature in C, but it looks too high ... my car was cold this morning, and it was 62F outside, but the temp was translating to about 82F.
 
Had the car L2-charged overnight (in early to late morning), perhaps to 100%?

If so, warming internally to 80ºF is not impossible.

Or, maybe charger or coolant temperature?

I will look at D4 of 50A :D
 
Back
Top