david_1234
Posts: 11
Joined: Mon Jan 01, 2018 2:14 pm

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

Mon Jan 01, 2018 4:21 pm

I did everything like it say in the guide

but I don't get the can interface
any idea why ?

I havetry 2-3 times - I get no error in any step ,
but I don't have "can" interface.

The mcp2515 is connected as shown in the setup

I'm using raspberry pi 2 Model B - Jessie 4.9.35-V7

waht am I doing wrong ?


Thanks ,

david_1234
Posts: 11
Joined: Mon Jan 01, 2018 2:14 pm

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

Mon Jan 01, 2018 5:27 pm

don't know what I did - but I reinstall everything and now it's working :-)


now I want to do this :
run a pyton code that take the data and solve it as a simple massage
for example:
when I get 18FE320 - I will decode it as "door open"

how can I do this ?

Thanks ,

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

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

Thu Jan 04, 2018 12:21 pm

david_1234 - for reinstalling, something u must have broken/not installed.

As for what u want, ask uncle google: https://goo.gl/e7NZmB .

Stafan Willms
Posts: 1
Joined: Sat Feb 17, 2018 12:59 pm

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

Sat Feb 17, 2018 1:18 pm

Hi,

thanks to this nice quick-guide i managed to access the CAN bus of my heating system at home with my pi. I can send requests with the "cansend" command and search for the response with the "candump" command. But this searching for the response is pain in the ass, and for my project i am serching for an way to get the direct response to my specific request automatic. Does anybody know if there is an command that i can use, that works in some way like this:

Code: Select all

 [email protected]:~ $  somecommand can0 580#31000C00000000
can0 180   [7] B2 00 0C 00 19 00 00       <--- direct response to my request
 [email protected]:~ $
Thanks for your help and sorry if my english is creepy.

Stefan

scorpion_08
Posts: 2
Joined: Thu Mar 08, 2018 6:43 am

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

Thu Mar 08, 2018 6:46 am

[email protected]:~ $ sudo ip link set can0 up type can bitrate 1000000
RTNETLINK answers: Numerical argument out of domain

when i set data rate to 1mbs, there appears an error. can you help in this regard.

david_1234
Posts: 11
Joined: Mon Jan 01, 2018 2:14 pm

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

Thu Mar 15, 2018 3:19 pm

Cansome one help or guide me ?
when I connect the canbus to my car i get a lot of data
I want to see only the data I want
for example
only PID 156,111,164,265
how Do I do this?
is it something in the canutilitis I need to do ?
cansniffer?
or I need to write an external code that will read the candump and show mw only what I want ?

Thanks ,

andminsk
Posts: 4
Joined: Thu Mar 22, 2018 5:16 pm

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

Tue Apr 03, 2018 3:03 pm

Hi to all?
Does anybody know - is it possible to monitor 2-3 CAN bus line with one Pi?
Using several MCP2515

gaffer206
Posts: 5
Joined: Thu Dec 20, 2012 12:09 am

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

Thu Apr 05, 2018 6:30 am

andminsk wrote:
Tue Apr 03, 2018 3:03 pm
Hi to all?
Does anybody know - is it possible to monitor 2-3 CAN bus line with one Pi?
Using several MCP2515
You might look at https://www.sg-electronic-systems.com/e ... 2-canberry

gaffer206
Posts: 5
Joined: Thu Dec 20, 2012 12:09 am

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

Thu Apr 05, 2018 6:35 am

Hi,

I've got one of these modules to try to talk to some NMEA2000 devices. A couple of questions.

How important do you think the 1uF tantalum is if the 5V supply is a good one nearby?

I had a look at the TJA1050 specs and it says the RXD pin can be 0.7 VCC which at 5V would be 3.5 V which is more than the maximum 3.3 V input for the Pi. Have you done anything about this? Do you consider it a problem?

cheers

Julian

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

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

Mon Apr 16, 2018 10:08 pm

gaffer206 wrote:
Thu Apr 05, 2018 6:35 am
Hi,

I've got one of these modules to try to talk to some NMEA2000 devices. A couple of questions.

How important do you think the 1uF tantalum is if the 5V supply is a good one nearby?
I always put right beside the IC always a cap 100n fo generic digital or MCU (unless datasheet suggest more) chip, for line/bus drivers I usually put on power trace close to the chip a ceramic(or tantalum) 1+uF and ceramic 100n - the 100n might be not necessary but I never had any problems where the power supply was the culprit thanks to my caution :)
gaffer206 wrote:
Thu Apr 05, 2018 6:35 am
I had a look at the TJA1050 specs and it says the RXD pin can be 0.7 VCC which at 5V would be 3.5 V which is more than the maximum 3.3 V input for the Pi. Have you done anything about this? Do you consider it a problem?
U don't connect bus driver to Rpi , bus driver (MCP2551/TJA1050/etc) first need to be connected to CAN bus controller which is the MCP2515.

