Chaeben
Posts: 4
Joined: Tue Aug 18, 2015 9:23 am

Re: [quick-guide] CAN bus on raspberry pi with MCP2515

Tue Jul 19, 2016 6:52 pm

Hello,

I am quite new to CAN-Bus and Raspberry as that. So please excuse my inexpirence :) .
Currently I am Programming a driver for the MCP2515 on Windows 10 Iot and managed to establish a connection. Though i still have a problem actually reading a valid message :) . Now I am trying to figure out if I am actually sending a vallid message.
I have a system of two raspberrys. The first one is running raspbian and is the device i use to generate a valid CAN-message. The second raspberry is running Windows 10 IoT and shall read the valid message. To see if I even send a valid message I put raspbian on the second Raspberry and try to use

Code: Select all

candump can0
.

When I start both Raspberrys I encounter a funny behaviour of the CAN-Bus. As soon as I put both of the MCP2515 int operating mode, the CAN-Bus doesent send anything anymore. I noticed that when I started to send the message with the first Raspberry and then wanted to start the second Raspberry.

My Oscilloscope showed while sending, that actually something was send. As soon as I put the the second Raspberry in operating mode with teh command

Code: Select all

ip link set can0 up type can bitrate 125000
the line became flat.

Does anybody know how that could be?

I really appriciate every thought that comes to your minds.

Kind Regards

Chaeben

edo1
Posts: 136
Joined: Sun Jun 15, 2014 3:33 pm
Location: Russia

Re: [quick-guide] CAN bus on raspberry pi with MCP2515

Tue Jul 19, 2016 9:41 pm

what does this command show:

Code: Select all

ip -d -s link  show dev can0
?

Chaeben
Posts: 4
Joined: Tue Aug 18, 2015 9:23 am

Re: [quick-guide] CAN bus on raspberry pi with MCP2515

Wed Jul 20, 2016 8:21 am

edo1 wrote:what does this command show:

Code: Select all

ip -d -s link  show dev can0
?
When I tried what you said on the sending device it already told me that I have an error-warn and error-pass. but the message is still send. That i can see on the oscilloscope.
3: can0@NONE: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 10
link/can promiscuity 0
can state ERROR-PASSIVE restart-ms 0
bitrate 125000 sample-point 0.850
tq 400 prop-seg 8 phase-seg1 8 phase-seg2 3 sjw 1
mcp251x: tseg1 3..16 tseg2 2..8 sjw 1..4 brp 1..64 brp-inc 1
clock 5000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 1 1 0
RX: bytes packets errors dropped overrun mcast
0 0 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
Do you know how this can be?

Thank you for your quick reply by the way :) .

edo1
Posts: 136
Joined: Sun Jun 15, 2014 3:33 pm
Location: Russia

Re: [quick-guide] CAN bus on raspberry pi with MCP2515

Wed Jul 20, 2016 2:55 pm

It seems to be caused by different settings (like bitrate) or some hardware issue.
What does show this command on another side?

Chaeben
Posts: 4
Joined: Tue Aug 18, 2015 9:23 am

Re: [quick-guide] CAN bus on raspberry pi with MCP2515

Thu Jul 21, 2016 12:47 pm

I finally found the mistake,
The CAN-Bus went bus-off because both raspberrys had a different ground....
now everything works like a charm.

But thank you for all the help i recived here.

User avatar
saper_2
Posts: 214
Joined: Sun Aug 03, 2014 10:08 am
Location: PL

Re: [quick-guide] CAN bus on raspberry pi with MCP2515

Fri Jul 29, 2016 12:53 pm

Hi,

I've been pestering ahmedawad :) about no ground connection between modules. In his case it worked fine... in your case, it rebound on you :)

MAZdev
Posts: 1
Joined: Tue Aug 23, 2016 12:25 am

Re: [quick-guide] CAN bus on raspberry pi with MCP2515

Tue Aug 23, 2016 12:59 am

Hi
first excuse my english i m not so good :P :oops:

for those who have the the error : cannot find device "can0" it s caused by a bad CAN interface
i had the same probleme with the PICAN and got crazy
so what i did i made it by my selef ( PICAN ) cost me about 5$ to get the parts and now it works fine and a bad wiring will get you the same error.

if any one needs help can contact me at : medali.zayan@esprit.tn
Attachments
14111633_915964708507520_1084945069_n.jpg
14111633_915964708507520_1084945069_n.jpg (33.6 KiB) Viewed 3355 times

vsboost
Posts: 5
Joined: Mon Mar 21, 2016 12:28 am

Re: [quick-guide] CAN bus on raspberry pi with MCP2515

Wed Aug 31, 2016 5:45 am

Anybody try send a can frame when a specific one is received, for example i would like to listen to the bus and when the message for steering wheel button pressed is received to then send a can message of my choice back on the bus?

elfun
Posts: 1
Joined: Wed Sep 14, 2016 6:50 am

Re: [quick-guide] CAN bus on raspberry pi with MCP2515

Wed Sep 14, 2016 6:55 am

