Working with ScanTool OBD-II / CAN 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.

kevinleaf

Well-known member
Joined
Jun 3, 2013
Messages
178
I got a bluetooth ScanTool MX over the weekend and started playing around with it. I really wanted to try this unit since it can filter many CAN messages at the same time, whereas the ELM327's can just do a single message. As an added bonus it is much faster and seems to have more buffering. Anyone else here played with these units at all?

One strange thing I am seeing: messages don't seem to be "complete". I am probably doing something wrong but I don't understand it fully yet. Here is an example of the data I get back:

1D5 00 00 00 01 D7
1CB 00 00 00 00 63 FF A0
292 80 08 1E 80 F0 00 00 03
1D5 00 00 00 02 D8
1CB 00 00 00 00 63 FC AA
1D5 00 00 00 03 D9
1CB 00 00 00 00 63 FD 2F
292 81 48 0A 80 F0 00 00 00

Note all the messages are not the same length. For the most part all of the same messages are equally as short (I.E. all 1D5 are 5 bytes, all 1CB are 7 bytes) but I would expect them all to be 8 bytes. Anyone have any idea why?

I am doing the init like this (in Java):
"ATZ", //reset
"STSBR 2000000", //set baud rate
"STI",//get firmware version
"ATE0",//echo off
"ATH1",//headers on
"ATCAF 0", //turn auto formatting off
"ATDP", //Ask for the protocol (should be CAN 500 kbps)
"STFAC",
"STFAP 5B3,7FF", //SOC data only
"STFAP 292,7FF", //friction braking
"STFAP 1CA,7FF", //friction braking, not for MY2013
"STFAP 1CB,7FF", //target regen braking, target braking
"STFAP 1D5,7FF" //applied regen braking

Thanks!
 
I purchased the MX locally and was unable to get it to work with the early version of Leaf Spy so I finally ordered several cheap ELM clones on line. They all work with my Android device and the Leaf. The MX works with my SUV and the software that came with it so I kept it, but I have never been able to make it work with the Leaf. Perhaps there is some hardware incompatibility that causes the data issues you are seeing.

Gerry
 
So it definitely doesn't work with Leaf Spy Pro. I knew this ahead of time. There is a command that Leaf Spy Pro uses that doesn't work as it is supposed to with the ScanTool MX unit. They are supposed to fix it eventually but so far it is still broken.

I am working on software that will work with this unit. There is no way it will be even close to as full featured as Leaf Spy Pro but it will work, and I will give it away once it is working and doesn't crash the phone.
 
I have made good progress on my app using the ScanTool MX. Android programming is a bit tricky but I am learning a lot in the process.

So far I got Health and GIDs logging as well as friction brake pressure. I also got the phone to make a tone that corresponds to the friction brake pressure you are applying, to help you "train your foot" to favor regen braking over friction brakes. If anyone is interested in the app or the code to help me develop this idea please send me a PM!
 
Less than 8 bytes: good to know, thanks.

Right now I am generating a tone based on the 292 message only but I plan to incorporate the info from 1D5 also
 
Can some one confirm with me: Regen is biys 7:5 of byte 0 of 1D5. So: AND the value in byte zero of the 1D5 message with 0xD0 to mask just these bits and right shift 6 bits to get the regen value?
 
kevinleaf said:
Can some one confirm with me: Regen is biys 7:5 of byte 0 of 1D5. So: AND the value in byte zero of the 1D5 message with 0xD0 to mask just these bits and right shift 6 bits to get the regen value?
It is 11 bits total. See the entry in the master CAN message doc.

You need to left shift byte0 3 and add to byte1 right shifted 5. IOW: Applied_Regen = (1D5:D0<<3) + ((1D5:D1&0xE0)>>5)
 
TickTock: Would you be so kind as to explain the mentioned shifting to a beginner? Is there a good tutorial out there for getting the correct values?
id:1DB - FE, A0, BE, EA, 3C, 0, 1, 75
Should byte 0 (FE) for example be converted from hex to dec first?
 
"byte0 3 and add to byte1 right shifted 5. IOW: Applied_Regen = (1D5:D0<<3) + ((1D5:D1&0xE0)>>5)"

So in your example:
1DB - FE, A0, BE, EA, 3C, 0, 1, 75
So we care about FE and A0

FE is 1111 1110
left shifted 3 is:
1111 0000

A0 is:
1010 0000
right shifted 5 bits is:
0000 0101

So result is: 101 1111 0101 ?
5F5
or
1525 ??
 
Back
Top