Hi,
I have a (X)Ubuntu 14.04 system that uses a manually installed PCAN driver in CHARDEV mode. Each kernel update forces me to recompile the driver so that the new kernel recognizes its version number and loads the module, which is a bit annoying. I'm therefore thinking about converting the software to SocketCAN usage and use the NETDEV driver that comes with Ubuntu.
I've "make uninstall"ed the old driver and now the driver that comes with Ubuntu is loaded on system boot and I see there is an (inactive) can0 interface. Now I have some questions:
1) I do not see a /proc/pcan device can therefore not see information about the driver. I did get a /proc/pcan decice once when I manually installed a driver, but there does not appear to be one when using the driver that comes with Ubuntu. Is that normal? Some kind of configuration issue in the kernel used by Ubuntu perhaps? Or is it a sign of some other problem?
2) I can change the baudrate with "ip link set can0 type can bitrate 250000", however, I'd prefer to do that from inside my program. I've seen there are code samples on the web that suggest
ifr.ifr_ifru.ifru_ivalue = 1000000;
ret = ioctl(s, SIOCSCANBAUDRATE, &ifr);
but my Ubuntu does not appear to have SIOCSCANBAUDRATE (I've "grep"ed the headers). At the same time I cannot use any tricks using the /dev/pcan device becauses they do not exist in Ubuntu's NETDEV driver. So how can I change the baudrate without invoking the "ip" command?
cheers,
Torsten
Ubuntu 14.04 PCAN Problems
Re: Ubuntu 14.04 PCAN Problems
Hi,
here are the answers to your questions:
1. it is normal, cat /proc/pcan is only provided by the peak-linux-driver. See ifconfig canx for details about your netdev interface.
2. please contact the SocketCAN user group for help. AFAIK the configuration change is only possible with those ip link commands. Only with the peak-linux-driver SocketCAN driver, the corresponding chardev interface could be used to change the baudrate with a echo command.
regards
Michael
here are the answers to your questions:
1. it is normal, cat /proc/pcan is only provided by the peak-linux-driver. See ifconfig canx for details about your netdev interface.
2. please contact the SocketCAN user group for help. AFAIK the configuration change is only possible with those ip link commands. Only with the peak-linux-driver SocketCAN driver, the corresponding chardev interface could be used to change the baudrate with a echo command.
regards
Michael
- O.Hartkopp
- Posts: 40
- Joined: Fri 22. Nov 2013, 19:47
Re: Ubuntu 14.04 PCAN Problems
That's correct.M.Maidhof wrote: 2. please contact the SocketCAN user group for help. AFAIK the configuration change is only possible with those ip link commands.
If you want to control these settings form an application you can use the libsocketcan from Pengutronix.
See discussion at http://marc.info/?l=linux-can&m=140494956215084&w=2
Regards,
Oliver
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: Ubuntu 14.04 PCAN Problems
Readme file for the Controller Area Network Protocol Family (aka SocketCAN) could be found here
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------