Hi.
Can help to use "pin36, BCM16 , CE2", as pin CS. Thank

Regards

njoshy
Posts: 9
Joined: Fri Oct 07, 2016 9:00 am

Re: [quick-guide] CAN bus on raspberry pi with MCP2515

Tue Oct 11, 2016 1:39 pm

Chaeben wrote:Hello,

I am quite new to CAN-Bus and Raspberry as that. So please excuse my inexpirence :) .
Currently I am Programming a driver for the MCP2515 on Windows 10 Iot and managed to establish a connection. Though i still have a problem actually reading a valid message :) . Now I am trying to figure out if I am actually sending a vallid message.
I have a system of two raspberrys. The first one is running raspbian and is the device i use to generate a valid CAN-message. The second raspberry is running Windows 10 IoT and shall read the valid message. To see if I even send a valid message I put raspbian on the second Raspberry and try to use

Code: Select all

candump can0
.

When I start both Raspberrys I encounter a funny behaviour of the CAN-Bus. As soon as I put both of the MCP2515 int operating mode, the CAN-Bus doesent send anything anymore. I noticed that when I started to send the message with the first Raspberry and then wanted to start the second Raspberry.

My Oscilloscope showed while sending, that actually something was send. As soon as I put the the second Raspberry in operating mode with teh command

Code: Select all

ip link set can0 up type can bitrate 125000
the line became flat.

Does anybody know how that could be?

I really appriciate every thought that comes to your minds.

Kind Regards

Chaeben
Can you please share the driver you used for setting up PiCAN with Raspberry Pi 3?

berne
Posts: 24
Joined: Sat Sep 24, 2016 10:53 pm

Re: [quick-guide] CAN bus on raspberry pi with MCP2515

Sun Oct 23, 2016 8:40 pm

Code: Select all

pi@piv2:~ $ sudo ip link set can0 up type can bitrate 125000
after that one iam geting:

RTNETLINK answers: Device or resource busy
is that good or bad:S


EDIT:

Code: Select all

dtoverlay=mcp2515-can0,oscillator=8000000,interrupt=12
dtoverlay=spi-bcm2835-overlay
just wonder, i have checkt my one up, and i have mcp2551. and iam using gpio, do i still need to add this code?

Code: Select all

oscillator=8000000,interrupt=12
?

pitchlynn
Posts: 16
Joined: Sun Oct 23, 2016 9:11 pm

Re: [quick-guide] CAN bus on raspberry pi with MCP2515

Sun Oct 23, 2016 9:20 pm

by vsboost » Wed Aug 31, 2016 5:45 am
Anybody try send a can frame when a specific one is received, for example i would like to listen to the bus and when the message for steering wheel button pressed is received to then send a can message of my choice back on the bus?
I am interested in doing this as well. Right now I am setting up a pi zero with a can bus adapter similar to the original poster. I understand how to get setup to do candump, cansniffer, cansend, etc. but I don't know yet how to implement this in a custom program. I'm assuming it will be a python script but being new to raspberry I don't understand where/how that program exist and what the syntax will be to interface with the canbus. Can someone point me in the right direction to start understanding this?

pitchlynn
Posts: 16
Joined: Sun Oct 23, 2016 9:11 pm

Re: [quick-guide] CAN bus on raspberry pi with MCP2515

Mon Oct 24, 2016 2:50 pm

Has anyone found a can bus adapter that includes level shift or maybe separate power so the board didn't need to be modified?

berne
Posts: 24
Joined: Sat Sep 24, 2016 10:53 pm

Re: [quick-guide] CAN bus on raspberry pi with MCP2515

Mon Oct 24, 2016 9:59 pm

pitchlynn wrote:Has anyone found a can bus adapter that includes level shift or maybe separate power so the board didn't need to be modified?
http://skpang.co.uk/catalog/pican2-canb ... -1475.html

pitchlynn
Posts: 16
Joined: Sun Oct 23, 2016 9:11 pm

Re: [quick-guide] CAN bus on raspberry pi with MCP2515

Tue Oct 25, 2016 2:44 am

berne wrote:
pitchlynn wrote:Has anyone found a can bus adapter that includes level shift or maybe separate power so the board didn't need to be modified?
http://skpang.co.uk/catalog/pican2-canb ... -1475.html
It does look like there are separate power rails for the two chips in the pican2 schematic. But, I don't see VCC (pin 18). That is strange. Do you think it can be powered through the reset pin or is that just a mistake on the schematic?

http://skpang.co.uk/catalog/images/rasp ... _rev_B.pdf

The pican2 was the first can adapter I looked at when I was planning to use a pi 3 but now that I'm using a pi zero the shield convenience isn't worth it to me. I'm going to go with the board mod and the cheaper can adapter.

pitchlynn
Posts: 16
Joined: Sun Oct 23, 2016 9:11 pm

Re: [quick-guide] CAN bus on raspberry pi with MCP2515

Wed Oct 26, 2016 12:11 am

