https://github.com/furkankayam/raspberrypi-arduino-canbus-transceiver
✅ A guide for setting up and configuring a CANBUS communication system using Raspberry Pi and Arduino Uno.
https://github.com/furkankayam/raspberrypi-arduino-canbus-transceiver
arduino canbus mcp2515 raspberry-pi rs485-canbus-shield
Last synced: 7 months ago
JSON representation
✅ A guide for setting up and configuring a CANBUS communication system using Raspberry Pi and Arduino Uno.
- Host: GitHub
- URL: https://github.com/furkankayam/raspberrypi-arduino-canbus-transceiver
- Owner: furkankayam
- License: mit
- Created: 2025-02-22T22:54:46.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2025-02-22T23:03:07.000Z (8 months ago)
- Last Synced: 2025-02-23T00:21:40.179Z (8 months ago)
- Topics: arduino, canbus, mcp2515, raspberry-pi, rs485-canbus-shield
- Language: CSS
- Homepage: https://www.youtube.com/shorts/2ejURUbglEA
- Size: 1.09 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: ReadMe.md
- License: LICENSE
Awesome Lists containing this project
README
# 🚐🖧 Raspberry Pi - Arduino Uno CANBUS Transceiver
✅ A guide for setting up and configuring a CANBUS communication system using Raspberry Pi and Arduino Uno.
![]()
## ⚙️ Setup and Configuration
### 1️⃣ Enabling the SPI Interface
```sh
sudo raspi-config
```- **Interface Options** -> **Enable SPI**
- ### 2️⃣ Updating `config.txt`
```sh
sudo nano /boot/firmware/config.txt
```Add the following lines at the end of the file:
```sh
dtparam=spi=on
dtoverlay=mcp2515-can0, oscillator=12000000, interrupt=25, spimaxfrequency=20000000
dtoverlay=spi-bcm2835-overlay
```### 3️⃣ Restarting the System
```sh
sudo reboot
```### 4️⃣ Installing Required Tools
```sh
sudo apt-get install can-utils
```### 5️⃣ Restarting the System Again
```sh
sudo reboot
```### 6️⃣ Enabling the CANBUS Interface
```sh
sudo ip link set can0 up type can bitrate 500000
```- `ifconfig`
### 7️⃣ Installing the Python CAN Library
```sh
sudo apt update
sudo apt install python3-can
```### 8️⃣ Running the Python Code
```sh
python3 raspberry-pi-canbus-transmitter.py
```
## 🔄 Setting Up Systemd for Auto-Starting CANBUS
### 1️⃣ Creating the `can0.service` File
```sh
sudo nano /etc/systemd/system/can0.service
```The content should be as follows:
```ini
[Unit]
Description=CAN0 Interface Up
After=network.target[Service]
Type=oneshot
ExecStart=/sbin/ip link set can0 up type can bitrate 500000
RemainAfterExit=yes[Install]
WantedBy=multi-user.target
```### 2️⃣ Loading and Enabling the Systemd Service
```sh
sudo systemctl daemon-reload
sudo systemctl enable can0.service
sudo systemctl start can0.service
```### 3️⃣ Final Checks and Restarting
```sh
sudo reboot
```---
### 📜 License
This project is licensed under the MIT License. For more details, see the [LICENSE](LICENSE) file.