Tracker One CANbus + J1939 questions

Are you using only one board as the simulator? Or do you have two?

I think you need two in order to simulate a working can bus, or this kit:

SAE J1939 Starter Kit And Network Simulator

Only one board and the tracker one will not be enough.

I use the isolated CAN adapter (link below) for debugging. There is another one slightly cheaper that doesn't use isolation. Isolation is a benefit when you may have slightly different ground/signal potentials on your computer versus the equipment you are connecting to.

I'm using two of them to create a canbus network. I'm not sure if there any thing to do with CANID:

unsigned long OBD_CAN_REQUEST_ID = 0x18EA00FE;
1 Like

@eberseth Just wondering if you have successfully transmitted J1939 message using the same library. I'm narrowing down the root cause of the issue.

Thanks Gustavo

@Genius J1939 is on the near term roadmap for Monitor One and that work would be applicable for Tracker One. I am suspecting your problem has more to do with the CAN bus in particular since you call into the basic sendMsgBuf() function and it fails with a timeout. The CAN controller employs a small FIFO buffer in hardware that is fed by the sendMsgBuf() call. If there electrical issues with the bus then the transmitter may get clogged up and pass back the timeout error. The adapter I use (Amazon link above) will show an error message in PCANView that the bus is not stable. I would suggest checking that proper termination is present and some kind of scope probing of the bus to make sure there is bus activity is a first step.

1 Like

@eberseth, Thanks for your advice! I've made significant progress with the Tracker One and its ability to send J1939 messages. By re-initializing the CAN controller unit in the setup() function, I managed to enable message transmission successfully.

To achieve this, I followed these steps in the setup() function:

// Set STBY low to enable the transmitter and high-speed receiver
pinMode(CAN_STBY, OUTPUT);
digitalWrite(CAN_STBY, LOW);

// Enable the CAN interrupt pin as an input, just in case
pinMode(CAN_INT, INPUT);

// Hardware reset the CAN controller. Though not necessary, it doesn't hurt to do so.
pinMode(CAN_RST, OUTPUT);
digitalWrite(CAN_RST, LOW);
delay(100);
digitalWrite(CAN_RST, HIGH);

It's worth mentioning that I discovered a similar function called init_can in the tracker.cpp file, which performs the same operations as the script above. Surprisingly, while the Tracker One can receive J1939 messages flawlessly, it encountered difficulties when attempting to transmit them.

1 Like

Does this mean the Monitor One does not support J1939? Has this changed since the original post? Does the Tracker one?

Hi, and welcome to the community.

Both devices, Tracker and Monitor One, support CanBus and since J1939 is built on top, they support it too.

1 Like

That is what I would have expected, any ideas why my j1939 messages do not log to the serial bus when I do the following but CANopen will.


// CAN Setup
MCP_CAN canInterface(CAN_CS, SPI1);
unsigned char rxBuf[8];
unsigned long rxId;

... in loop
Edge::instance().loop();
canInterface.readMsgBufID(&rxId, &can_len, rxBuf);
 Log.info("CAN message received %lx %d", rxId, can_len);

Hey, did you look at all the code I provided in this post above?

On top of that, you need to tell us how you connected the monitor one on the bus.
Cheers.

It's connected via the m12 on the monitor one can high can low. Pretty sure it's connected correctly as CANopen is received fine.

Why are filters necessary if I want to see everything on the bus? Can't I just let everything in the buffer and only enter my loop based on a id check?

Hi, what is connected here? A vehicle, another board?

I use a PEAK adapter to transmit can messages

Fixed: For anyone else with this issue,

I initially assumed the default mask/filter would allow all messages, but it turns out that's not the case.

I had to manually set it to accept J1939 messages by doing the following:

// Set mask to 0x00000000 to accept all messages
canInterface.init_Mask(0, 1, 0x00000000);
// Set filters to 0x00000000 to match all messages
canInterface.init_Filt(0, 1, 0x00000000);
canInterface.init_Filt(1, 1, 0x00000000);

This configuration ensures that all messages are accepted.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.