saper_2 wrote: 4. (optional) Check if can interface is available, as you can see I list spi0.0 (CE0) SPI devices, I have net\can0 dir in spi0.0 so can should works fine:

Code: Select all

pi@piv2:~ $ ls /sys/bus/spi/devices/spi0.0
driver  modalias  net  of_node  subsystem  uevent
pi@piv2:~ $ ls /sys/bus/spi/devices/spi0.0/net
can0
pi@piv2:~ $ ls /sys/bus/spi/devices/spi0.0
driver  modalias  net  of_node  subsystem  uevent
pi@piv2:~ $ ls /sys/bus/spi/devices/spi0.0/net/
can0
pi@piv2:~ $ ls /sys/bus/spi/devices/spi0.0/net/can0/
addr_assign_type  carrier_changes  duplex             iflink            operstate       speed         uevent
address           device           flags              link_mode         phys_port_id    statistics
addr_len          dev_id           gro_flush_timeout  mtu               phys_port_name  subsystem
broadcast         dev_port         ifalias            name_assign_type  phys_switch_id  tx_queue_len
carrier           dormant          ifindex            netdev_group      queues          type
[/i]
I'm trying to follow the software instructions and getting stuck on step 4. The first ls command doesn't show the same directory structure and the second ls command doesn't show a can0 folder. I think it could be because I'm using Jessie lite instead of full. Is there extra step I need to take to make this work on lite or will this only work with full? Am I missing a driver that maybe can be installed separately?

This is what I'm getting:

Code: Select all

pi@raspberrypi:/ $ ls /sys/bus/spi/devices/spi0.0
modalias  of_node  power  statistics  subsystem  uevent
pi@raspberrypi:/ $ cd /sys/bus/spi/devices/spi0.0/net
-bash: cd: /sys/bus/spi/devices/spi0.0/net: No such file or directory

berne
Posts: 24
Joined: Sat Sep 24, 2016 10:53 pm

Re: [quick-guide] CAN bus on raspberry pi with MCP2515

Thu Oct 27, 2016 9:00 pm

pitchlynn wrote:
saper_2 wrote: 4. (optional) Check if can interface is available, as you can see I list spi0.0 (CE0) SPI devices, I have net\can0 dir in spi0.0 so can should works fine:

Code: Select all

pi@piv2:~ $ ls /sys/bus/spi/devices/spi0.0
driver  modalias  net  of_node  subsystem  uevent
pi@piv2:~ $ ls /sys/bus/spi/devices/spi0.0/net
can0
pi@piv2:~ $ ls /sys/bus/spi/devices/spi0.0
driver  modalias  net  of_node  subsystem  uevent
pi@piv2:~ $ ls /sys/bus/spi/devices/spi0.0/net/
can0
pi@piv2:~ $ ls /sys/bus/spi/devices/spi0.0/net/can0/
addr_assign_type  carrier_changes  duplex             iflink            operstate       speed         uevent
address           device           flags              link_mode         phys_port_id    statistics
addr_len          dev_id           gro_flush_timeout  mtu               phys_port_name  subsystem
broadcast         dev_port         ifalias            name_assign_type  phys_switch_id  tx_queue_len
carrier           dormant          ifindex            netdev_group      queues          type
[/i]
I'm trying to follow the software instructions and getting stuck on step 4. The first ls command doesn't show the same directory structure and the second ls command doesn't show a can0 folder. I think it could be because I'm using Jessie lite instead of full. Is there extra step I need to take to make this work on lite or will this only work with full? Am I missing a driver that maybe can be installed separately?

This is what I'm getting:

Code: Select all

pi@raspberrypi:/ $ ls /sys/bus/spi/devices/spi0.0
modalias  of_node  power  statistics  subsystem  uevent
pi@raspberrypi:/ $ cd /sys/bus/spi/devices/spi0.0/net
-bash: cd: /sys/bus/spi/devices/spi0.0/net: No such file or directory

im thinks its becouse of the kernel in the new update 2016-09-23.

got the same, and have test it before and that step, work like a charm.

pitchlynn
Posts: 16
Joined: Sun Oct 23, 2016 9:11 pm

Re: [quick-guide] CAN bus on raspberry pi with MCP2515

Fri Oct 28, 2016 3:15 am

berne wrote:
pitchlynn wrote:
saper_2 wrote: 4. (optional) Check if can interface is available, as you can see I list spi0.0 (CE0) SPI devices, I have net\can0 dir in spi0.0 so can should works fine:

Code: Select all

