Skip to contentSkip to conversation

CAN j1939 library doubts

DISCUSSION Giox79 4 participants 11 messages Mar 12, 2013 – Mar 16, 2013 CAN network drivers

lore
Share & tools
lore

Giox79

author
#0 lore raw

Hello everybody.
I'm working on an embedded system, and I would like to dump data from CAN bus and parse j1939 data.
I built canutils, last version, on ARM device, however, I'm a bit
about how to use the j1939 version of canutils.
Is there any tutorial about what should I do in order to use Utilities like jspy?
If I'm right, I have to build both the kernel and the user app section. I'm a Linux beginner, and I didn't find guides to these steps. Any help, link to website or similar resources will be really appreciated.

Finally is there anyone that compiled the j1939 can libraries on ARM systems?

#1 lore raw

Hi,
Yes, I have been using j1939 on an ARM system in the past (TI AM3505). Requires a patched kernel, "iproute2" and "can-j1939-utils". jspy worked fine on ARM.
I cross-compiled the software with ptxdist. I can't provide a tutorial for that, but I can share the rules to build it in case you are familiar with ptxdist.
I would like take the opportunity to say that I encourage the effort to bring upstream the j1939 stack and it's tools. Official tar.* source archives for "iproute2" with j1939 support and "can-j1939-utils" would be useful for the ptxdist rules. Regards,
Jean-Claude

Quoted 19 lines · On Mar 12, 2013, at 22:52 , Giox79 <[email protected]> wrote:

Hello everybody.
I'm working on an embedded system, and I would like to dump data from CAN bus and parse j1939 data.
I built canutils, last version, on ARM device, however, I'm a bit about how to use the j1939 version of canutils.
Is there any tutorial about what should I do in order to use Utilities like jspy?
If I'm right, I have to build both the kernel and the user app section. I'm a Linux beginner, and I didn't find guides to these steps. Any help, link to website or similar resources will be really appreciated.

Finally is there anyone that compiled the j1939 can libraries on ARM systems?

--
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

#2 lore raw

Hi,

iproute2, can-utils & kernel needs patches.

My 'latest' git archives http://gitorious.org/~kurt-vd/ will work, but you probably want to merge the necessary patches into later versions.

I plan to do some effort to assemble an howto on elinux.org.

Kind regards,
Kurt

Quoted 33 lines · Jean-Claude Monnin

Hi,
Yes, I have been using j1939 on an ARM system in the past (TI AM3505). Requires a patched kernel, "iproute2" and "can-j1939-utils". jspy worked fine on ARM.
I cross-compiled the software with ptxdist. I can't provide a tutorial for that, but I can share the rules to build it in case you are familiar with ptxdist.
I would like take the opportunity to say that I encourage the effort to bring upstream the j1939 stack and it's tools. Official tar.* source archives for "iproute2" with j1939 support and "can-j1939-utils" would be useful for the ptxdist rules. Regards,
Jean-Claude

Quoted 11 lines · On Mar 12, 2013, at 22:52 , Giox79 <[email protected]> wrote:

Hello everybody.
I'm working on an embedded system, and I would like to dump data from CAN bus and parse j1939 data.
I built canutils, last version, on ARM device, however, I'm a bit about how to use the j1939 version of canutils.
Is there any tutorial about what should I do in order to use Utilities like jspy?
If I'm right, I have to build both the kernel and the user app section. I'm a Linux beginner, and I didn't find guides to these steps. Any help, link to website or similar resources will be really appreciated.

Quoted 8 lines

Finally is there anyone that compiled the j1939 can libraries on ARM systems?

--
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

--
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
#10 lore raw
In reply to Jean-Claude Monnin
Quoted 3 lines · Jean-Claude Monnin <jc_monnin <at> emailplus.org> writes:

Hi,
Yes, I have been using j1939 on an ARM system in the past (TI AM3505).

Requires a patched kernel, "iproute2"

Quoted 2 lines

and "can-j1939-utils". jspy worked fine on ARM.
I cross-compiled the software with ptxdist. I can't provide a tutorial for

that, but I can share the rules to

Quoted 2 lines

build it in case you are familiar with ptxdist.
I would like take the opportunity to say that I encourage the effort to bring

upstream the j1939 stack and

Quoted 1 line

it's tools. Official tar.* source archives for "iproute2" with j1939 support

and "can-j1939-utils"

Quoted 26 lines

would be useful for the ptxdist rules.
Regards,
Jean-Claude

Quoted 11 lines · On Mar 12, 2013, at 22:52 , Giox79 <giovanniparodi79 <at> gmail.com> wrote:

Hello everybody.
I'm working on an embedded system, and I would like to dump data from CAN bus and parse j1939 data.
I built canutils, last version, on ARM device, however, I'm a bit about how to use the j1939 version of canutils.
Is there any tutorial about what should I do in order to use Utilities like jspy?
If I'm right, I have to build both the kernel and the user app section. I'm a Linux beginner, and I didn't find guides to these steps. Any help, link to website or similar resources will be really appreciated.

Quoted 8 lines

Finally is there anyone that compiled the j1939 can libraries on ARM systems?

--
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

Quoted 6 lines

--
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

Hi Jean-Claude,
first thanks for your reply. At present time I don't use the ptxdist system. However, as far as I understood, it is a specific kernel distribution configured for ARM devices. So if you can provide the rules to build j1939 using ptxdist, may be I will be able to use it in my SW setup.
Thanks a lot for you help..

author
#3 lore raw
In reply to Kurt Van Dijck
Quoted 8 lines · Kurt Van Dijck <kurt.van.dijck <at> eia.be> writes:

Hi,

iproute2, can-utils & kernel needs patches.

My 'latest' git archives http://gitorious.org/~kurt-vd/ will work, but you probably want to merge the necessary patches into later versions.

Quoted 8 lines

I plan to do some effort to assemble an howto on elinux.org.

Kind regards,
Kurt

Quoted 2 lines · Jean-Claude Monnin

Hi,
Yes, I have been using j1939 on an ARM system in the past (TI AM3505).

Requires a patched kernel, "iproute2"

Quoted 2 lines

and "can-j1939-utils". jspy worked fine on ARM.

Quoted 1 line

I cross-compiled the software with ptxdist. I can't provide a tutorial for

that, but I can share the rules

Quoted 2 lines

to build it in case you are familiar with ptxdist.

Quoted 1 line

I would like take the opportunity to say that I encourage the effort to

bring upstream the j1939 stack and

Quoted 1 line

it's tools. Official tar.* source archives for "iproute2" with j1939 support

and "can-j1939-utils"

Quoted 31 lines

would be useful for the ptxdist rules.

Quoted 29 lines

Regards,
Jean-Claude

Quoted 11 lines · On Mar 12, 2013, at 22:52 , Giox79 <giovanniparodi79 <at> gmail.com> wrote:

Hello everybody.
I'm working on an embedded system, and I would like to dump data from CAN bus and parse j1939 data.
I built canutils, last version, on ARM device, however, I'm a bit about how to use the j1939 version of canutils.
Is there any tutorial about what should I do in order to use Utilities like jspy?
If I'm right, I have to build both the kernel and the user app section. I'm a Linux beginner, and I didn't find guides to these steps. Any help, link to website or similar resources will be really appreciated.

Quoted 8 lines

Finally is there anyone that compiled the j1939 can libraries on ARM systems?

--
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

--
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

I Kurt,
thanks for your reply. I have a question related to J1939. My task is to extract from raw can packets info like oil, brake pressure and so on.
Can you tell me if it is right that after building the kernel for my board using your modified can driver, and using the jspy utils, I will have only to build the J1939 parser?
Is there any utility that will allow me parsing the standard (not vendor dependent)packets?
If I will be successfull building the J1939 in my SW environment, I will try to create a little howto.
If you think this can be useful, I will send it to you.
have a nice day

#4 lore raw
Quoted 10 lines · On Thu, Mar 14, 2013 at 11:17:51AM +0000, Giox79 wrote:
Quoted 1 line · Kurt Van Dijck <kurt.van.dijck <at> eia.be> writes:

Hi Kurt,
thanks for your reply. I have a question related to J1939. My task is to extract from raw can packets info like oil, brake pressure and so on.
Can you tell me if it is right that after building the kernel for my board using your modified can driver, and using the jspy utils, I will have only to build the J1939 parser?

I think you could do that without jspy.
You could write a program that connect to a j1939 socket, similar to jspy, and listen to any packet that if of your interest.
You would get the PGN's as binary streams (possible >8 bytes)

Your program will get quite straight-forward then.

I assume you won't need Address Claiming, since you're watching generic PGN's?

Quoted 6 lines

Is there any utility that will allow me parsing the standard (not vendor dependent)packets?
If I will be successfull building the J1939 in my SW environment, I will try to create a little howto.
If you think this can be useful, I will send it to you.
have a nice day

Signature · 5 lines
Kurt Van Dijck
GRAMMER EiA ELECTRONICS
http://www.eia.be
[email protected]
+32-38708534
author
#5 lore raw
Quoted 8 lines · Kurt Van Dijck <kurt.van.dijck <at> eia.be> writes:
Quoted 6 lines · On Thu, Mar 14, 2013 at 11:17:51AM +0000, Giox79 wrote:
Quoted 1 line · Kurt Van Dijck <kurt.van.dijck <at> eia.be> writes:

Hi Kurt,
thanks for your reply. I have a question related to J1939. My task is to

extract

Quoted 2 lines
Quoted 2 lines

from raw can packets info like oil, brake pressure and so on. Can you tell me if it is right that after building the kernel for my board

using

Quoted 1 line
Quoted 1 line

your modified can driver, and using the jspy utils, I will have only to

build

Quoted 14 lines
Quoted 1 line

the J1939 parser?

I think you could do that without jspy.
You could write a program that connect to a j1939 socket, similar to jspy, and listen to any packet that if of your interest.
You would get the PGN's as binary streams (possible >8 bytes)

Your program will get quite straight-forward then.

I assume you won't need Address Claiming, since you're watching generic PGN's?

Quoted 3 lines

Is there any utility that will allow me parsing the standard (not vendor dependent)packets?
If I will be successfull building the J1939 in my SW environment, I will try

to

Quoted 4 lines
Quoted 3 lines

create a little howto.
If you think this can be useful, I will send it to you. have a nice day

Hi Kurt, thanks a lot for your help.
You are right as far as I know about can, I do not need address claiming, I have to implement a can2lan converter and to support translation of standard can messages to an more "clear" form (creating web pages or something like that).

In order to integrate your libs to my kernel, I was supposing to make a diff between source file, looking mainly at can and iproute2, merge the diffs and build the whole system.
Do you think this is the right approach?
Thanks a lot for your useful help

#6 lore raw
Quoted 6 lines · On Thu, Mar 14, 2013 at 04:20:08PM +0000, Giox79 wrote:

Kurt Van Dijck <kurt.van.dijck <at> eia.be> writes:

In order to integrate your libs to my kernel, I was supposing to make a diff between source file, looking mainly at can and iproute2, merge the diffs and build the whole system.
Do you think this is the right approach?

no. I (just) prepared the repositories to allow easy merges.

follow these steps (@Marc, can you just verify the 'git' calls):

git clone your kernel, or get a stable one

	$ git clone http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
... this takes time
	$ cd linux-stable
	$ git tag
choose a version, like v3.3, or v3.8, ...
	$ git checkout <chosen-version>
	$ git checkout -b <new-branch-name>
This last command creates a new branch, so you can play freely.
Now choose your branch on http://gitorious.org/~kurt-vd/linux-can/linux-can-j1939
, like j1939-v3.3
	$ git pull git://gitorious.org/~kurt-vd/linux-can/linux-can-j1939.git <gitorious-branch-name>

If this all went ok, then you're ready now.

The same applies for can-utils & iproute2.
You could also clone my j1939 versions directly if you do not care about the precise versions, like:

	$ git clone -b <gitorious-branch-name> git://gitorious.org/~kurt-vd/linux-can/iproute2-j1939
with <gitorious-branch-name> something like 'j1939-v3.6'.
In contrast to the kernel, I never modify iproute2 besides j1939 stuff,
so this would work very fine.
Even an .tgz export could work then.

Kind regards,
Kurt

author
#7 lore raw
Quoted 8 lines · Kurt Van Dijck <kurt.van.dijck <at> eia.be> writes:
Quoted 6 lines · On Thu, Mar 14, 2013 at 04:20:08PM +0000, Giox79 wrote:

Kurt Van Dijck <kurt.van.dijck <at> eia.be> writes:

In order to integrate your libs to my kernel, I was supposing to make a diff between source file, looking mainly at can and iproute2, merge the diffs and build the whole system.
Do you think this is the right approach?

Quoted 6 lines

no. I (just) prepared the repositories to allow easy merges.

follow these steps (@Marc, can you just verify the 'git' calls):

git clone your kernel, or get a stable one

	$ git clone http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-

stable.git

Quoted 8 lines

... this takes time

	$ cd linux-stable
	$ git tag
choose a version, like v3.3, or v3.8, ...
	$ git checkout <chosen-version>
	$ git checkout -b <new-branch-name>
This last command creates a new branch, so you can play freely.
Now choose your branch on http://gitorious.org/~kurt-vd/linux-can/linux-can-

j1939

Quoted 2 lines

, like j1939-v3.3

	$ git pull git://gitorious.org/~kurt-vd/linux-can/linux-can-j1939.git 

<gitorious-branch-name>

Quoted 7 lines

If this all went ok, then you're ready now.

The same applies for can-utils & iproute2.
You could also clone my j1939 versions directly if you do not care about the precise versions, like:

	$ git clone -b <gitorious-branch-name> git://gitorious.org/~kurt-

vd/linux-can/iproute2-j1939

Quoted 5 lines

with <gitorious-branch-name> something like 'j1939-v3.6'.
In contrast to the kernel, I never modify iproute2 besides j1939 stuff, so this would work very fine.
Even an .tgz export could work then.

Quoted 8 lines

Kind regards,
Kurt
--
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

Kurt, thanks a lot for your great help.
I will give it a try during the weekend, I have to use a customized linux kernel based on 3.6, so I will apply the suggested steps skipping the git to download official linux kernel.
I will let you know my tests results. At present time, thanks again and congratulation for your work.

#8 lore raw
In reply to Kurt Van Dijck
Quoted 10 lines · Kurt Van Dijck
Quoted 6 lines · On Thu, Mar 14, 2013 at 04:20:08PM +0000, Giox79 wrote:

Kurt Van Dijck <kurt.van.dijck <at> eia.be> writes:

In order to integrate your libs to my kernel, I was supposing to make a diff between source file, looking mainly at can and iproute2, merge the diffs and build the whole system.
Do you think this is the right approach?

no. I (just) prepared the repositories to allow easy merges.

follow these steps (@Marc, can you just verify the 'git' calls):

:) Looks good.

Quoted 12 lines

git clone your kernel, or get a stable one

	$ git clone http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
... this takes time
	$ cd linux-stable
	$ git tag
choose a version, like v3.3, or v3.8, ...
	$ git checkout <chosen-version>
	$ git checkout -b <new-branch-name>
This last command creates a new branch, so you can play freely.
Now choose your branch on http://gitorious.org/~kurt-vd/linux-can/linux-can-j1939
, like j1939-v3.3
	$ git pull git://gitorious.org/~kurt-vd/linux-can/linux-can-j1939.git <gitorious-branch-name>

I would add Kurt's tree as a remote, instead of pull do:

git remote add -f kurt git://gitorious.org/~kurt-vd/linux-can/linux-can-j1939.git
git merge kurt/<gitorious-branch-name>

If you already have a git tree, you can start with the "git remote add".

Marc

Signature · 4 lines
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |
author
#9 lore raw
In reply to Kurt Van Dijck
Quoted 8 lines · Kurt Van Dijck <kurt.van.dijck <at> eia.be> writes:
Quoted 6 lines · On Thu, Mar 14, 2013 at 04:20:08PM +0000, Giox79 wrote:

Kurt Van Dijck <kurt.van.dijck <at> eia.be> writes:

In order to integrate your libs to my kernel, I was supposing to make a diff between source file, looking mainly at can and iproute2, merge the diffs and build the whole system.
Do you think this is the right approach?

Quoted 6 lines

no. I (just) prepared the repositories to allow easy merges.

follow these steps (@Marc, can you just verify the 'git' calls):

git clone your kernel, or get a stable one

	$ git clone http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-

stable.git

Quoted 8 lines

... this takes time

	$ cd linux-stable
	$ git tag
choose a version, like v3.3, or v3.8, ...
	$ git checkout <chosen-version>
	$ git checkout -b <new-branch-name>
This last command creates a new branch, so you can play freely.
Now choose your branch on http://gitorious.org/~kurt-vd/linux-can/linux-can-

j1939

Quoted 2 lines

, like j1939-v3.3

	$ git pull git://gitorious.org/~kurt-vd/linux-can/linux-can-j1939.git 

<gitorious-branch-name>

Quoted 7 lines

If this all went ok, then you're ready now.

The same applies for can-utils & iproute2.
You could also clone my j1939 versions directly if you do not care about the precise versions, like:

	$ git clone -b <gitorious-branch-name> git://gitorious.org/~kurt-

vd/linux-can/iproute2-j1939

Quoted 5 lines

with <gitorious-branch-name> something like 'j1939-v3.6'.
In contrast to the kernel, I never modify iproute2 besides j1939 stuff, so this would work very fine.
Even an .tgz export could work then.

Quoted 8 lines

Kind regards,
Kurt
--
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

Kurt, thanks again for your help.
Today I received the board on which I have to develop the SW system, and the Kernel ported to this specific EVM is a 2.6.35.3, so I won't be able to use on the original patched source code the approach that you suggested, since I'm not using a kernel 3 release.

I think that at present time I have to change my approach. I will try to follow the idea that you suggested me, starting from official kernel releases, and I will ask EVM SW producers to help me figure out what kind of patches I will have to apply in order to support their HW.
Thanks again for your help, you have been really kind.
May be in the next week I will have some news.
Giovanni