Skip to content

jw3/example-j1939-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example j1939 with Rust

Experiments in reading j1939 from can bus using socketcan and canparse.

hardware

  • Waveshare RS485/CAN hat

  • overlay activation @ /boot/config.txt
[all]
dtoverlay=mcp2515-can0,oscillator=12000000,interrupt=25,spimaxfrequency=2000000

socketcan iface

modprobe can
modprobe can_raw
ip link set can0 type can bitrate 250000 restart-ms 100
ip link set up can0

check interface with ip addr

4: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP group default qlen 10
    link/can

references

tools

sample data

mdf2socketcan -i LOG/958D2219/00002501/00002081.MF4 -O /tmp/can
canplayer -v -g 1000 -I /tmp/can/00002081_CAN.log vcan0=can0

cross compile

rustup target add armv7-unknown-linux-gnueabihf
sudo apt install gcc-arm-linux-gnueabihf

The following entry is in the Cargo config toml

[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"

https://doc.rust-lang.org/cargo/reference/config.html

cargo build --target=armv7-unknown-linux-gnueabihf

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published