pi@piv2:~ $ ls /sys/bus/spi/devices/spi0.0
driver  modalias  net  of_node  subsystem  uevent
pi@piv2:~ $ ls /sys/bus/spi/devices/spi0.0/net
can0
pi@piv2:~ $ ls /sys/bus/spi/devices/spi0.0
driver  modalias  net  of_node  subsystem  uevent
pi@piv2:~ $ ls /sys/bus/spi/devices/spi0.0/net/
can0
pi@piv2:~ $ ls /sys/bus/spi/devices/spi0.0/net/can0/
addr_assign_type  carrier_changes  duplex             iflink            operstate       speed         uevent
address           device           flags              link_mode         phys_port_id    statistics
addr_len          dev_id           gro_flush_timeout  mtu               phys_port_name  subsystem
broadcast         dev_port         ifalias            name_assign_type  phys_switch_id  tx_queue_len
carrier           dormant          ifindex            netdev_group      queues          type
[/i]
I'm trying to follow the software instructions and getting stuck on step 4. The first ls command doesn't show the same directory structure and the second ls command doesn't show a can0 folder. I think it could be because I'm using Jessie lite instead of full. Is there extra step I need to take to make this work on lite or will this only work with full? Am I missing a driver that maybe can be installed separately?

This is what I'm getting:

Code: Select all

pi@raspberrypi:/ $ ls /sys/bus/spi/devices/spi0.0
modalias  of_node  power  statistics  subsystem  uevent
pi@raspberrypi:/ $ cd /sys/bus/spi/devices/spi0.0/net
-bash: cd: /sys/bus/spi/devices/spi0.0/net: No such file or directory

im thinks its becouse of the kernel in the new update 2016-09-23.

got the same, and have test it before and that step, work like a charm.
Are you saying that something changed in the new kernel? This would make sense. I picked up a larger sd card so I could install full jessie since that was the only thing I was doing different from the op instructions. I got the same exact results. Does anyone know what needs to change to make this work with the latest kernel?

krunch
Posts: 7
Joined: Sat Mar 28, 2015 2:50 pm

Re: [quick-guide] CAN bus on raspberry pi with MCP2515

Fri Oct 28, 2016 7:14 am

Hi Folks,

I hope you may provide some helping hints on the following problem:

I cannot get the MCP2515 to run with SPI0.1 but it is working just great with SPI0.0.

First to the setup

Raspberry Pi 2
2 x CAN Click Board equipped w/ MCP2515 (Manufacture: MikroElektronika- MikroE 986)
1 x Pi2 Click Shield (Manufacture: MikroElektronika)
OS: Raspbian

Code: Select all

 pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.4.26-v7+ #915 SMP Thu Oct 20 17:08:44 BST 2016 armv7l GNU/Linux
but I've also tried it on Kernel level 4.1.1; Same Result. The MCP2515 connected to SPI0.0 runs just fine whereas the module connected to SPI0.1 stays "dead".

Just to rule out any wiring problems. I've everything double i.e 2xRasPi 2, 2x Click Shield, .etc and I've tried all kind of combinations. But always the same negative result. Since I'm the kind of "Belt and Suspenders" guy I even pinged the circuits through 3 times with a multimeter. Everything okay - Click Board Position 1 interfaces with the ChipSelect pin (GPIO 8) for SPI0.0 and uses GPIO 6 as interrupt and the module in Click Board Position 2 interfaces with ChipSelect pin (GPIO 7) for SPI0.1 and uses GPIO 26 as the interrupt line.

The necessary entries in /boot/config.txt (no dtoverlay=bcm-2835... is required with the lastest kernel) are in place

Code: Select all

pi@raspberrypi:~ $ cat /boot/config.txt | grep -i mcp
dtoverlay=mcp2515-can1,oscillator=10000000,interrupt=26
dtoverlay=mcp2515-can0,oscillator=10000000,interrupt=6
However when I try to start can1 the system tells that it can't find the device "can1"

Code: Select all

pi@raspberrypi:~ $ sudo ip link set can1 up type can bitrate 500000
Cannot find device "can1"
I don't see any "problems" while loading the overlay during boot

Code: Select all

