Cannot connect with PCAN device

This forum covers PCAN-Linux and Linux development issues concerning our products
afvillamil231
Posts: 9
Joined: Thu 11. Apr 2019, 16:47

Re: Cannot connect with PCAN device

Post by afvillamil231 » Fri 12. Apr 2019, 14:04

output for make

Code: Select all

make[1]: Entering directory '/home/felipe/peak-linux-driver-8.7.0/driver'
make[1]: Nothing to be done for 'depend'.
make[1]: Leaving directory '/home/felipe/peak-linux-driver-8.7.0/driver'
make[1]: Entering directory '/home/felipe/peak-linux-driver-8.7.0/driver'
***
*** Host machine kernel version=4.18.0-17-generic
*** Driver kernel version=4.18.0-17-generic (4.18.0)
*** Path to kernel sources=/usr/src/linux-headers-4.18.0-17-generic
*** use KBUILD=yes
*** cc version=7
***
make -C /usr/src/linux-headers-4.18.0-17-generic  SUBDIRS=/home/felipe/peak-linux-driver-8.7.0/driver EXTRA_CFLAGS="-I/home/felipe/peak-linux-driver-8.7.0/driver -DNO_DEBUG -DMODVERSIONS -DPARPORT_SUBSYSTEM -DUSB_SUPPORT -DPCI_SUPPORT -DPCIEC_SUPPORT -DISA_SUPPORT -DDONGLE_SUPPORT -DPCCARD_SUPPORT -DNO_NETDEV_SUPPORT -DNO_RT  -Wno-date-time" V=0 modules
make[2]: Entering directory '/usr/src/linux-headers-4.18.0-17-generic'
  CC [M]  /home/felipe/peak-linux-driver-8.7.0/driver/src/pcan_main.o
  CC [M]  /home/felipe/peak-linux-driver-8.7.0/driver/src/pcan_fops.o
  CC [M]  /home/felipe/peak-linux-driver-8.7.0/driver/src/pcan_fifo.o
  CC [M]  /home/felipe/peak-linux-driver-8.7.0/driver/src/pcan_filter.o
  CC [M]  /home/felipe/peak-linux-driver-8.7.0/driver/src/pcan_parse.o
  CC [M]  /home/felipe/peak-linux-driver-8.7.0/driver/src/pcan_sja1000.o
  CC [M]  /home/felipe/peak-linux-driver-8.7.0/driver/src/pcan_common.o
  CC [M]  /home/felipe/peak-linux-driver-8.7.0/driver/src/pcan_timing.o
  CC [M]  /home/felipe/peak-linux-driver-8.7.0/driver/src/pcanfd_core.o
  CC [M]  /home/felipe/peak-linux-driver-8.7.0/driver/src/pcanfd_ucan.o
  CC [M]  /home/felipe/peak-linux-driver-8.7.0/driver/src/pcan_usb_core.o
  CC [M]  /home/felipe/peak-linux-driver-8.7.0/driver/src/pcan_usb.o
  CC [M]  /home/felipe/peak-linux-driver-8.7.0/driver/src/pcan_usbpro.o
  CC [M]  /home/felipe/peak-linux-driver-8.7.0/driver/src/pcanfd_usb.o
  CC [M]  /home/felipe/peak-linux-driver-8.7.0/driver/src/pcan_pci.o
  CC [M]  /home/felipe/peak-linux-driver-8.7.0/driver/src/pcanfd_pci.o
  CC [M]  /home/felipe/peak-linux-driver-8.7.0/driver/src/pcan_pciec.o
  CC [M]  /home/felipe/peak-linux-driver-8.7.0/driver/src/pcan_isa.o
  CC [M]  /home/felipe/peak-linux-driver-8.7.0/driver/src/pcan_dongle.o
  CC [M]  /home/felipe/peak-linux-driver-8.7.0/driver/src/pcan_pccard_core.o
  CC [M]  /home/felipe/peak-linux-driver-8.7.0/driver/src/pcan_pccard.o
  LD [M]  /home/felipe/peak-linux-driver-8.7.0/driver/pcan.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/felipe/peak-linux-driver-8.7.0/driver/pcan.mod.o
  LD [M]  /home/felipe/peak-linux-driver-8.7.0/driver/pcan.ko
