i am sure you have a word to say and experience here on the forum, this is why i decided to post a new thread regarding
my application TTHud which does record the drive via webcam and applies realtime data from ecu to the video frames.
You can see the idea here: http://ttfreak.prv.pl/
Now, to the point.
I request RPM, SPEED and THROTTLE data from ecu using a packet constructed as below:
- Code: Select all
command[0]=0x69;
command[1]=0x6a;
command[2]=0xf1;
command[3]=0x01;
command[4]=0x0C; //rpm
chcksum=(0x69+0x6a+0xf1+0x01+0x0C)&0xff;
command[5]=chcksum;
After this is written to ECU my receiving thread is awaitng response.
It receives the response correctly but sometimes i get totally wrong data i.e when engine is stopped - i have "4 Rpms" or if i drive sometimes it comes back with impossible value like 22100RPMs.
Below - a log from the test made few moments ago:
ENGINE STOPPED
Proper ECU response:
FOUND 0x48 [ 0x48(72) 0x6b(107) 0x10(16) 0x41(65) 0xc(12) 0x0(0) 0x0
(0) 0x10(16) ]
RPMS=((0*256)+0)/4=0
CYCLE: 5
Next query and wrong data
FOUND 0x48 [ 0x48(72) 0x6b(107) 0x10(16) 0x41(65) 0xc(12) 0x0(0) 0x10
(16) 0x0(0) ]
RPMS=((0*256)+16)/4=4
CYCLE: 6
Where did that '4' come from? Is there any checksum that you analyse before accepting the ecu response?
I am aware there is a checksum to be sent when requesting data, as my requests are being replied - but sometimes with wrong data. Hopefully i find someone here to help me out, i'm stuck with this and i thank you all for any answer...
Many thanks
Paul.
Ps. Additional data:
RPMS=((44*256)+72)/4=2834
CYCLE: 1305
RPMS=((165*256)+195)/4=10608
CYCLE: 1306
RPMS=((37*256)+89)/4=2390
CYCLE: 1307
FOUND 0x48 [ 0x48(72) 0x6b(107) 0x10(16) 0x41(65) 0xd(13) 0x5c(92) 0xdb(219) 0x0(0) ]
SPEED=92 (0x5c)
FOUND 0x48 [ 0x48(72) 0x6b(107) 0x10(16) 0x41(65) 0xd(13) 0x5(5) 0xff(255) 0x0(0) ]
SPEED=5 (0x5)
FOUND 0x48 [ 0x48(72) 0x6b(107) 0x10(16) 0x41(65) 0xd(13) 0x60(96) 0x71(113) 0x0(0) ]
SPEED=96 (0x60)