Skip to contentSkip to conversation

Parsing j1939 from raw candump

DISCUSSION Giox79 2 participants 8 messages Mar 25, 2013 – Apr 2, 2013 CAN network drivers

lore
Share & tools
lore

Giox79

author
#0 lore raw

Hello everybody, I would like to ask some suggestion. As said in a previous post, I rebuilt candump utils on a custom board with a can interface.
I've been able to capture data using the canlogserver util and everything worked fine.
Now I would like to build a SW application,
running in a PC and receiving the data from canlogserver. This application should parse raw candump packet and extract j1939 packet.
Is there anyone that can suggest me how to approach this topic? I tried using the j1939-71 standard, but as far as I understand, it explains differences between different packages, but I didn't find an explanation about header and trailer of J1939 packet. Please note that I have the whole j1939 standard and that at present time I can't integrate the j1939 canutils in linux kernel because I should use for other kind of constraints a 2.6 linux kernel.
Any help, reference to specific sections of j1939 standard
and so on will be appreciated.
Giovanni

#1 lore raw
Quoted 10 lines · On Mon, Mar 25, 2013 at 09:02:43PM +0000, Giox79 wrote:

Hello everybody, I would like to ask some suggestion. As said in a previous post, I rebuilt candump utils on a custom board with a can interface.
I've been able to capture data using the canlogserver util and everything worked fine. Now I would like to build a SW application, running in a PC and receiving the data from canlogserver. This application should parse raw candump packet and extract j1939 packet.

Quoted 5 lines

Is there anyone that can suggest me how to approach this topic? I tried using the j1939-71 standard, but as far as I understand, it explains differences between different packages, but I didn't find an explanation about header and trailer of J1939 packet.

j1939-21 & j1939-81
are the ones used by the j1939 linux kernel.

Quoted 4 lines

Please note that I have the whole j1939 standard and that at present time I can't integrate the j1939 canutils in linux kernel because I should use for other kind of constraints a 2.6 linux kernel.

which specific 2.6 one did it start from (like 2.6.28 or 2.6.35 or ...)

Quoted 8 lines

Any help, reference to specific sections of j1939 standard
and so on will be appreciated.
Giovanni

--
To unsubscribe from this list: send the line "unsubscribe linux-can" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 5 lines
Kurt Van Dijck
GRAMMER EiA ELECTRONICS
http://www.eia.be
[email protected]
+32-38708534
author
#2 lore raw

Hi Kurt, first thanks a lot

Quoted 10 lines · Kurt Van Dijck <kurt.van.dijck <at> eia.be> writes:
Quoted 5 lines · On Mon, Mar 25, 2013 at 09:02:43PM +0000, Giox79 wrote:

Is there anyone that can suggest me how to approach this topic? I tried using the j1939-71 standard, but as far as I understand, it explains differences between different packages, but I didn't find an explanation about header and trailer of J1939 packet.

j1939-21 & j1939-81
are the ones used by the j1939 linux kernel.

Mumble, I was wrong.
So as far as I understand, I have to use J1939-71 only after decoding from raw to j1939 using the suggested docs.
I can use 71 to understand the payload of J1939 packets.
Am I right?

Quoted 7 lines
Quoted 5 lines

Please note that I have the whole j1939 standard and that at present time I can't integrate the j1939 canutils in linux kernel because I should use for other kind of constraints a 2.6 linux kernel.

which specific 2.6 one did it start from (like 2.6.28 or 2.6.35 or ...)

The version is 2.6.35.3

Quoted 11 lines
Quoted 10 lines

Any help, reference to specific sections of j1939 standard
and so on will be appreciated.
Giovanni

--

To unsubscribe from this list: send the line "unsubscribe linux-can" in the body of a message to majordomo <at> vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 12 lines · On Tue, Mar 26, 2013 at 09:17:40PM +0000, Giox79 wrote:

Hi Kurt, first thanks a lot

Quoted 8 lines · Kurt Van Dijck <kurt.van.dijck <at> eia.be> writes:
Quoted 5 lines · On Mon, Mar 25, 2013 at 09:02:43PM +0000, Giox79 wrote:

Is there anyone that can suggest me how to approach this topic? I tried using the j1939-71 standard, but as far as I understand, it explains differences between different packages, but I didn't find an explanation about header and trailer of J1939 packet.

Quoted 8 lines
Quoted 2 lines

j1939-21 & j1939-81
are the ones used by the j1939 linux kernel.

Mumble, I was wrong.
So as far as I understand, I have to use J1939-71 only after decoding from raw to j1939 using the suggested docs.
I can use 71 to understand the payload of J1939 packets.
Am I right?

like the 'userspace' interpretation of the binary data? Yes.

Quoted 10 lines
Quoted 8 lines
Quoted 6 lines

Please note that I have the whole j1939 standard and that at present time I can't integrate the j1939 canutils in linux kernel because I should use for other kind of constraints a 2.6 linux kernel.

which specific 2.6 one did it start from (like 2.6.28 or 2.6.35 or ...)

The version is 2.6.35.3

I'll take a look if backporting linux-j1939 to 2.6.35 is feasible. Btw, I still run a platform with 2.6.25 _and_ a backported j1939. But 2.6.25 lacks some infrastructure, and I had to come up with less elegant procfs tunables to replace iproute2 commands.
The rest of the API (i.e. socket interface) is equal.

I'll take a look...

Kind regards,
Kurt

#4 lore raw
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
Quoted 6 lines

Please note that I have the whole j1939 standard and that at present time I can't integrate the j1939 canutils in linux kernel because I should use for other kind of constraints a 2.6 linux kernel.

which specific 2.6 one did it start from (like 2.6.28 or 2.6.35 or ...)

Quoted 8 lines
Quoted 1 line

The version is 2.6.35.3

I'll take a look if backporting linux-j1939 to 2.6.35 is feasible. Btw, I still run a platform with 2.6.25 _and_ a backported j1939. But 2.6.25 lacks some infrastructure, and I had to come up with less elegant procfs tunables to replace iproute2 commands.
The rest of the API (i.e. socket interface) is equal.

I'll take a look...

Giovanni,

I've put a branch j1939-v2.6.35 on
http://gitorious.org/~kurt-vd/linux-can/linux-can-j1939

I cherry-picked some commits between v2.6.35 & v2.6.38 in order to enable the necessary rtnetlink infrastructure.
It is compile-tested, but I'm unable to test it on hardware easily. I'm booting via EFI now and that support is very recent...

You may want to give it a try.
The iproute2 package does not need backporting AFAIK, i.e. you can use the one you like (with j1939 support).

If this works, it enables you to play with the j1939 stack on your PC also.

Kind regards,
Kurt

author
#5 lore raw

Hi Kurt

Quoted 21 lines · Kurt Van Dijck <kurt.van.dijck <at> eia.be> writes:
Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
Quoted 7 lines

Please note that I have the whole j1939 standard and that at present time I can't integrate the j1939 canutils in linux kernel because I should use for other kind of constraints a 2.6 linux kernel.

which specific 2.6 one did it start from (like 2.6.28 or 2.6.35 or ...)

Quoted 8 lines
Quoted 1 line

The version is 2.6.35.3

I'll take a look if backporting linux-j1939 to 2.6.35 is feasible. Btw, I still run a platform with 2.6.25 _and_ a backported j1939. But 2.6.25 lacks some infrastructure, and I had to come up with less elegant procfs tunables to replace iproute2 commands.
The rest of the API (i.e. socket interface) is equal.

I'll take a look...

Giovanni,

Quoted 9 lines

I've put a branch j1939-v2.6.35 on
http://gitorious.org/~kurt-vd/linux-can/linux-can-j1939

You may want to give it a try.
The iproute2 package does not need backporting AFAIK, i.e. you can use the one you like (with j1939 support).

If this works, it enables you to play with the j1939 stack on your PC also.

Thank you for your help.
I will give it a try during the weekend.
I don't know how to thank you. I will try using it and I will let you know. I hope that Monday I will be able to provide some good news. Have a nice day and a happy Easter
Giovanni

#6 lore raw
Quoted 1 line

I will give it a try during the weekend.

I'll be off next week. My email access may be limited. I hope it just works then.

Signature · 5 lines
Kurt Van Dijck
GRAMMER EiA ELECTRONICS
http://www.eia.be
[email protected]
+32-38708534
author
#7 lore raw
Quoted 5 lines · Kurt Van Dijck <kurt.van.dijck <at> eia.be> writes:
Quoted 2 lines

I will give it a try during the weekend.

I'll be off next week. My email access may be limited. I
hope it just works then.

Hi Kurt thank you again.
I had some little problem since my boss decided to avoid recompiling Linux kernel in our board (different development teams involved in the project
and I work on the application layer).
So at present time I have to create a custom SW in userspace to parse some J1939 extracting the associated SPN.
In order to validate my approach, I would like to have
an example of candump log (the official candump
application, integrated in the main branch of Linux kernel) and to know what kind of j1939 nformation it represents. So I would like to ask you if there is some kind of candump
test vectors somewhere on the web.
I wasn't able to find any resource about this topic. Do you know if there is some place where I can look for? Best regards