make[2]: Leaving directory '/usr/src/linux-headers-4.18.0-17-generic'
make[1]: Leaving directory '/home/felipe/peak-linux-driver-8.7.0/driver'
make[1]: Entering directory '/home/felipe/peak-linux-driver-8.7.0/lib'
cc -DNO_RT -I. -I../driver -fPIC -Wall -Wcast-align -Wredundant-decls  -DPCANFD_OLD_STYLE_API -c src/libpcan.c -o obj/libpcan.o
cc -shared -Wl,-soname,libpcan.so.0 -o lib/libpcan.so.0.6 obj/libpcan.o 
cd lib/; ln -sf libpcan.so.0.6 libpcan.so
cc -DNO_RT -I. -I../driver -fPIC -Wall -Wcast-align -Wredundant-decls  -DPCANFD_OLD_STYLE_API -c src/libpcanfd.c -o obj/libpcanfd.o
cc -shared -Wl,-soname,libpcanfd.so.0 -o lib/libpcanfd.so.0.1 obj/libpcanfd.o 
cd lib/; ln -sf libpcanfd.so.0.1 libpcanfd.so
ar rcs lib/libpcanfd.a obj/libpcanfd.o
make[1]: Leaving directory '/home/felipe/peak-linux-driver-8.7.0/lib'
make[1]: Entering directory '/home/felipe/peak-linux-driver-8.7.0/test'
cc -DNO_RT -g -I. -I../lib -I../driver    src/receivetest.c src/common.c -lpcanfd  -L../lib/lib   -o receivetest
cc -DNO_RT -g -I. -I../lib -I../driver    src/transmitest.cpp src/common.c src/parser.cpp -lpcanfd -lstdc++  -L../lib/lib   -o transmitest
cc -DNO_RT -g -I. -I../lib -I../driver    src/bitratetest.c src/common.c -lpcanfd  -L../lib/lib   -o bitratetest
cc -DNO_RT -g -I. -I../lib -I../driver    src/filtertest.cpp src/common.c -lpcanfd -lstdc++  -L../lib/lib   -o filtertest
cc -DNO_RT -g -I. -I../lib -I../driver    src/pcanfdtst.c -lpcanfd  -L../lib/lib   -o pcanfdtst
cc -DNO_RT -g -I. -I../lib -I../driver    src/pcan-settings.c -lpopt  -L../lib/lib   -g -o pcan-settings
make[1]: Leaving directory '/home/felipe/peak-linux-driver-8.7.0/test'
Last edited by K.Wagner on Fri 12. Apr 2019, 14:34, edited 1 time in total.
Reason: Format applied for better reading

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

Re: Cannot connect with PCAN device

Post by M.Maidhof » Fri 12. Apr 2019, 14:56

next step:

sudo make install

sudo modprobe pcan

afvillamil231
Posts: 9
Joined: Thu 11. Apr 2019, 16:47

Re: Cannot connect with PCAN device

Post by afvillamil231 » Fri 12. Apr 2019, 15:06

Yes I have already done all the steps, I have told you three times......

Code: Select all

sudo make install

make[1]: Entering directory '/home/felipe/peak-linux-driver-8.7.0/driver'
Info: /lib/modules/4.18.0-17-generic/misc exists.
Info: Left current 'pcan'-entry in /etc/modprobe.d/pcan.conf untouched.
Info: Copied 45-pcan.rules to /etc/udev/rules.d.
Info: mainline drivers removed and blacklisted in
      /etc/modprobe.d/blacklist-peak.conf
make[1]: Leaving directory '/home/felipe/peak-linux-driver-8.7.0/driver'
make[1]: Entering directory '/home/felipe/peak-linux-driver-8.7.0/lib'
mkdir -p /usr/lib
cp -d lib/* /usr/lib
if [ -d lib32 ]; then \
	mkdir -p /usr/lib32; \
	cp -d lib32/* /usr/lib32; \
fi
mkdir -p /usr/include
chmod 644 libpcan.h libpcanfd.h
cp libpcan.h libpcanfd.h /usr/include
/sbin/ldconfig
make[1]: Leaving directory '/home/felipe/peak-linux-driver-8.7.0/lib'
make[1]: Entering directory '/home/felipe/peak-linux-driver-8.7.0/test'
cp receivetest transmitest bitratetest filtertest pcanfdtst pcan-settings /usr/local/bin
make[1]: Leaving directory '/home/felipe/peak-linux-driver-8.7.0/test'


sudo modprobe pcan

modprobe: ERROR: could not insert 'pcan': Operation not permitted
modprobe: ERROR: ../libkmod/libkmod-module.c:979 command_do() Error running install command for pcan
modprobe: ERROR: could not insert 'pcan': Operation not permitted
Last edited by K.Wagner on Fri 12. Apr 2019, 15:08, edited 1 time in total.
Reason: Format applied for better reading

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

Re: Cannot connect with PCAN device

Post by M.Maidhof » Fri 12. Apr 2019, 15:13

if I ask for outputs, and you don´t send them completly, and later you write to me that you did it already three times, I think it is time to not answer anymore to your problem, until you change your behaviour....

think about it, before asking for free support for a third party application....

regards

Michael

afvillamil231
Posts: 9
Joined: Thu 11. Apr 2019, 16:47

Re: Cannot connect with PCAN device

Post by afvillamil231 » Fri 12. Apr 2019, 16:15

Sorry if I have been rough. I just felt you were asking me the same thing for a while and like not reading. I am sorry anyway.

Well, as information, I solved the problem! So, the modprobe did not accept the pcan operation because the Secure boot system does not give it the right permissions. In order to let the modprobe finish the driver installation, you have to disable the Secure boot from your computer. The solution was taken from here https://github.com/openrazer/openrazer/issues/677

Finally what I did was:
1. restart my pc from the boot set up
2. change the Secure boot option to disable
3. Go to linux again
4. make clean -> make -> sudo make install -> sudo modprobe pcan

So the output to cat /proc/pcan is now

Code: Select all

*------------- PEAK-System CAN interfaces (http://www.peak-system.com) -------------
*------------- Release_20181116_n (8.7.0) Apr 12 2019 16:03:30 --------------
*------------- [mod] [isa] [pci] [pec] [dng] [par] [usb] [pcc] --------------
*--------------------- 1 interfaces @ major 237 found -----------------------
*n -type- -ndev- --base-- irq --btr- --read-- --write- --irqs-- -errors- status
32    usb   -NA- ffffffff 015 0x001c 00000000 00000000 00000000 00000000 0x0000
Thank you for your time and your support! I will ask again if I have more questions.

Kind regards,

Felipe
Last edited by K.Wagner on Fri 12. Apr 2019, 16:19, edited 1 time in total.
Reason: Format applied for better reading

noorulj@gmail.com
Posts: 2
Joined: Mon 26. Aug 2019, 13:33

Re: Cannot connect with PCAN device

Post by noorulj@gmail.com » Mon 11. Nov 2019, 07:55

I too had similar issue of modprobe not finding pcan device. After disabling secure boot it worked for me..
PCAN device was getting detected till i restarted my Ubuntu system. Once i restarted it is again not working.
when i do
sudo modprobe pcan

i get the below errors...

Code: Select all

modprobe: ERROR: ../libkmod/libkmod-module.c:832 kmod_module_insert_module() could not find module by name='pcan'
modprobe: ERROR: could not insert 'pcan': Unknown symbol in module, or unknown parameter (see dmesg)
modprobe: ERROR: ../libkmod/libkmod-module.c:977 command_do() Error running install command for pcan
modprobe: ERROR: could not insert 'pcan': Operation not permitted

i run lsusb, i could see

Code: Select all

Bus 001 Device 046: ID 0c72:0014 PEAK System
Bus 001 Device 045: ID 0c72:0014 PEAK System
Bus 001 Device 044: ID 0c72:0014 PEAK System
Bus 001 Device 043: ID 0c72:4062 PEAK System
dmesg after running modprobe

Code: Select all

[250267.615236] usb 1-5: new full-speed USB device number 48 using xhci_hcd
[250308.484481] usb 1-5: new full-speed USB device number 52 using xhci_hcd
[250332.049207] usb 1-5: new full-speed USB device number 54 using xhci_hcd
[250332.161217] usb 1-5: device descriptor read/64, error -71
[250351.729810] usb 1-5: new full-speed USB device number 57 using xhci_hcd
[250366.982214] usb 1-5: new full-speed USB device number 59 using xhci_hcd
[250369.394296] usb 1-5: new full-speed USB device number 60 using xhci_hcd
[250376.338538] usb 1-5: new full-speed USB device number 61 using xhci_hcd
[250376.450557] usb 1-5: device descriptor read/64, error -71
[250383.014737] usb 1-5: new full-speed USB device number 62 using xhci_hcd
[250383.126766] usb 1-5: device descriptor read/64, error -71
[250391.687004] usb 1-5: new full-speed USB device number 64 using xhci_hcd
[250405.771437] usb 1-5: new full-speed USB device number 68 using xhci_hcd
[250419.583841] usb 1-5: new full-speed USB device number 70 using xhci_hcd

If i reinstall the driver it might start working.. But then i need to know that , do i have to reinstall everytime i restart the system
Last edited by M.Gerber on Mon 11. Nov 2019, 09:22, edited 1 time in total.
Reason: Inserted [code] tags for improved readability

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

Re: Cannot connect with PCAN device

Post by M.Maidhof » Mon 11. Nov 2019, 13:30

Hi,

you have to build and install the pcan driver with each kernel update. If you use the kernel integrated SocketCAN driver instead, you don't have to rebuild the driver with each kernel update.

So if you want to use SocketCAN, simply uninstall our pcan driver again and reboot your system once, to have the kernel driver active again.

regards

Michael

Post Reply