Libelium is offering new technical support channels, to contact with de Technical Support team to solve any issue our doubt please contact with your sales agent or visit our contact site



Post a new topicPost a reply Page 1 of 1   [ 4 posts ]
Author Message
 Post subject: How far could a CAN message received by raspberry Pi?
PostPosted: Fri Dec 09, 2016 2:26 pm 

Joined: Fri Dec 09, 2016 2:08 pm
Posts: 4
I recently work on a project to use Rpi as an CAN message logger.
The HW we used:
R Pi 3 module B+
CAN Bus Module for Arduino, Raspberry Pi and Intel Galileo [XBee Socket]
with Raspberry Pi to Arduino Shields Connection Bridge as the CAN message receiver,
a CAnalyzer case from Vector Informatik as the sender.
After I fixed everything to work and try the examples with the arduPi lib, e.g. CANBUS_01_basic_example.cpp, just realised that the function

Code:
myCAN.getMessage(&myCAN.messageRx);


takes about 80 ms to receive one message. But the sender actually send about 13,000 messages per second, so we lost a lot of messages. Has anybody used the same devices and got a better performance?
Thanks for any help!


Top
 Profile  
 
 Post subject: Re: How far could a CAN message received by raspberry Pi?
PostPosted: Mon Dec 12, 2016 8:48 am 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11366
Hello the last unicorn,
We never tested the module at these high speed taxes. Theoretically you need a 780000Baud (assuming a 3byte payload message)
Maybe you can improve the delay added by (in .getMessage() procedure):
Code:
Utils.setCSSocket0();

See Utlis libray in api directory.
Regards.


Top
 Profile  
 
 Post subject: Re: How far could a CAN message received by raspberry Pi?
PostPosted: Mon Dec 12, 2016 11:18 am 

Joined: Fri Dec 09, 2016 2:08 pm
Posts: 4
Hello libelium-dev,

thanks for the answer. I thought you've already tested those HW in some car or with some simulator, but you never test the speed? That 13,000 messages per second in my last post may not correct, here is my estimation:

a CAN message has 28 Byte, means 224 bit, + some ACK, let's say 250 bit,
with speed 500k bit per second (
Code:
myCAN.begin(500);
) : 500 * 1024 / 250 = 2048

So we were supposed to receive about 2000 messages per second. Do you think we could reach that with the current devices? Which baud rate will be needed for 2000 messages per second?
I will try to improve the delay in Utils lib and let you know the result.

By the way, could you fix the title of this post, not "How far could ...", but "how fast could ..."? Thanks a lot!


Top
 Profile  
 
 Post subject: Re: How far could a CAN message received by raspberry Pi?
PostPosted: Tue Dec 13, 2016 12:49 pm 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11366
Hello the last unicarn,

We have not tested this rate.

Maybe you can send the SPI divider in the library to improve it.

Regards.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 4 posts ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Libelium theme based on 610nm Style by Daniel St. Jules of http://www.gamexe.net


© Libelium Comunicaciones Distribuidas S.L. | Terms of use.