pi@raspberrypi:~ $ sudo vcdbg log msg
000980.034: HDMI:EDID version 1.3, 1 extensions, screen size 52x32 cm
000980.098: HDMI:EDID features - videodef 0x80 standby suspend active off; colour encoding:RGB444|YCbCr422; sRGB is not default colourspace; preferred format is native; does not support GTF
000980.190: HDMI:EDID found preferred DMT detail timing format: 1920x1200p @ 60 Hz (68)
000980.231: HDMI:EDID found DMT format: code 4, 640x480p @ 60 Hz in established timing I/II
000980.270: HDMI:EDID found DMT format: code 6, 640x480p @ 75 Hz in established timing I/II
000980.306: HDMI:EDID found DMT format: code 9, 800x600p @ 60 Hz in established timing I/II
000980.344: HDMI:EDID found DMT format: code 11, 800x600p @ 75 Hz in established timing I/II
000980.383: HDMI:EDID found DMT format: code 16, 1024x768p @ 60 Hz in established timing I/II
000980.421: HDMI:EDID found DMT format: code 18, 1024x768p @ 75 Hz in established timing I/II
000980.463: HDMI:EDID found DMT format: code 36, 1280x1024p @ 75 Hz in established timing I/II
000980.548: HDMI:EDID standard timings block x 8: 0x8180 A940 D100 714F 0101 0101 0101 0101 
000980.599: HDMI:EDID found DMT format: code 35, 1280x1024p @ 60 Hz (5:4) in standard timing 0
000980.649: HDMI:EDID found DMT format: code 51, 1600x1200p @ 60 Hz (4:3) in standard timing 1
000980.700: HDMI:EDID found DMT format: code 69, 1920x1200p @ 60 Hz (16:10) in standard timing 2
000980.748: HDMI:EDID found DMT format: code 21, 1152x864p @ 75 Hz (4:3) in standard timing 3
000993.754: HDMI:EDID parsing v3 CEA extension 0
000993.792: HDMI:EDID monitor support - underscan IT formats:yes, basic audio:yes, yuv444:yes, yuv422:yes, #native DTD:1
000993.838: HDMI:EDID found CEA detail timing format: 1920x1080p @ 60 Hz (16)
000993.880: HDMI:EDID found CEA detail timing format: 1920x1080i @ 60 Hz (5)
000993.920: HDMI:EDID found CEA detail timing format: 1280x720p @ 60 Hz (4)
000993.959: HDMI:EDID found CEA detail timing format: 720x480p @ 60 Hz (2)
000993.997: HDMI:EDID found CEA format: code 16, 1920x1080p @ 60Hz (native)
000994.030: HDMI:EDID found CEA format: code 5, 1920x1080i @ 60Hz 
000994.061: HDMI:EDID found CEA format: code 4, 1280x720p @ 60Hz 
000994.092: HDMI:EDID found CEA format: code 3, 720x480p @ 60Hz 
000994.125: HDMI:EDID found CEA format: code 2, 720x480p @ 60Hz 
000994.157: HDMI:EDID found CEA format: code 7, 1440x480i @ 60Hz 
000994.192: HDMI:EDID found CEA format: code 22, 1440x576i @ 50Hz 
000994.223: HDMI:EDID found CEA format: code 1, 640x480p @ 60Hz 
000994.256: HDMI:EDID found CEA format: code 31, 1920x1080p @ 50Hz 
000994.287: HDMI:EDID found CEA format: code 18, 720x576p @ 50Hz 
000994.321: HDMI:EDID found CEA format: code 19, 1280x720p @ 50Hz 
000994.354: HDMI:EDID found CEA format: code 20, 1920x1080i @ 50Hz 
000994.386: HDMI:EDID found CEA format: code 32, 1920x1080p @ 24Hz 
000994.419: HDMI:EDID found CEA format: code 21, 1440x576i @ 50Hz 
000994.451: HDMI:EDID found CEA format: code 17, 720x576p @ 50Hz 
000994.482: HDMI:EDID found CEA format: code 6, 1440x480i @ 60Hz 
000994.542: HDMI:EDID found audio format 2 channels PCM, sample rate: 32|44|48|88|96 kHz, sample size: 16|20|24 bits
000994.560: HDMI:EDID found HDMI VSDB length 7
000994.584: HDMI:EDID HDMI VSDB has physical address 1.0.0.0
000994.603: HDMI:EDID HDMI VSDB supports AI:no, dual link DVI:no
000994.632: HDMI:EDID HDMI VSDB deep colour support - 48-bit:no 36-bit:yes 30-bit:yes DC_yuv444:yes
000994.650: HDMI:EDID HDMI VSDB max TMDS clock 225 MHz
000994.666: HDMI:EDID HDMI VSDB has no latency information
000994.710: HDMI:EDID filtering formats with pixel clock > 162 MHz or h. blanking > 1023
000994.929: HDMI:EDID filtering out DMT format: 1920x1200p @ 60 Hz (69) with pixel clock 193 MHz and hfp:136 hs:200 hbp:336
000994.990: HDMI:EDID preferred mode remained as DMT (68) 1920x1200p @ 60 Hz with pixel clock 154 MHz
001007.999: HDMI:Setting property pixel encoding to Default
001008.022: HDMI:Setting property pixel clock type to PAL
001008.039: HDMI:Setting property content type flag to No data
001008.059: HDMI:Setting property fuzzy format match to enabled
001015.550: gpioman: gpioman_get_pin_num: pin WL_LPO_CLK not defined
001015.574: gpioman: gpioman_get_pin_num: pin BT_ON not defined
001015.593: gpioman: gpioman_get_pin_num: pin WL_ON not defined
001205.798: hdmi: HDMI:>>>>>>>>>>>>>Rx sensed, reading EDID<<<<<<<<<<<<<
001217.932: hdmi: HDMI:EDID version 1.3, 1 extensions, screen size 52x32 cm
001218.000: hdmi: HDMI:EDID features - videodef 0x80 standby suspend active off; colour encoding:RGB444|YCbCr422; sRGB is not default colourspace; preferred format is native; does not support GTF
001218.099: hdmi: HDMI:EDID found preferred DMT detail timing format: 1920x1200p @ 60 Hz (68)
001218.142: hdmi: HDMI:EDID found DMT format: code 4, 640x480p @ 60 Hz in established timing I/II
001218.184: hdmi: HDMI:EDID found DMT format: code 6, 640x480p @ 75 Hz in established timing I/II
001218.225: hdmi: HDMI:EDID found DMT format: code 9, 800x600p @ 60 Hz in established timing I/II
001218.267: hdmi: HDMI:EDID found DMT format: code 11, 800x600p @ 75 Hz in established timing I/II
001218.308: hdmi: HDMI:EDID found DMT format: code 16, 1024x768p @ 60 Hz in established timing I/II
001218.350: hdmi: HDMI:EDID found DMT format: code 18, 1024x768p @ 75 Hz in established timing I/II
001218.395: hdmi: HDMI:EDID found DMT format: code 36, 1280x1024p @ 75 Hz in established timing I/II
001218.485: hdmi: HDMI:EDID standard timings block x 8: 0x8180 A940 D100 714F 0101 0101 0101 0101 
001218.538: hdmi: HDMI:EDID found DMT format: code 35, 1280x1024p @ 60 Hz (5:4) in standard timing 0
001218.592: hdmi: HDMI:EDID found DMT format: code 51, 1600x1200p @ 60 Hz (4:3) in standard timing 1
001218.649: hdmi: HDMI:EDID found DMT format: code 69, 1920x1200p @ 60 Hz (16:10) in standard timing 2
001218.701: hdmi: HDMI:EDID found DMT format: code 21, 1152x864p @ 75 Hz (4:3) in standard timing 3
001231.708: hdmi: HDMI:EDID parsing v3 CEA extension 0
001231.750: hdmi: HDMI:EDID monitor support - underscan IT formats:yes, basic audio:yes, yuv444:yes, yuv422:yes, #native DTD:1
001231.799: hdmi: HDMI:EDID found CEA detail timing format: 1920x1080p @ 60 Hz (16)
001231.845: hdmi: HDMI:EDID found CEA detail timing format: 1920x1080i @ 60 Hz (5)
001231.890: hdmi: HDMI:EDID found CEA detail timing format: 1280x720p @ 60 Hz (4)
001231.933: hdmi: HDMI:EDID found CEA detail timing format: 720x480p @ 60 Hz (2)
001231.974: hdmi: HDMI:EDID found CEA format: code 16, 1920x1080p @ 60Hz (native)
001232.012: hdmi: HDMI:EDID found CEA format: code 5, 1920x1080i @ 60Hz 
001232.047: hdmi: HDMI:EDID found CEA format: code 4, 1280x720p @ 60Hz 
001232.082: hdmi: HDMI:EDID found CEA format: code 3, 720x480p @ 60Hz 
001232.118: hdmi: HDMI:EDID found CEA format: code 2, 720x480p @ 60Hz 
001232.154: hdmi: HDMI:EDID found CEA format: code 7, 1440x480i @ 60Hz 
001232.191: hdmi: HDMI:EDID found CEA format: code 22, 1440x576i @ 50Hz 
001232.225: hdmi: HDMI:EDID found CEA format: code 1, 640x480p @ 60Hz 
001232.261: hdmi: HDMI:EDID found CEA format: code 31, 1920x1080p @ 50Hz 
001232.296: hdmi: HDMI:EDID found CEA format: code 18, 720x576p @ 50Hz 
001232.333: hdmi: HDMI:EDID found CEA format: code 19, 1280x720p @ 50Hz 
001232.369: hdmi: HDMI:EDID found CEA format: code 20, 1920x1080i @ 50Hz 
001232.406: hdmi: HDMI:EDID found CEA format: code 32, 1920x1080p @ 24Hz 
001232.443: hdmi: HDMI:EDID found CEA format: code 21, 1440x576i @ 50Hz 
001232.477: hdmi: HDMI:EDID found CEA format: code 17, 720x576p @ 50Hz 
001232.511: hdmi: HDMI:EDID found CEA format: code 6, 1440x480i @ 60Hz 
001232.576: hdmi: HDMI:EDID found audio format 2 channels PCM, sample rate: 32|44|48|88|96 kHz, sample size: 16|20|24 bits
001232.597: hdmi: HDMI:EDID found HDMI VSDB length 7
001232.624: hdmi: HDMI:EDID HDMI VSDB has physical address 1.0.0.0
001232.646: hdmi: HDMI:EDID HDMI VSDB supports AI:no, dual link DVI:no
001232.679: hdmi: HDMI:EDID HDMI VSDB deep colour support - 48-bit:no 36-bit:yes 30-bit:yes DC_yuv444:yes
001232.700: hdmi: HDMI:EDID HDMI VSDB max TMDS clock 225 MHz
001232.720: hdmi: HDMI:EDID HDMI VSDB has no latency information
001232.766: hdmi: HDMI:EDID filtering formats with pixel clock > 162 MHz or h. blanking > 1023
001232.987: hdmi: HDMI:EDID filtering out DMT format: 1920x1200p @ 60 Hz (69) with pixel clock 193 MHz and hfp:136 hs:200 hbp:336
001233.052: hdmi: HDMI:EDID preferred mode remained as DMT (68) 1920x1200p @ 60 Hz with pixel clock 154 MHz
001233.073: hdmi: HDMI: hotplug attached with HDMI support
001233.140: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
001235.608: hdmi: HDMI: power_on to DMT mode WUXGA rb
001238.782: hdmi: HDMI: Action callback added to queue to happen at frame 0
001255.570: *** Restart logging
001256.758: Read command line from file 'cmdline.txt'
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p7 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
001510.098: Loading 'kernel7.img' to 0x8000 size 0x4088d8
001513.748: Kernel trailer DTOK property says yes
001513.762: Kernel trailer DDTK property says yes
001516.621: Loading 'bcm2709-rpi-2-b.dtb' to 0x4108d8 size 0x3bfc
001595.142: dtparam: pwr_led_gpio=35
001604.501: dtparam: uart0_clkrate=48000000
001617.413: dtparam: spi=on
001625.130: dtparam: audio=on
001648.853: Loaded overlay 'w1-gpio'
001694.194: Loaded overlay 'spi0-hw-cs'
001721.548: Loaded overlay 'mcp2515-can1'
001721.567: dtparam: oscillator=10000000
001722.347: dtparam: interrupt=26
001788.220: Loaded overlay 'mcp2515-can0'
001788.239: dtparam: oscillator=10000000
001789.020: dtparam: interrupt=6
001905.085: dtparam: arm_freq=900000000
001949.178: dtparam: core_freq=250000000
001961.046: dtparam: cache_line_size=64
001983.798: Device tree loaded to 0x2effba00 (size 0x4516)
001987.034: gpioman: gpioman_get_pin_num: pin SDCARD_CONTROL_POWER not defined
003834.346: vchiq_core: vchiq_init_state: slot_zero = 0xfac80000, is_master = 1
003839.140: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
003844.664: TV service:host side not connected, dropping notification 0x00000002, 0x00000002, 0x00000044
checking "dmesg" does not really give me any hints as to way the module on spi0.1 won't start

