
Canbus-MCP2515-Raspi
Guía de instalación del módulo CANBUS MCP2515 en RaspberryPi
2
Github Watches
9
Github Forks
36
Github Stars
MCP2515 CANBus module installation on RaspberryPi
It is aimed to build CANBus communication between two Raspberry Pi boards. This setup is accomplished with the Microchip's stand-alone MCP2515 CAN controller.
Project Items
1 RaspberryPi 3 Model B+ (Raspi1)
1 RaspberryPi 3 Model B v1.2 (Raspi2)
2 MCP2515 CAN Bus Module TJA1050 Receiver SPI (CanModule1, CanModule2)
Environmental Setup
High Level Design
Raspi1 --(SPIcomm)-- CanModule1 ==<CANbus H,L>== CanModule2 --(SPIComm)-- Raspi2
Wiring Diagrams
MCP2515
Note: Modification is required! Since TJA1050 CAN Transciver operates at 4.75V~5.25V (Typically @5V), it is necessary to add Vdd 5V input pin to the module besides Vcc 3.3V. It is explained how the MCP2515 CAN module is adjusted below along with the pictures.
<img" alt="Canbus-MCP2515-Raspi image"> 1.MCP2515 CANBus Module
<img" alt="Canbus-MCP2515-Raspi image"> 2.Find the Vcc trace for TJA1050
<img" alt="Canbus-MCP2515-Raspi image"> 3.Cut the copper trace to replace with 5V
<img" alt="Canbus-MCP2515-Raspi image"> 4.Scrape the insulator to make soldering over the trace.
<img" alt="Canbus-MCP2515-Raspi image"> 5.Solder the jumper wire
<img" alt="Canbus-MCP2515-Raspi image"> 6.Put some silicon to strength the connection
<img" alt="Canbus-MCP2515-Raspi image"> 7.I preferably replace the 7 pin male headers with 8 pin Male PCB Mounting Right Angle connector
<img" alt="Canbus-MCP2515-Raspi image"> 8.Overall board with modification
Installation
Download Updates:
sudo apt-get update
sudo apt-get upgrade
sudo reboot
Enable SPI:
Applications Menu --> Preferences --> Raspberry Pi Configuration --> Interfaces --> Select SPI Enabled
OR
sudo raspi-config
5 Interfacing Options --> P4 SPI --> Yes --> The SPI interface is enabled --> Finish
Check Kernel version:
uname -a
Linux raspberrypi 4.19.42-v7+ 1219 SMP Tue May 14 21:20:58 BST 2019 armv71 GNU/Linux
Modify config.txt:
For later kernels (4.4.x onwards)
sudo nano /boot/config.txt
Add the following setup at the end of the file:
dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=8000000,interrupt=25
dtoverlay=spi-bcm2835
dtoverlay=spi-dma
<img" alt="Canbus-MCP2515-Raspi image">
<img" alt="Canbus-MCP2515-Raspi image">
Save: CTRL + X --> Enter
sudo reboot
Install Can-utils:
sudo apt-get install autoconf autogen
sudo apt-get install libtool
git clone https://github.com/linux-can/can-utils.git
cd can-utils
./autogen.sh
./configure
make
sudo make install
sudo apt-get install can-utils
sudo reboot
can0 Availability Check
Full circuit wiring must be completed before checking the related folder. And do not miss having common ground, since there is not any additional GND pin for Can transmission lines (CAN_H, CAN_L).
sys --> bus --> spi --> devices --> spi0.0 --> net --> can0
OR
ls /sys/bus/spi/devices/spi0.0/net
<img" alt="Canbus-MCP2515-Raspi image">
If there is not can0 folder in the specified directory, check config.txt and ensure that:
dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=8000000,interrupt=25
dtoverlay=spi-bcm2835
dtoverlay=spi-dma
AND check the connections in the circuit.
Test: Sending data from RasPi1 to RasPi2
RasPi1
sudo ip link set can0 up type can bitrate 500000
cansend can0 100#12FF34AA56DD66
<img" alt="Canbus-MCP2515-Raspi image">
Raspi2
sudo ip link set can0 up type can bitrate 500000
candump can0
<img" alt="Canbus-MCP2515-Raspi image">
Learn More
RaspberryPi 3 Model B+
https://en.wikipedia.org/wiki/Raspberry_Pi
https://pinout.xyz/
MCP2515 Can Controller
https://www.microchip.com/wwwproducts/en/en010406
http://ww1.microchip.com/downloads/en/DeviceDoc/MCP2515-Stand-Alone-CAN-Controller-with-SPI-20001801J.pdf
https://www.nxp.com/docs/en/data-sheet/TJA1050.pdf
相关推荐
I find academic articles and books for research and literature reviews.
Confidential guide on numerology and astrology, based of GG33 Public information
Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.
Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.
Advanced software engineer GPT that excels through nailing the basics.
Converts Figma frames into front-end code for various mobile frameworks.
Take an adjectivised noun, and create images making it progressively more adjective!
Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.
Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx
La aplicación AI de escritorio todo en uno y Docker con trapo incorporado, agentes de IA, creador de agentes sin código, compatibilidad de MCP y más.
Plataforma de automatización de flujo de trabajo de código justo con capacidades de IA nativas. Combine el edificio visual con código personalizado, auto-anfitrión o nube, más de 400 integraciones.
Un poderoso complemento Neovim para administrar servidores MCP (protocolo de contexto del modelo)
🧑🚀 全世界最好的 llM 资料总结(数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Resumen de los mejores recursos del mundo.
Servidor MCP para obtener contenido de la página web con el navegador sin cabeza de dramaturgo.
Puente entre los servidores Ollama y MCP, lo que permite a LLM locales utilizar herramientas de protocolo de contexto del modelo
Una lista curada de servidores de protocolo de contexto del modelo (MCP)
Reviews

user_bIrMcmlO
The CANBus-MCP2515-Raspi by tolgakarakurt is an excellent tool for integrating CAN bus communication with your Raspberry Pi projects. The setup is straightforward, and the performance is reliable for various applications. The detailed documentation on the GitHub page is very helpful. Highly recommend it for anyone needing CAN bus functionality on their Raspberry Pi.