rd_j1939 - AboudyKreidieh/truck-code GitHub Wiki

The rd_j1939 process is responsible for periodically searching for messages that have been sent by the j1939 bus. This process receives a message from the J1939 port, the connection to which is initialized by can_man. If any new messages are received, they are converted to their message-specific format (unless specified otherwise) and published to the pub/sub server for use by other processes.

This process contains the following arguments:

  • f : filename for input. This is the file that the process will look to for new messages
  • t : puts bytes from every frame received on stdout
  • g : specifies whether to use "generic" mode. In "generic" mode, write all PDUs to database as byte streams, don't translate into specific PDU formats or assemble multipacket messages.
  • v : specifies whether to run in verbose mode, in which case messages are printed in stdout
  • n : specifies whether to print messages in numeric or non-numeric mode. Only used if the process is running in debug mode.

In order to begin the procedure of collecting J1939 messages, you must first activate the CAN manager (see can_man). Then, type:

./rd_j1939 -f "/path/to/realtime.ini"

If you would like to simply collect messages in their generic (non-processed form) for later analysis (see translate_pdu), this can be done by adding the -g argument as follows:

./rd_j1939 -f "/path/to/realtime.ini" -g

Finally, in order to validate that the rd_j1939 process is functioning properly, you can run the process in trace and verbose form as follows:

./rd_j1939 -f "/path/to/realtime.ini" -t -v

This will result in the terminal streaming the messages from the J-bus before and after they are translated, similar to the figure below.

TODO: add figure

Return to Software Processes