add extra can device
This commit is contained in:
2026-02-14 14:32:40 +01:00
parent e00c4978d9
commit 8932773602
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -92,9 +92,11 @@ Append this to /boot/config.txt
``` ```
dtparam=spi=on dtparam=spi=on
dtoverlay=mcp2515-can0,spi0-0,oscillator=16000000,interrupt=22 dtoverlay=mcp2515-can0,spi0-0,oscillator=16000000,interrupt=22
dtoverlay=mcp2515-can1,spi0-1,oscillator=16000000,interrupt=26
dtoverlay=spi-bcm2835-overlay dtoverlay=spi-bcm2835-overlay
``` ```
Copy can_dev.service to /etc/systemd/system. Reboot to apply changes. Copy can_dev.service to /etc/systemd/system. Reboot to apply changes.
It could be that can0 is switched with can1.
```bash ```bash
sudo cp can_dev.service /etc/systemd/system sudo cp can_dev.service /etc/systemd/system
sudo systemctl enable can_dev.service sudo systemctl enable can_dev.service
+1 -1
View File
@@ -1,6 +1,6 @@
[Unit] [Unit]
Description=setup can device Description=setup can device
[Service] [Service]
ExecStart=/usr/sbin/ip link set can0 up type can bitrate 1000000 ExecStart=/usr/bin/bash -c '/usr/sbin/ip link set can0 up type can bitrate 1000000 && /usr/sbin/ip link set can1 up type can bitrate 1000000'
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target