If u actually read my first post then U should see that I disconnected the CAN bus driver from 3,3V and connected it's power to 5V while keeping the MCP2515 powered from 3,3V. For MCP2515 this is no problem , we only have to worry for the side of MCP which talk to RPi - so that's why I power MCP2515 from 3,3V.
TJA1050: 0,7Vcc=3,5V -> I see this in output but in "conditions" columns (and this refer for RXD pin max currents) , not the min-max columns. Beside VIH is 2V this is much below 3,3V Vcc of MCP2515 :)

keyneaLai
Posts: 1
Joined: Mon Apr 23, 2018 8:32 am

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

Mon Apr 23, 2018 8:36 am

Holle:
my code:

Code: Select all

def SendBack(data):
msg = can.Message(arbitration_id=0x000601, data = data, extended_id=False)
bus.send(msg)
bus.flush_tx_buffer()
time.sleep(0.001)
try:
	Ans = str(bus.recv(timeout=1.0))
except:
	print("Error")
	return(None)
if(len(Ans) > 10):
	return("success")
else:
	return(None)
My question is when it lost recv then i cant send any new message.
it can't send any data and any response.
I need to restart Raspberry Pi then CAN bus will be normal.
Please help me to fix this question.
Thank you

gaffer206
Posts: 5
Joined: Thu Dec 20, 2012 12:09 am

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

Sun May 13, 2018 3:09 pm

saper_2 wrote:
Mon Apr 16, 2018 10:08 pm
gaffer206 wrote:
Thu Apr 05, 2018 6:35 am
Hi,

I've got one of these modules to try to talk to some NMEA2000 devices. A couple of questions.

How important do you think the 1uF tantalum is if the 5V supply is a good one nearby?
I always put right beside the IC always a cap 100n fo generic digital or MCU (unless datasheet suggest more) chip, for line/bus drivers I usually put on power trace close to the chip a ceramic(or tantalum) 1+uF and ceramic 100n - the 100n might be not necessary but I never had any problems where the power supply was the culprit thanks to my caution :)

Sure. Better safe. I'll follow your advice.
gaffer206 wrote:
Thu Apr 05, 2018 6:35 am
I had a look at the TJA1050 specs and it says the RXD pin can be 0.7 VCC which at 5V would be 3.5 V which is more than the maximum 3.3 V input for the Pi. Have you done anything about this? Do you consider it a problem?
U don't connect bus driver to Rpi , bus driver (MCP2551/TJA1050/etc) first need to be connected to CAN bus controller which is the MCP2515.

If u actually read my first post then U should see that I disconnected the CAN bus driver from 3,3V and connected it's power to 5V while keeping the MCP2515 powered from 3,3V. For MCP2515 this is no problem , we only have to worry for the side of MCP which talk to RPi - so that's why I power MCP2515 from 3,3V.
TJA1050: 0,7Vcc=3,5V -> I see this in output but in "conditions" columns (and this refer for RXD pin max currents) , not the min-max columns. Beside VIH is 2V this is much below 3,3V Vcc of MCP2515 :)
Thanks - I read it but got mixed up. You are right of course.

gunahmt
Posts: 11
Joined: Mon Jun 25, 2018 12:31 pm
Location: Turkey

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

Wed Jun 27, 2018 12:44 pm

Hi guys,
i have raspberry pi 3 B+. I get a problem in sending message.

Code: Select all

cansend can0 456#1234e67890123456
bash: cansend: command not found
my kernel version is;

Code: Select all

Linux raspberrypi 4.14.34-v7+ #1110 SMP Mon Apr 16 15:18:51 BST 2018 armv7l GNU/Linux
what is the problem?

EDIT: i installed can-utils and it is working now,but mcp2515 always sends message and i cant stop it.
EDIT 2 : i figure it out just need acknowledge message for stop.

vinnitu
Posts: 4
Joined: Thu Oct 03, 2013 8:32 pm

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

Fri Jul 06, 2018 9:05 am

Hello people!

I need help too! Maybe my information will be usable.

I have stm32f103 with tfj1050 - and I can communicate with rasp

oscilator=16000000
bitrate 1000000 in /etc/network/interfaces
but it is not 1Mb! It is more like ~140Kb
why?

now I try connect arduino uno + mcp2515 + mcp2551 + 8000 oscilator via spi 1Mb - and it doesnt work...

If I change bitrate to 500Kb - it works (< 500 ofcause) but I need 1Mb - what i need to do? is it possible in general?

thank you all!

vinnitu
Posts: 4
Joined: Thu Oct 03, 2013 8:32 pm

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

Tue Jul 10, 2018 7:08 am

vinnitu wrote:
Fri Jul 06, 2018 9:05 am
Hello people!

I need help too! Maybe my information will be usable.

I have stm32f103 with tfj1050 - and I can communicate with rasp

oscilator=16000000
bitrate 1000000 in /etc/network/interfaces
but it is not 1Mb! It is more like ~140Kb
why?

now I try connect arduino uno + mcp2515 + mcp2551 + 8000 oscilator via spi 1Mb - and it doesnt work...

If I change bitrate to 500Kb - it works (< 500 ofcause) but I need 1Mb - what i need to do? is it possible in general?

thank you all!
seems oscilator=16000000 + 1000000 bps give us 500000pbs (measured with logic analyzer)

so... is it possible make work as we wish?

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

Who is online

Users browsing this forum: No registered users and 9 guests