Code: Select all

pi@raspberrypi:~ $ dmesg | grep -i mcp
pi@raspberrypi:~ $ dmesg | grep -i can
[    4.987855] CAN device driver interface
[  134.745160] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
pi@raspberrypi:~ $ dmesg | grep -i bcm2835
[    0.094331] bcm2835-mbox 3f00b880.mailbox: mailbox enabled
[    0.167951] bcm2835-dma 3f007000.dma: DMA legacy API manager at f3007000, dmachans=0x1
[    1.338952] bcm2835-rng 3f104000.rng: hwrng registered
[    1.783321] bcm2835-cpufreq: min=600000 max=900000
[    1.842112] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)
[    4.877732] bcm2835-wdt 3f100000.watchdog: Broadcom BCM2835 watchdog timer
[    4.900749] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000
pi@raspberrypi:~ $ dmesg | grep -i spi
[    3.069912] systemd[1]: Found dependency on raspi-config.service/start
[    3.070078] systemd[1]: Breaking ordering cycle by deleting job raspi-config.service/start
[    3.070112] systemd[1]: Job raspi-config.service/start deleted to break ordering cycle starting with basic.target/start
pi@raspberrypi:~ $ 
Looking at the uevents in /sys/bus/spi/devices/spi0.*/ I get

Code: Select all

