04-28-2022, 07:49 PM
(This post was last modified: 04-28-2022, 08:03 PM by BoostedGS300.)
(04-28-2022, 04:30 AM)oliverisss Wrote:(04-27-2022, 03:13 PM)BoostedGS300 Wrote:Quote:You can try these commands:
sudo /sbin/ip link set can0 up type can bitrate 100000
and
ifconfig
that should show if can0 works correctly.
Thanks, please see the attached images for the results.
I'm not an expert on this. I'm just going through Gecko messages how to troubleshoot this as I had the same problem in very beginning when I bought CarPiHat.
That's on of gecko messages:
Add the following to the bottom of your “/boot/config.txt”
Quote:dtparam=spi=onQuote:dtoverlay=mcp2515-can0,oscillator=8000000,interrupt=23Quote:dtoverlay=spi-bcm2835-overlayAnd then add the following to “/etc/rc.local”
Quote:/sbin/ip link set can0 up type can bitrate 100000After ensuring those are correct, could you please reboot your Pi (with the controller disconnected), and send the the output of the following command:
(Exit Openauto, and then open the “terminal”. Type these commands, hit enter, and send a screenshot / pastebin / photo of the output)
Quote:ifconfigand
Quote:dmesg | grep -iC 3 “MCP2515”
Thanks for you help. I know Gecko is not available. I do have those commands installed and the below information is with the idrive control unplugged. Please see my files at the end to see if I made a mistake. I am not getting any results for the MCP2515 command so I assume thats related to my problems.
Ifconfig;
pi@raspberrypi:~ $ ifconfig
can0: flags=193
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=4099
ether e4:5f:01:1a:48:4b txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4163
inet 192.168.1.17 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::6561:d677:8487:8c3b prefixlen 64 scopeid 0x20 ether e4:5f:01:1a:48:4c txqueuelen 1000 (Ethernet)
RX packets 845 bytes 346771 (338.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1028 bytes 156019 (152.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions
dmesg | grep -iC 3 “MCP2515”
I have no results for this command. I assume this is a problem.
Here is the end of my bootconfig.txt file
[pi3]
gpu_mem=256
max_framebuffers=1
[pi3+]
gpu_mem=256
max_framebuffers=1
[pi4]
max_framebuffers=2
#Canbusinterface
dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=8000000,interrupt=23
dtoverlay=spi-bcm2835-overlay
Here is my rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
/usr/local/bin/rpi4pci.sh
/sbin/ip link set can0 up type can bitrate 100000
echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
sudo hwclock -s
date
exit 0