Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!
Pier8283
Published © GPL3+

TCP tunnel over CAN BUS FD with Raspberry Pi

A TCP tunnel over CAN bus FD (Flexible Data-rate) involves encapsulating TCP/IP packets within CAN FD frames.

BeginnerShowcase (no instructions)1 hour1,199
TCP tunnel over CAN BUS FD with Raspberry Pi

Things used in this project

Hardware components

Raspberry Pi 4 Model B
Raspberry Pi 4 Model B
×1
Raspberry Pi 5
Raspberry Pi 5
×1
smart home CANBUS FD Shield V1.4
×2

Software apps and online services

Raspbian
Raspberry Pi Raspbian

Story

Read more

Code

canfd-start.sh

SH
Run the script:
sudo sh canfd-start.sh
to enable can0 and can1 interfaces
#!/bin/sh
#Can
sudo ip link set can0 down
sudo ip link set can1 down

sudo ip link set can0 up type can bitrate 1000000 dbitrate 8000000 restart-ms 1000 berr-reporting on fd on
sudo ip link set can1 up type can bitrate 1000000 dbitrate 8000000 restart-ms 1000 berr-reporting on fd on

sudo ifconfig can0 txqueuelen 65536
sudo ifconfig can1 txqueuelen 65536

Credits

Pier8283

Pier8283

10 projects • 5 followers

Comments