oats-center / isoblue

ISOBlue Hardware, Avena software, and Deployment Files
MIT License
20 stars 9 forks source link

[WIP] j1939d: Add service #132

Closed abalmos closed 3 years ago

abalmos commented 3 years ago

TODO

  1. [ ] PR changes to jmagnuson/canparse
  2. [ ] Auto configure can interface
  3. [ ] Publish prometheus metrics

The binary can be run like this from git (as long as you have rust installed, see rustup project if needed)

$ cargo run -- vcan0 ./j1939.dbc demo.nats.io --sub_prefix "j1939"

or

```sh
$ CAN_INTERFACE=vcan0 DBC_FILE=./j1939.dbc NATS_SERVER=demo.nats.io NATS_SUB_PREFIX=j1939 cargo run

NATS_SUB_PREFIX will default to "j1939" and can be left out. Current this clashes with cand so you might want to change it.

Example docker-compose (tested on dev05);

  j1939dCan0:
    image: isoblue/j1939d:feature-j1939d
    restart: unless-stopped
    network_mode: "host"
    environment:
      CAN_INTERFACE: can0
      NATS_SERVER: "12.17.0.1"
      DBC_FILE: "/j1939.dbc"
      NATS_SUB_PREFIX: j1939
    volumes:
       - ./j1939.dbc:/j1939.dbc
  j1939dCan1:
    image: isoblue/j1939d:feature-j1939d
    restart: unless-stopped
    network_mode: "host"
    environment:
      CAN_INTERFACE: can1
      NATS_SERVER: "12.17.0.1"
      DBC_FILE: "/j1939.dbc"
      NATS_SUB_PREFIX: j1939
    volumes:
       - ./j1939.dbc:/j1939.dbc       

NOTE: For now, you must manually place the j1939.dbc file next to container-maintainer's docker-compose file on the node itself.

abalmos commented 3 years ago

This is dependent on some changes to jmagnuson/canparse and now lives oats-center/canparse@92f26e1 for now