J1939 Library status?

Hi All

I’ve been trawling the internet between Particle and here for any info on a J1939 Library. I’m looking to pick up on gear position (and other details) from an aftermarket TCM which talks J1939.

I appreciate there’s been some discussions in the past, but nothing conclusive. Is this something the Carloop libraries can do?

Thanks in advance for any pointers. This is my first foray into CAN/J1939/etc

Thomas

@UKTamo,

As far as I can tell, the Carloop library should be able to help you out.
Reading on Wikipedia, it looks like J1939 is built on top of CANbus.

If you are using a select few messages to communicate with the TCM, you could probably assemble your own 29-bit extended CANbus message with your J1939 messages built into it.

Then again, if you want to do a number of things, you might be better off to build a J1939 library that depends on the Carloop library. That way your library could translate between your J1939 messages and the 29-bit extended CANbus message. The Carloop library would then handle the lower-level for you.

NOTE: The Carloop hardware is meant for 12V automotive systems. It is not hardware compatible with 24V systems often found in trucks and heavy machinery. If this is the case, all you would need to do is re-design the power (voltage) regulator and the electrical protection.

Hi @cyclin_al1,

Thanks for the response.

Realistically I’m only after 2 or 3 messages to be picked up. The system runs at 12v, so no worries there. If anyone has some working examples for J1939 that’d be great, otherwise I’ll need to see what I can sort!

Thanks

@UKTamo
Have you ever heard of https://copperhilltech.com/ ??
This might get you what you’re looking for. I got the book - I’m just getting started in J1939 stuff (for an ELD device I’m building) but, Wilfred seems to be extremely knowledgable in this area. And helpful. There are libraries, code examples and a whole lot of explanations around J1939.

I’d also be interested in learning more about what you’re doing and integrating J1939.

Nathan

Yep aware of them, but as far as I know it’s arduino only, and I wasn’t sure how compatible if at all they’d be.

@UKTamo & @nathanpdaniel,

I took a look at Copperhill Technologies that you referenced.
It looks like there are some good examples and resources to take a look at.
A couple of things to look out for:

  • They focus on simulating the ECU (or TCM). However, you are looking for the other side. You are looking more for a scan tool example in order to read the data off the existing TCM.
  • They use a J1939 stack directly for Arduino, but do not reveal the source code for the stack. I did not look far enough to see how easy it is to put together a J1939 message. Using Particle & Carloop, you would still need to put together a J1939 message, but then have to convert it into a CANbus message. From there, the Carloop library and the STM32F processor effectively implement a CAN interface.
  • Arduino is based on the Wiring language. Particle devices are also based on the Wiring language. You still have to port the code to account for the hardware differences.