pi@raspberrypi:~ $ cat /sys/bus/spi/devices/spi0.0/uevent 
DRIVER=mcp251x
OF_NAME=mcp2515
OF_FULLNAME=/soc/spi@7e204000/mcp2515@0
OF_COMPATIBLE_0=microchip,mcp2515
OF_COMPATIBLE_N=1
MODALIAS=spi:mcp2515
pi@raspberrypi:~ $ cat /sys/bus/spi/devices/spi0.1/uevent 
OF_NAME=mcp2515
OF_FULLNAME=/soc/spi@7e204000/mcp2515@1
OF_COMPATIBLE_0=microchip,mcp2515
OF_COMPATIBLE_N=1
MODALIAS=spi:mcp2515
pi@raspberrypi:~ $ 
so as you see see - no drivers gets attached to spi0.1. And at this point I'm clueless as to why?

do you folks see any possible mistakes - any hints are really appreciated

Cheers

skanska
Posts: 1
Joined: Fri Oct 28, 2016 3:27 pm

Re: [quick-guide] CAN bus on raspberry pi with MCP2515

Fri Oct 28, 2016 3:31 pm

Hi krunch,

I'm getting exactly the same issue as you've described here....

berne
Posts: 24
Joined: Sat Sep 24, 2016 10:53 pm

Re: [quick-guide] CAN bus on raspberry pi with MCP2515

Fri Oct 28, 2016 11:16 pm

i have test

Code: Select all

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.1.18-v7+ #846 SMP Thu Feb 25 14:22:53 GMT 2016 armv7l GNU/Linux

but get the samse thing... i get som error:

Code: Select all

