PCAN-USB Interface CAN pour USB on debian 9

This forum covers PCAN-Linux and Linux development issues concerning our products
4en1_4en1
Posts: 12
Joined: Wed 22. Aug 2018, 20:20

Re: PCAN-USB Interface CAN pour USB on debian 9

Post by 4en1_4en1 » Tue 28. Aug 2018, 17:06

je reprends à
make clean ( pour nettoyer au cas où....)

résultat :

Code: Select all

make[1] : on entre dans le répertoire « /home/suncy/peak-linux-driver-8.6.0/driver »
rm -f src/*o src/*~ src/.*cmd *o *ko *~ .*cmd  pcan.mod.c Module.symvers modules.order .cache.mk
make[1] : on quitte le répertoire « /home/suncy/peak-linux-driver-8.6.0/driver »
make[1] : on entre dans le répertoire « /home/suncy/peak-linux-driver-8.6.0/lib »
rm -f src/*~
rm -rf obj lib obj32 lib32
make[1] : on quitte le répertoire « /home/suncy/peak-linux-driver-8.6.0/lib »
make[1] : on entre dans le répertoire « /home/suncy/peak-linux-driver-8.6.0/test »
rm -f src/*~ src/*.o *~ receivetest transmitest bitratetest filtertest pcanfdtst pcan-settings
make[1] : on quitte le répertoire « /home/suncy/peak-linux-driver-8.6.0/test »
puis j'envoie la commande : make

résultat : (le processus est visiblement plus long)

Code: Select all

make[1] : on entre dans le répertoire « /home/suncy/peak-linux-driver-8.6.0/driver »
make[1]: rien à faire pour « depend ».
make[1] : on quitte le répertoire « /home/suncy/peak-linux-driver-8.6.0/driver »
make[1] : on entre dans le répertoire « /home/suncy/peak-linux-driver-8.6.0/driver »
***
*** Host machine kernel version=4.9.0-8-amd64
*** Driver kernel version=4.9.0-8-amd64 (4.9.0)
*** Path to kernel sources=/usr/src/linux-headers-4.9.0-8-amd64
*** use KBUILD=yes
*** cc version=6.3.0
***
make -C /usr/src/linux-headers-4.9.0-8-amd64  SUBDIRS=/home/suncy/peak-linux-driver-8.6.0/driver        EXTRA_CFLAGS="-I/home/suncy/peak-linux-driver-8.6.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] : on entre dans le répertoire « /usr/src/linux-headers-4.9.0-8-amd64 »
  CC [M]  /home/suncy/peak-linux-driver-8.6.0/driver/src/pcan_main.o
  CC [M]  /home/suncy/peak-linux-driver-8.6.0/driver/src/pcan_fops.o
  CC [M]  /home/suncy/peak-linux-driver-8.6.0/driver/src/pcan_fifo.o
  CC [M]  /home/suncy/peak-linux-driver-8.6.0/driver/src/pcan_filter.o
  CC [M]  /home/suncy/peak-linux-driver-8.6.0/driver/src/pcan_parse.o
  CC [M]  /home/suncy/peak-linux-driver-8.6.0/driver/src/pcan_sja1000.o
  CC [M]  /home/suncy/peak-linux-driver-8.6.0/driver/src/pcan_common.o
  CC [M]  /home/suncy/peak-linux-driver-8.6.0/driver/src/pcan_timing.o
  CC [M]  /home/suncy/peak-linux-driver-8.6.0/driver/src/pcanfd_core.o
  CC [M]  /home/suncy/peak-linux-driver-8.6.0/driver/src/pcanfd_ucan.o
  CC [M]  /home/suncy/peak-linux-driver-8.6.0/driver/src/pcan_pci.o
  CC [M]  /home/suncy/peak-linux-driver-8.6.0/driver/src/pcanfd_pci.o
  CC [M]  /home/suncy/peak-linux-driver-8.6.0/driver/src/pcan_pciec.o
  CC [M]  /home/suncy/peak-linux-driver-8.6.0/driver/src/pcan_isa.o
  CC [M]  /home/suncy/peak-linux-driver-8.6.0/driver/src/pcan_dongle.o
  CC [M]  /home/suncy/peak-linux-driver-8.6.0/driver/src/pcan_pccard_core.o
  CC [M]  /home/suncy/peak-linux-driver-8.6.0/driver/src/pcan_pccard.o
  CC [M]  /home/suncy/peak-linux-driver-8.6.0/driver/src/pcan_usb_core.o
  CC [M]  /home/suncy/peak-linux-driver-8.6.0/driver/src/pcan_usb.o
  CC [M]  /home/suncy/peak-linux-driver-8.6.0/driver/src/pcan_usbpro.o
  CC [M]  /home/suncy/peak-linux-driver-8.6.0/driver/src/pcanfd_usb.o
  LD [M]  /home/suncy/peak-linux-driver-8.6.0/driver/pcan.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/suncy/peak-linux-driver-8.6.0/driver/pcan.mod.o
  LD [M]  /home/suncy/peak-linux-driver-8.6.0/driver/pcan.ko
make[2] : on quitte le répertoire « /usr/src/linux-headers-4.9.0-8-amd64 »
make[1] : on quitte le répertoire « /home/suncy/peak-linux-driver-8.6.0/driver »
make[1] : on entre dans le répertoire « /home/suncy/peak-linux-driver-8.6.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

Info: only 64-bit version of libpcan can be built. 32-bit version of libpcan can't because the 32-bit version of libc seems not being installed...

make[1] : on quitte le répertoire « /home/suncy/peak-linux-driver-8.6.0/lib »
make[1] : on entre dans le répertoire « /home/suncy/peak-linux-driver-8.6.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] : on quitte le répertoire « /home/suncy/peak-linux-driver-8.6.0/test »
j'envoie
sudo make install

résultat :

Code: Select all

make[1] : on entre dans le répertoire « /home/suncy/peak-linux-driver-8.6.0/driver »
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] : on quitte le répertoire « /home/suncy/peak-linux-driver-8.6.0/driver »
make[1] : on entre dans le répertoire « /home/suncy/peak-linux-driver-8.6.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] : on quitte le répertoire « /home/suncy/peak-linux-driver-8.6.0/lib »
make[1] : on entre dans le répertoire « /home/suncy/peak-linux-driver-8.6.0/test »
cp receivetest transmitest bitratetest filtertest pcanfdtst pcan-settings /usr/local/bin
make[1] : on quitte le répertoire « /home/suncy/peak-linux-driver-8.6.0/test »

etape 2 : Vérifions la détection du matériel PEAK:

J'envoie : sudo modprobe pcan
résultat : ras
cd ..

je fais un test à vide
cat /proc/pcan
résultat

Code: Select all

*------------- PEAK-System CAN interfaces (http://www.peak-system.com) -------------
*------------- Release_20180720_n (8.6.0) Aug 28 2018 16:55:15 --------------
*------------- [mod] [isa] [pci] [pec] [dng] [par] [usb] [pcc] --------------
*--------------------- 0 interfaces @ major 245 found -----------------------
*n -type- -ndev- --base-- irq --btr- --read-- --write- --irqs-- -errors- status
ce qui me semble normal car je n'ai connecté le port usb au module Peak pcan


je fais un test avec l'adaptateur de connecté
cat /proc/pcan
résultat

Code: Select all

*------------- PEAK-System CAN interfaces (http://www.peak-system.com) -------------
*------------- Release_20180720_n (8.6.0) Aug 28 2018 16:55:15 --------------
*------------- [mod] [isa] [pci] [pec] [dng] [par] [usb] [pcc] --------------
*--------------------- 1 interfaces @ major 245 found -----------------------
*n -type- -ndev- --base-- irq --btr- --read-- --write- --irqs-- -errors- status
32    usb   -NA- ffffffff 000 0x001c 00000000 00000000 00000000 00000000 0x0000

1 interface cela me semble bon .et je n'ai appareil de connecté. Normal....
Last edited by M.Gerber on Wed 29. Aug 2018, 08:17, edited 1 time in total.
Reason: Inserted [code] tags for improved readability.

4en1_4en1
Posts: 12
Joined: Wed 22. Aug 2018, 20:20

Re: PCAN-USB Interface CAN pour USB on debian 9

Post by 4en1_4en1 » Tue 28. Aug 2018, 17:16

étape 3
Installation de l'API PCAN-Basic linux:

à la commande
wget http://www.peak-system.com/quick/BasicLinux -O PCAN_Basic_Linux-4.2.2.tar.gz
tar xvzf PCAN_Basic_Linux-4.2.2.tar.gz
cd PCAN_Basic_Linux-4.2.2/pcanbasic

tout semble ok

j'envoie make clean

résultat :

Code: Select all

Making lib PCANBasic with FD support (PCAN driver >8.0)
rm -f src/*~ src/*.o *~ *.so.* *.so 

puis j'envoie
Make

résultat :

Code: Select all

Making lib PCANBasic with FD support (PCAN driver >8.0)
*** Making lib PCANBasic with FD support (PCAN driver >8.0)
***
***
*** target=libpcanbasic.so
*** version=4.2.2
***
*** gcc version=6.3.0
***
gcc src/libpcanbasic.c src/pcaninfo.c src/pcanlog.c src/pcbcore.c src/pcblog.c src/pcbtrace.c src/libpcanfd/src/libpcanfd.c -fPIC -shared -O2 -Wall -Wl,-soname,libpcanbasic.so.4 -lc -lm -I. -I./src/libpcanfd -DNO_RT -o libpcanbasic.so.4.2.2 
ln -sf libpcanbasic.so.4.2.2 libpcanbasic.so.4
ln -sf libpcanbasic.so.4 libpcanbasic.so
puis j'envoie sudo make install

résulat :

Code: Select all

Making lib PCANBasic with FD support (PCAN driver >8.0)
cp libpcanbasic.so.4.2.2 /usr/lib/libpcanbasic.so.4.2.2
ln -sf /usr/lib/libpcanbasic.so.4.2.2 /usr/lib/libpcanbasic.so.4
ln -sf /usr/lib/libpcanbasic.so.4.2.2 /usr/lib/libpcanbasic.so.0
ln -sf /usr/lib/libpcanbasic.so.4 /usr/lib/libpcanbasic.so
cp PCANBasic.h /usr/include/PCANBasic.h
chmod 644 /usr/include/PCANBasic.h
/sbin/ldconfig

cd ../..
cela me semble ok !
Last edited by M.Gerber on Wed 29. Aug 2018, 08:17, edited 1 time in total.
Reason: Inserted [code] tags for improved readability.

4en1_4en1
Posts: 12
Joined: Wed 22. Aug 2018, 20:20

Re: PCAN-USB Interface CAN pour USB on debian 9

Post by 4en1_4en1 » Tue 28. Aug 2018, 17:24

Installation de l'outil 'pcaninfo' accompagnant l'API PCANBasic:
pour les commandes
cd PCAN_Basic_Linux-4.2.2/extras/pcaninfo
make
sudo make install
cd ../../..

résultat :

Code: Select all

-------- begin --------
gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Compiling C: src/main.c
gcc src/main.c ../../pcanbasic/src/pcanlog.c ../../pcanbasic/src/libpcanfd/src/libpcanfd.c ../../pcanbasic/src/pcblog.c ../../pcanbasic/src/pcbtrace.c ../../pcanbasic/src/pcbcore.c ../../pcanbasic/src/pcaninfo.c -ggdb  -I. -I../../pcanbasic/src -I../../pcanbasic/src/libpcanfd/src -I../../pcanbasic/src/libpcanfd -DNO_RT -Wall -Wcast-align -Wcast-qual -Wimplicit  -Wpointer-arith -Wswitch -Wredundant-decls -Wreturn-type -Wshadow -Wunused -lm -o pcaninfo

Errors: none
-------- end --------
Last edited by M.Gerber on Wed 29. Aug 2018, 08:17, edited 1 time in total.
Reason: Inserted [code] tags for improved readability.

4en1_4en1
Posts: 12
Joined: Wed 22. Aug 2018, 20:20

Re: PCAN-USB Interface CAN pour USB on debian 9

Post by 4en1_4en1 » Tue 28. Aug 2018, 17:25

et mainenant :
pcaninfo

Code: Select all

PCAN driver version: 8.6.0

  * pcanusb32: (/sys/class/pcan/pcanusb32)
  	- file: /dev/pcanusb32
  	- dev: "245:32"
  	- minor: 32
  	- base: 0
  	- irq: 0
  	-----------------
  	- adapter_name: "PCAN-USB"
  	- adapter_number: 0
  	- adapter_version: "2.8"
  	- type: "usb"
  	- hwtype: 11
  	- devid: 0xff
  	- ctrlr_number: 0
  	-----------------
  	- clock: 8 MHz
  	- nom_bitrate: 500 kBit/s
  	- btr0btr1: 0x1c
  	-----------------
  	- nom_brp: 1
  	- nom_sjw: 1
  	- nom_tseg1: 13
  	- nom_tseg2: 2
  	-----------------
  	- bus_state: Closed / Unknown (0)
  	- rx_error_counter: 0
  	- tx_error_counter: 0
  	- rx_fifo_ratio: 0%
  	- tx_fifo_ratio: 0%
  	-----------------
  	- irqs: 0
  	- status: 0
  	- errors: 0
  	- read: 0
  	- write: 0
  	-----------------
  	- TPCANHandle: "PCAN_USBBUS1" (0x051)
  	-----------------
Last edited by M.Gerber on Wed 29. Aug 2018, 08:19, edited 1 time in total.
Reason: Inserted [code] tags for improved readability.

4en1_4en1
Posts: 12
Joined: Wed 22. Aug 2018, 20:20

Re: PCAN-USB Interface CAN pour USB on debian 9

Post by 4en1_4en1 » Tue 28. Aug 2018, 17:43

Comme tout me semble OK..
j'ai connecté PC Cordon et Scoot et RAS.
Le voyant reste rouge, ne clignote pas, cela doit être normal .

Maintenant je dois lié le logiciel que j'ai 2012-01 VectrixDiagnosticGUI__32Setup.exe ( sous windows ) et le faire "tourner" sous debain 9.

F.Vergnaud
Software Development
Software Development
Posts: 305
Joined: Mon 9. Sep 2013, 12:21

Re: PCAN-USB Interface CAN pour USB on debian 9

Post by F.Vergnaud » Wed 29. Aug 2018, 09:38

Tout semble effectivement fonctionner correctement :
- la LED rouge indique que votre interface PCAN-USB est détectée et fonctionnelle.
- elle clignote lorsqu'il y a de l'activité sur le bus CAN (lecture ou écriture).

Bon courage avec Wine pour exécuter le logiciel Vectrix sous linux.
Best regards,
Fabrice

F.Vergnaud
Software Development
Software Development
Posts: 305
Joined: Mon 9. Sep 2013, 12:21

Re: PCAN-USB Interface CAN pour USB on debian 9

Post by F.Vergnaud » Wed 29. Aug 2018, 09:59

Pour information, le logiciel Vectrix utilise une ancienne API (PCAN-Light) qui n'est pas disponible sous Linux.
Outre les potentiels problèmes de drivers, il ne sera malheureusement pas possible d'exécuter ce logiciel avec Wine.
Best regards,
Fabrice

4en1_4en1
Posts: 12
Joined: Wed 22. Aug 2018, 20:20

Re: PCAN-USB Interface CAN pour USB on debian 9

Post by 4en1_4en1 » Wed 29. Aug 2018, 10:27

Merci pour votre professionnalisme.
Merci pour votre aide et votre confirmation oui les drivers semblent bien installés, le cordon et le boitier enfin reconnu.

je confirme, cela ne sera pas du tout évident pour la suite. Debian 9 + Wine + Soft Vectrix.

je reviendrai vers vous.

pour le moment j'espère que je suis sur la bonne piste.

Voici comment je recharge mon Vectrix ;)
Je mesure mes consommations et je peux faire des recharges 100% électricité solaire.
Et quand bien même ce n'est que 30% c'est toujours 30% de renouvelable en plus et 30% en moins d'énergie moins propre :)

D’où mon grand intérêt à me connecter à mon Vectrix.
Attachments
Le vectrix et le PV de  3 kwc
Le vectrix et le PV de 3 kwc
20180827_171009_small.jpg (316.51 KiB) Viewed 8012 times
La courbe de production en bleu et celle en orange pour la consommation.<br />j'ai pu faire deux charges 100% renouvelable et la dernière à 60 % environs, le reste des consos sont les machines à pain, lave vaisselle lave ling, qui fonctionnent la journée elles aussi.
La courbe de production en bleu et celle en orange pour la consommation.
j'ai pu faire deux charges 100% renouvelable et la dernière à 60 % environs, le reste des consos sont les machines à pain, lave vaisselle lave ling, qui fonctionnent la journée elles aussi.
Capture.jpg (68.23 KiB) Viewed 8016 times
Last edited by M.Gerber on Wed 29. Aug 2018, 15:15, edited 1 time in total.
Reason: Reduced image size

Post Reply