Skip to content

can-j1939 - trying to emulate an entire truck #511

Open
@mihai-demian

Description

@mihai-demian

First of all, please allow me to thank you for the great work are doing.
I am trying to emulate a truck, meaning that I want to get the information from a game (namely ets2) and send it to a truck dashboard cluster. I managed to put together some parts on the application, where I can send 8byte packages at consistent time intervals, as stated in the j1939 standard (older, found for free online). The BAM message representing the engine configuration is sent correctly from testj1939, but it is not when sent from my application, although everything is the same. I have a BAM message every 5 seconds and some typical messages every 50ms, all happening at the same time. Can this be an issue?
How can I perform a read and write on the same socket without any issues? There is not much to read from the cluster, except for a BAM DM1 message (fault codes) and a reset message to the tachograph.
I have no filters set up. I did not understand how to use them yet, and also not found the reason to implement them since there is no message addressed the part of the application that I'm working on (engine at 0x00).
I attached the application part I wrote as far, but I have a lot more to do.
My plan to have a vcan interface for every controller involved (engine, transmission, retarder, main computer and tachograph), put all of them to the same can interface that is connected with the cluster. Is this approach worth implementing?

I am looking forward for any help.
Thank you.

engine.c.txt
engine.h.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions