PEAK-Linux Driver on Raspberry Pi

This forum covers PCAN-Linux and Linux development issues concerning our products
Post Reply
UserOfPeak
Posts: 1
Joined: Fri 29. Aug 2014, 22:34

Re: PEAK-Linux Driver on Raspberry Pi

Post by UserOfPeak » Fri 29. Aug 2014, 22:51

Hi,

I've got the raspberry pi B+ and can't use the kernel 3.10.3.
Is there another newer kernel which would work?
Kind regards.

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: PEAK-Linux Driver on Raspberry Pi

Post by PEAK-Support » Mon 1. Sep 2014, 08:06

We are not able to test every Kernel Version on RPi. With the peak-linux-driver-7.11 the chardev driver could be installed on the Raspberry Pi with kernel 3.10-3 without problems.

What exact is your problem when you install with the Version of your choice?
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

Ludovic
Posts: 1
Joined: Mon 22. Sep 2014, 17:05

Re: PEAK-Linux Driver on Raspberry Pi

Post by Ludovic » Mon 22. Sep 2014, 17:26

Hi,

I am trying to use the driver for a Raspberry Pi but its load fails.

I followed this instructions step by step :
M.Maidhof wrote:Hi,

here you will find a step by step instruction on how to install our linux driver on a Raspberry PI with the latest raspbian wheezy with kernel 3.6.11+:

check your kernel version:

mm@raspberrypi ~ $ uname -r
3.6.11+

get the linux headers for 3.6.11+ from here:
wget http://www.niksula.hut.fi/~mhiienka/Rpi ... _armhf.deb

install the headers:
sudo dpkg -i linux-headers-3.6.11+_3.6.11+-2_armhf.deb

get the latest peak-linux driver 7.8 from here:
wget http://www.peak-system.com/fileadmin/me ... 7.8.tar.gz

unpack it:
tar -xzf peak-linux-driver-7.8.tar.gz

build the driver:
cd peak-linux-driver-7.8/
make clean
make NET=NO PCI=NO PAR=NO ISA=NO PCC=NO DNG=NO
sudo make install
cd driver
sudo insmod pcan.ko

check that the driver is loaded:

mm@raspberrypi ~/peak-linux-driver-7.8/driver $ cat /proc/pcan
*------------- PEAK-System CAN interfaces (http://www.peak-system.com) -------------
*------------- Release_20130131_n (7.8.0) Apr 1 2013 10:58:08 --------------
*------------------------------- [mod] [usb] --------------------------------
*--------------------- 1 interfaces @ major 248 found -----------------------
*n -type- ndev --base-- irq --btr- --read-- --write- --irqs-- -errors- status
32 usb -NA- ffffffff 255 0x001c 00000000 00000000 00000000 00000000 0x0000

with cat /dev/pcan32 you will receive data (500k)
with echo "m s 0x11 2 0x22 0x33"> /dev/pcan32 you can transmit data with your Raspberry PI.

regards

Michael
The kernel version is 3.12.20+
The Driver kernel version is 3.12.20
The PEAK-Linux driver version is 7.12

I got the Linux headers 3.12.20 and compile them.
I compile and install the PEAK-Linux driver without errors.

But the load of the driver fails :
$sudo insmod pcan.ko
--> could not insert module pcan.ko: Invalid module format

Thank you for your help.

Regards,
Ludovic

M.Maidhof
Support
Support
Posts: 1753
Joined: Wed 22. Sep 2010, 14:00

Re: PEAK-Linux Driver on Raspberry Pi

Post by M.Maidhof » Tue 23. Sep 2014, 13:43

Hi,

please use the raspian kernel instead of the raspberry pi foundation kernel. Looks like it is still the old problem, regarding the kernel headers. See solution in an earlier post of this thread:

http://www.peak-system.com/forum/viewto ... t=40#p2841

regards

Michael

Naqqash
Posts: 5
Joined: Wed 24. Sep 2014, 12:12

Re: PEAK-Linux Driver on Raspberry Pi

Post by Naqqash » Wed 24. Sep 2014, 12:16

M.Maidhof wrote:Hi,

Some other users already used our linux drivers on different ARM based systems in the past (BeagleBoeard etc.)

regards

Michael
Hi,

Can you please provide some detail about this. We are interested to use PCAN explorer with beagle bone it will be very useful for us if you can provide some information (wiki/documents) on that. At the moment we are just checking the options. I have clearly seen that it is possible with raspberry pi but we are interested to use it with Beagle bone black.

Regards,
Naqqash

M.Maidhof
Support
Support
Posts: 1753
Joined: Wed 22. Sep 2010, 14:00

Re: PEAK-Linux Driver on Raspberry Pi

Post by M.Maidhof » Fri 26. Sep 2014, 12:33

Hi,

thanks for the info. We have tested our driver on an older BeagleBoard XM with Ubuntu 12.04 without problems, so I see no problem to use the PCAN-USB with the Beagle bone black too, as long as your used distribution offers the kernel headers for the installed kernel.

BTW: PCAN-Explorer is a Windows software and will not work on any Linux based system.

regards

Michael

klkl1
Posts: 2
Joined: Mon 29. Sep 2014, 09:52

Re: PEAK-Linux Driver on Raspberry Pi

Post by klkl1 » Mon 29. Sep 2014, 10:29

Hello

I'm having a problem using the peak-driver with my raspberries. They initialize unpredictable.
Is it ok to capture this thread? Its all raspberry-related....

Compilation and loading the driver is mastered:
---
pi@raspberrypi ~ $ uname -a
Linux raspberrypi 3.12.23+ #3 PREEMPT Sat Jul 26 09:42:32 UTC 2014 armv6l GNU/Linux

pi@raspberrypi ~ $ cat /proc/pcan

*------------- PEAK-System CAN interfaces (www.peak-system.com) -------------
*------------- Release_20140430_n (7.11.0) Jul 26 2014 10:05:06 --------------
*---------------------------- [mod] [usb] [net] -----------------------------
*--------------------- 1 interfaces @ major 248 found -----------------------
*n -type- ndev --base-- irq --btr- --read-- --write- --irqs-- -errors- status
32 usb can0 ffffffff 255 0x031c 00000000 00000000 00000000 00000000 0x0000
---
This works correctly after every reboot.

The PCAN Dongle is connect to another PCAN Dongle connected to a PC which sends messages all the time.
Im using libSocketCAN which I start with the following script.
---
#!/bin/bash
#start moduls
sudo modprobe can
sudo modprobe can-dev
sudo modprobe can-raw
sudo modprobe can-bcm
#setup the can interface
sudo ip link set up can0
#set baudrate
echo "i 0x031C e" > /dev/pcan32 #125k
---

Sometimes I get a connection after reboot, sometimes I have to close and reopen the connection from the PC-side to get a working connection, sometimes Im not able to figure out what is going wrong and nothing is received.
If the connection is working once there are no further problems, everything seems to be transferred.

Do you have a hint for me how I can solve this?

Thanks and greetings
Klaus

M.Maidhof
Support
Support
Posts: 1753
Joined: Wed 22. Sep 2010, 14:00

Re: PEAK-Linux Driver on Raspberry Pi

Post by M.Maidhof » Mon 29. Sep 2014, 11:56

Hi,

with kernel version 3.7 or higher, there is no need to install our peak-linux-driver anymore, when you like to use the SocketCAN (netdev) interface.

Can you please check with the standard netdev tools like candump etc., if it will work on your system?

How is your CAN setup (termination of the cables etc.)? Maybe you have a problem on the CAN and not on the driver side.

To check this, please try to use the chardev driver and tranmit and receive messages with the provided chardev tools.

regards

Michael

klkl1
Posts: 2
Joined: Mon 29. Sep 2014, 09:52

Re: PEAK-Linux Driver on Raspberry Pi

Post by klkl1 » Wed 8. Oct 2014, 08:36

Hello Michael

Thanks for the help.
M.Maidhof wrote: with kernel version 3.7 or higher, there is no need to install our peak-linux-driver anymore, when you like to use the SocketCAN (netdev) interface.
Then I have to compile the kernel with the option
CONFIG_CAN_PEAK_USB=y
, am I right?
which I haven't done yet, cause I thought the driver on your web side might be newer.
I will try this. How can I get rid of the own compiled driver?
M.Maidhof wrote: Can you please check with the standard netdev tools like candump etc., if it will work on your system?
this is the way I test the connection. I use 'candump can0'
M.Maidhof wrote: How is your CAN setup (termination of the cables etc.)? Maybe you have a problem on the CAN and not on the driver side.
The bus is terminated and is used in other surroundings without problems. The only difference here is the second connected PEAK-Dongle.
if the raspberry gets the connection working there are no further problems.
M.Maidhof wrote: To check this, please try to use the chardev driver and tranmit and receive messages with the provided chardev tools.
How can I do this?
When reading http://www.peak-system.com/fileadmin/me ... /index.htm
it sounds to me that I have to compile the driver... (?)

I don't see the right way....

Greetings Klaus

M.Maidhof
Support
Support
Posts: 1753
Joined: Wed 22. Sep 2010, 14:00

Re: PEAK-Linux Driver on Raspberry Pi

Post by M.Maidhof » Thu 9. Oct 2014, 11:19

Hi Klaus,

I don´t think the Raspberry PI thread will be the right place for your problem. Maybe you should start a new thread, or simply contact us by email or phone to discuss your issue.

For me it looks like you have a physical CAN bus problem. To use the chardev tools with the raspberry pi please see the info in this thread or see the info for Ubuntu here: http://www.peak-system.com/forum/viewto ... f=59&t=256

regards

Michael

Post Reply