sudo apt-get install can-utils
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 libreoffice : Depends: libreoffice-core (= 1:4.3.3-2+rpi4) but 1:4.3.3-2+rpi3 is to be installed
               Recommends: fonts-liberation but it is not going to be installed or
                           ttf-mscorefonts-installer but it is not going to be installed
               Recommends: libpaper-utils but it is not going to be installed
 libreoffice-base : Depends: libreoffice-core (= 1:4.3.3-2+rpi4) but 1:4.3.3-2+rpi3 is to be installed
 libreoffice-base-core : Depends: libreoffice-core (= 1:4.3.3-2+rpi4) but 1:4.3.3-2+rpi3 is to be installed
 libreoffice-calc : Depends: libreoffice-core (= 1:4.3.3-2+rpi4) but 1:4.3.3-2+rpi3 is to be installed
 libreoffice-draw : Depends: libreoffice-core (= 1:4.3.3-2+rpi4) but 1:4.3.3-2+rpi3 is to be installed
 libreoffice-gtk : Depends: libreoffice-core (= 1:4.3.3-2+rpi4) but 1:4.3.3-2+rpi3 is to be installed
                   Recommends: libreoffice-style-tango but it is not going to be installed
 libreoffice-impress : Depends: libreoffice-core (= 1:4.3.3-2+rpi4) but 1:4.3.3-2+rpi3 is to be installed
 libreoffice-math : Depends: libreoffice-core (= 1:4.3.3-2+rpi4) but 1:4.3.3-2+rpi3 is to be installed
 libreoffice-writer : Depends: libreoffice-core (= 1:4.3.3-2+rpi4) but 1:4.3.3-2+rpi3 is to be installed
 python3-uno : Depends: libreoffice-core (= 1:4.3.3-2+rpi4) but 1:4.3.3-2+rpi3 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
i have test to do apt-get -f install... now luck... so i thinke, we pepol that are not good at coding, and dont understand all, will need to wait, for some one, that has the time, and effort to, do a new guide. or update, this one, using the new jessie.

pitchlynn
Posts: 16
Joined: Sun Oct 23, 2016 9:11 pm

Re: [quick-guide] CAN bus on raspberry pi with MCP2515

Sat Oct 29, 2016 2:45 am

krunch wrote:

Code: Select all

 pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.4.26-v7+ #915 SMP Thu Oct 20 17:08:44 BST 2016 armv7l GNU/Linux
I don't have anything to contribute to your problem but I wish I could get even can0 to work. Did you follow the op post exactly but with the latest kernel or did you have to alter the steps at any point? I don't have my can adapter yet and know at some point could cause problems but since the directories aren't even showing up in the op step 4 I must be doing something wrong.

krunch
Posts: 7
Joined: Sat Mar 28, 2015 2:50 pm

Re: [quick-guide] CAN bus on raspberry pi with MCP2515

Sat Oct 29, 2016 6:28 pm

pitchlynn wrote:
krunch wrote:

Code: Select all

 pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.4.26-v7+ #915 SMP Thu Oct 20 17:08:44 BST 2016 armv7l GNU/Linux
I don't have anything to contribute to your problem but I wish I could get even can0 to work. Did you follow the op post exactly but with the latest kernel or did you have to alter the steps at any point? I don't have my can adapter yet and know at some point could cause problems but since the directories aren't even showing up in the op step 4 I must be doing something wrong.
Hallo there

First make sure that you have the following in /boot/configuration.text

dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=<your MCP2515 clock frequency in Hz>,interrupt=<the GPIO pin used as interrupt>

Then you reboot

After the reboot you bring the CAN interface up by executing the following command from the prompt

sudo ip link set can0 up type can bitrate <the desired bit rate e.g. 500000>

Check that the can0 interface is up by executing

ifconfig

Hope it was any help to you

Cheers

pitchlynn
Posts: 16
Joined: Sun Oct 23, 2016 9:11 pm

Re: [quick-guide] CAN bus on raspberry pi with MCP2515

Sun Oct 30, 2016 2:02 am

My can adapter came into today. I wired it up and now everything works per the op post instructions. Even step 4 would fail without the adapter connected. I guess on boot up those folders are created when the actual hardware is detected. Now time to connect up to my Grand Cherokee's can bus and start having fun! Thanks for everyone's help.

pitchlynn
Posts: 16
Joined: Sun Oct 23, 2016 9:11 pm

Re: [quick-guide] CAN bus on raspberry pi with MCP2515

Sun Oct 30, 2016 4:29 am

Yes, it works! I'm reading and sending can messages on my grand cherokee. Able to unlock and lock the doors which is the first order of business. Some sketchy software in the jeep makes the passive entry flaky so I'm going use this as a work around. Thanks again for the op post and everyone's help!

Does anyone know how I would incorporate these can utility messages into a script to run all the time on the RPi. I'm sure this is basic RPi stuff but I'm not sure where to look for information. I'm hoping it is python since I use it a little in my day job.

Return to “Interfacing (DSI, CSI, I2C, etc.)”

Who is online

Users browsing this forum: Futurity and 10 guests