CAN BUS OBD2 4 Byte messages

Ardiuno Compatible shields

Moderators: lily.li, violet

Post Reply
expunged
Pre-kindergarten
Pre-kindergarten
Posts: 1
Joined: Wed Mar 06, 2019 12:01 pm

CAN BUS OBD2 4 Byte messages

Post by expunged » Wed Mar 06, 2019 12:10 pm

I'm trying to get the CAN shield to send long (but not extended 29 bit) answers but I'm striking out.... Everything else works and communicates properly.

Here's the relevant code:

Code: Select all

        
        // Tell the reader what PIDs we support
        // Service 01 PIDs supported 01-20 - Set to DEC 24 59 80 00 = HEX 18 3B 50 00
        // PID    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
        // Status 0 0 0 1 1 0 0 0 0  0  1  1  1  0  1  1  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  
        if(BuildMessage=="2,1,0,0,0,0,0,0,") {unsigned char s0pid020[8] = {4, 65, 00, 24, 59, 80, 00}; CAN.sendMsgBuf(0x7E8, 0, 8, s0pid020);}
        
 
I'm plugged directly into it with a ELM based scan tool and sending 0100 returns:
>ATSP0
OK

>0100
41 00 18 3B

Containing only the "18 3B" instead of the full "18 3B 50 00" response that a diagnostic tool would expect. I'm sure it's just something simple and stupid but I've read everything I can think of and can't find a useful solution. Thanks!

User avatar
bestlux
Kindergarten
Kindergarten
Posts: 85
Joined: Wed Jan 30, 2019 11:51 am

Re: CAN BUS OBD2 4 Byte messages

Post by bestlux » Mon Mar 11, 2019 2:28 pm

Hello,
I want to know why do you define an 8-sized array with 7 elements?

Code: Select all

unsigned char s0pid020[8] = {4, 65, 00, 24, 59, 80, 00}

Post Reply