Test du «TEMPerHUM» de PCsensor
Phase 4: Test du «TEMPerHUM» de PCsensor dans un environnement Linux
Dans la phase 3, nous avons parlé de l’utilisation du capteur de température et d’humidité TEMPerHUM dans l’interface graphique Linux (interface utilisateur graphique)(interface utilisateur graphique). Maintenant, pour ceux d’entre vous qui préfèrent Linux CLI (interface de ligne de commande), il serait nécessaire de produire (ou, comme il est dit dans la terminologie Linux, de créer) un fichier exécutable approprié par vous-même parce que la société Pcsensor ne voulait pas (ou n’avait pas prévu) pour offrir tout équivalent Linux pour le logiciel TEMPerHUM pour Windows. Les solutions que nous avons trouvées sur le Web étaient basées sur divers packages de code source fournis par des programmeurs individuels, et on s’attendait à ce que les utilisateurs finaux produisent les exécutables du programme sur leurs propres machines. Commençons donc avec ce jeu amusant:
Veuillez noter que nous avons à nouveau utilisé Linux Debian 7.11 («Wheezy»), comme nous l’avons fait lors de nos précédents tests Linux. De plus, nous avons compilé les mêmes packages de programme sur différents matériels informatiques (un ordinateur de bureau et un ordinateur portable) en raison des variations possibles des capacités du système d’exploitation en fonction du type et de la vitesse du processeur, de la quantité de mémoire RAM, etc. (Cependant, si ce n’est pas le cas, spécifié dans un paragraphe particulier, seule une installation de bureau est décrite.)
1. Thermomètre USB (https://github.com/petechap/usb-thermometer)
Installation sur le bureau: La compilation du thermomètre USB a réussi, mais comme on le voit ci-dessous, inutile. Selon les instructions, vous devez avoir installé le logiciel libusb-dev sur votre ordinateur. Mon installation de bureau Debian 9.11 n’avait pas libusb-dev, je l’ai donc installée à partir du référentiel de logiciels Debian:
root@localhost:/usr/local/src/usb-thermometer-master# apt-get install libusb-dev Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: Use 'apt-get autoremove' to remove them. The following NEW packages will be installed: libusb-dev 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 40.8 kB of archives. After this operation, 239 kB of additional disk space will be used. Get:1 http://ftp.us.debian.org/debian/ wheezy/main libusb-dev i386 2:0.1.12-20+nmu1 [40.8 kB] Fetched 40.8 kB in 1min 48s (375 B/s) Selecting previously unselected package libusb-dev. (Reading database ... 319934 files and directories currently installed.) Unpacking libusb-dev (from .../libusb-dev_2%3a0.1.12-20+nmu1_i386.deb) ... Processing triggers for man-db ... Setting up libusb-dev (2:0.1.12-20+nmu1) ... root@localhost:/usr/local/src/usb-thermometer-master#
Après avoir installé libusb-dev, j’ai exécuté la commande make:
root@localhost:/usr/local/src/usb-thermometer-master# make cc -DUNIT_TEST -o pcsensor pcsensor.c -lusb root@localhost:/usr/local/src/usb-thermometer-master# ./pcsensor Couldn't find the USB device, Exiting root@localhost:/usr/local/src/usb-thermometer-master#
Malheureusement, comme indiqué dans les dernières lignes ci-dessus, l’exécutable pcsensor nouvellement construit n’a renvoyé rien d’autre qu’un message d’erreur car il s’attendait évidemment à ce que le matériel du capteur connecté soit du type USB « normal », ce qui n’était pas le cas ici ( parce que cette version du capteur TEMPerHUM était de type dit HID, ce qui signifie qu’il n’apparaissait pas du tout comme un véritable périphérique USB sous Linux).
Installation d’ordinateurs portables: La compilation du progiciel USB-thermomètre a réussi, mais encore une fois inutile. Avant de commencer la compilation elle-même, je me suis assuré que mon installation Debian 9.11 pour ordinateur portable était équipée du package logiciel libusb-dev requis: j’ai utilisé l’utilitaire APTonCD (créateur de disque d’installation pour les packages mis en cache APT) pour transférer les programmes téléchargés sur la machine de bureau (pour éviter le téléchargement à nouveau sur mon accès à distance lent à Internet).
root@localhost:/usr/local/src/usb-thermometer-master# make cc -DUNIT_TEST -o pcsensor pcsensor.c -lusb root@localhost:/usr/local/src/usb-thermometer-master# ./pcsensor Couldn't find the USB device, Exiting root@localhost:/usr/local/src/usb-thermometer-master#
Comme indiqué ci-dessus, le capteur n’a fourni aucune sortie car le logiciel s’attendait à ce que l’appareil soit un «vrai» périphérique USB alors qu’il était de type HID.
2. TEMPÉRÉ (https://github.com/edorfaus/TEMPered)
Installation sur ordinateur de bureau et portable: Pour compiler ce logiciel, il y avait deux prérequis: la bibliothèque HIDAPI et le système de construction CMake. L’auteur de TEMPered avait suggéré de construire la bibliothèque HIDAPI à partir de sources sur GitHub: https://github.com/signal11/hidapi donc je l’ai fait. (Voir le paragraphe suivant.)
2.1. HIDAPI (https://github.com/signal11/hidapi)
De son côté, l’auteur HIDAPI avait suggéré que pour construire sa bibliothèque il fallait installer les packages de développement libudev, libusb et éventuellement Fox-toolkit (pour le GUI de test). Sur les systèmes Debian / Ubuntu, ces paquets peuvent être installés en exécutant:
sudo apt-get install libudev-dev libusb-1.0-0-dev libfox-1.6-dev
(Sur mon installation de bureau Debian 7.11, cette étape a exigé le téléchargement de quelque 4,2 Mo de matériel à partir des référentiels Debian, qui incluaient également des fichiers supplémentaires non répertoriés dans la commande d’installation apt-get ci-dessus. Remarque: J’ai déjà installé tout ce qui précède sur mon installation d’ordinateur portable Debian 7.11, donc l’étape suivante a été ignorée sur l’ordinateur portable.)
root@localhost:/home/misko# apt-get install libudev-dev libusb-1.0-0-dev libfox-1.6-dev Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: libcups2-dev libfox-1.6-0 libgl1-mesa-dev libglu1-mesa-dev libxcursor-dev libxfixes-dev mesa-common-dev x11proto-fixes-dev Suggested packages: libfox-1.6-doc The following NEW packages will be installed: libcups2-dev libfox-1.6-0 libfox-1.6-dev libgl1-mesa-dev libglu1-mesa-dev libudev-dev libusb-1.0-0-dev libxcursor-dev libxfixes-dev mesa-common-dev x11proto-fixes-dev 0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded. Need to get 4,226 kB of archives. After this operation, 15.7 MB of additional disk space will be used. Do you want to continue [Y/n]? y Get:1 http://ftp.us.debian.org/debian/ wheezy/main libcups2-dev i386 1.5.3-5+deb7u6 [323 kB] Get:2 http://security.debian.org/ wheezy/updates/main libxfixes-dev i386 1:5.0-4+deb7u2 [23.3 kB] Get:3 http://ftp.us.debian.org/debian/ wheezy/main libcups2-dev i386 1.5.3-5+deb7u6 [323 kB] Get:4 http://ftp.us.debian.org/debian/ wheezy/main libfox-1.6-0 i386 1.6.45-1 [1,195 kB] Get:5 http://ftp.us.debian.org/debian/ wheezy/main mesa-common-dev i386 8.0.5-4+deb7u2 [277 kB] Get:6 http://ftp.us.debian.org/debian/ wheezy/main libgl1-mesa-dev i386 8.0.5-4+deb7u2 [32.7 kB] Get:7 http://ftp.us.debian.org/debian/ wheezy/main libglu1-mesa-dev i386 8.0.5-4+deb7u2 [220 kB] Get:8 http://ftp.us.debian.org/debian/ wheezy/main libudev-dev i386 175-7.2 [61.0 kB] Get:9 http://ftp.us.debian.org/debian/ wheezy/main libusb-1.0-0-dev i386 2:1.0.11-1 [185 kB] Get:10 http://ftp.us.debian.org/debian/ wheezy/main x11proto-fixes-dev all 1:5.0-2 [19.2 kB] Get:11 http://ftp.us.debian.org/debian/ wheezy/main libxcursor-dev i386 1:1.1.13-1+deb7u1 [33.8 kB] Get:12 http://ftp.us.debian.org/debian/ wheezy/main libfox-1.6-dev i386 1.6.45-1 [1,854 kB] Get:13 http://ftp.us.debian.org/debian/ wheezy/main libfox-1.6-dev i386 1.6.45-1 [1,854 kB] Get:14 http://ftp.us.debian.org/debian/ wheezy/main libfox-1.6-dev i386 1.6.45-1 [1,854 kB] Fetched 2,278 kB in 20min 13s (1,877 B/s) Selecting previously unselected package libcups2-dev. (Reading database ... 306320 files and directories currently installed.) Unpacking libcups2-dev (from .../libcups2-dev_1.5.3-5+deb7u6_i386.deb) ... Selecting previously unselected package libfox-1.6-0. Unpacking libfox-1.6-0 (from .../libfox-1.6-0_1.6.45-1_i386.deb) ... Selecting previously unselected package mesa-common-dev. Unpacking mesa-common-dev (from .../mesa-common-dev_8.0.5-4+deb7u2_i386.deb) ... Selecting previously unselected package libgl1-mesa-dev. Unpacking libgl1-mesa-dev (from .../libgl1-mesa-dev_8.0.5-4+deb7u2_i386.deb) ... Selecting previously unselected package libglu1-mesa-dev. Unpacking libglu1-mesa-dev (from .../libglu1-mesa-dev_8.0.5-4+deb7u2_i386.deb) ... Selecting previously unselected package libudev-dev. Unpacking libudev-dev (from .../libudev-dev_175-7.2_i386.deb) ... Selecting previously unselected package libusb-1.0-0-dev. Unpacking libusb-1.0-0-dev (from .../libusb-1.0-0-dev_2%3a1.0.11-1_i386.deb) ... Selecting previously unselected package x11proto-fixes-dev. Unpacking x11proto-fixes-dev (from .../x11proto-fixes-dev_1%3a5.0-2_all.deb) ... Selecting previously unselected package libxfixes-dev. Unpacking libxfixes-dev (from .../libxfixes-dev_1%3a5.0-4+deb7u2_i386.deb) ... Selecting previously unselected package libxcursor-dev:i386. Unpacking libxcursor-dev:i386 (from .../libxcursor-dev_1%3a1.1.13-1+deb7u1_i386.deb) ... Selecting previously unselected package libfox-1.6-dev. Unpacking libfox-1.6-dev (from .../libfox-1.6-dev_1.6.45-1_i386.deb) ... Processing triggers for man-db ... Setting up libcups2-dev (1.5.3-5+deb7u6) ... Setting up libfox-1.6-0 (1.6.45-1) ... Setting up mesa-common-dev (8.0.5-4+deb7u2) ... Setting up libgl1-mesa-dev (8.0.5-4+deb7u2) ... Setting up libglu1-mesa-dev (8.0.5-4+deb7u2) ... Setting up libudev-dev (175-7.2) ... Setting up libusb-1.0-0-dev (2:1.0.11-1) ... Setting up x11proto-fixes-dev (1:5.0-2) ... Setting up libxfixes-dev (1:5.0-4+deb7u2) ... Setting up libxcursor-dev:i386 (1:1.1.13-1+deb7u1) ... Setting up libfox-1.6-dev (1.6.45-1) ... update-alternatives: using /usr/bin/fox-config-1.6 to provide /usr/bin/fox-config (fox-config) in auto mode update-alternatives: using /usr/bin/reswrap-1.6 to provide /usr/bin/reswrap (reswrap) in auto mode root@localhost:/home/misko#
2.2. CMAKE
Installation sur le bureau: Pour installer CMAKE, j’ai utilisé Synaptic Package Manager qui en plus de cmake lui-même a ajouté cmake-data et emacsen-common, au total environ 6,2 Mo à télécharger. Il a fallu environ 25 minutes supplémentaires pour obtenir ces packages sur ma ligne de numérotation lente. (Soit dit en passant, pour cette tâche, j’aurais également pu utiliser mon ordinateur portable Debian 7.11, que j’utilise habituellement pour télécharger tout ce qui dépasse 1 Mo, et beaucoup plus rapidement grâce à l’accès Wi-Fi de mon université, et ce que je copie plus tard sur le bureau lent ordinateur avec une connexion lente à la maison, mais ce jour-là, il pleuvait beaucoup, donc je ne voulais pas sortir et me surcharger en me mouillant dans le campus universitaire.)
Installation d’ordinateurs portables: J’ai déjà eu tous les trucs CMAKE sur l’ordinateur portable. (En fait, j’ai utilisé les trois packages CMAKE téléchargés sur le bureau ci-dessus en tant que « fichiers source » pour Synaptic Package Manager de l’ordinateur portable, de sorte que je n’aurais pas besoin de les télécharger deux fois.)
L’auteur HIDAPI a suggéré que les utilisateurs qui avaient téléchargé un paquet source depuis le site Web manuellement (c’est-à-dire s’ils n’ont pas exécuté git clone), peuvent ignorer l’étape ./bootstrap et passer directement à l’étape ./configure. Cependant, cette possibilité n’a pas fonctionné correctement ici:
root@localhost:/usr/local/src/hidapi-master# ./configure --enable-testgui --prefix=/usr/local bash: ./configure: No such file or directory
… Donc j’ai joué ./bootstrap au début:
root@localhost:/usr/local/src/hidapi-master# ./bootstrap + autoreconf --install --verbose --force autoreconf: Entering directory `.' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force -I m4 autoreconf: configure.ac: tracing autoreconf: running: libtoolize --copy --force libtoolize: putting auxiliary files in `.'. libtoolize: copying file `./ltmain.sh' libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'. libtoolize: copying file `m4/libtool.m4' libtoolize: copying file `m4/ltoptions.m4' libtoolize: copying file `m4/ltsugar.m4' libtoolize: copying file `m4/ltversion.m4' libtoolize: copying file `m4/lt~obsolete.m4' autoreconf: running: /usr/bin/autoconf --force autoreconf: running: /usr/bin/autoheader --force autoreconf: running: automake --add-missing --copy --force-missing configure.ac:25: installing `./ar-lib' configure.ac:26: installing `./config.guess' configure.ac:26: installing `./config.sub' configure.ac:22: installing `./install-sh' configure.ac:22: installing `./missing' hidtest/Makefile.am: installing `./depcomp' autoreconf: Leaving directory `.' root@localhost:/usr/local/src/hidapi-master#
… Après cela, j’ai de nouveau exécuté ./configure:
root@localhost:/usr/local/src/hidapi-master# ./configure --enable-testgui --prefix=/usr/local checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for ar... ar checking the archiver (ar) interface... ar checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking how to print strings... printf checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for fgrep... /bin/grep -F checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1572864 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking how to convert i686-pc-linux-gnu file names to i686-pc-linux-gnu format... func_convert_file_noop checking how to convert i686-pc-linux-gnu file names to toolchain format... func_convert_file_noop checking for /usr/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from gcc object... ok checking for sysroot... no checking for mt... mt checking if mt is a manifest tool... no checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC -DPIC checking if gcc PIC flag -fPIC -DPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for ld used by g++... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC -DPIC checking if g++ PIC flag -fPIC -DPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking if g++ supports -c -o file.o... (cached) yes checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... (cached) GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking for gcc... gcc checking whether we are using the GNU Objective C compiler... no checking whether gcc accepts -g... no checking dependency style of gcc... gcc3 checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking whether make supports nested variables... yes checking operating system... i686-pc-linux-gnu (Linux back-end) checking for libudev... yes checking for clock_gettime in -lrt... yes checking for libusb... yes checking for the pthreads library -lpthreads... no checking whether pthreads work without any flags... no checking whether pthreads work with -Kthread... no checking whether pthreads work with -kthread... no checking for the pthreads library -llthread... no checking whether pthreads work with -pthread... yes checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE checking if more special flags are required for pthreads... no checking for PTHREAD_PRIO_INHERIT... no checking for fox... no checking for fox... yes configure: creating ./config.status config.status: creating pc/hidapi-hidraw.pc config.status: creating pc/hidapi-libusb.pc config.status: creating Makefile config.status: creating hidtest/Makefile config.status: creating libusb/Makefile config.status: creating linux/Makefile config.status: creating mac/Makefile config.status: creating testgui/Makefile config.status: creating windows/Makefile config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands root@localhost:/usr/local/src/hidapi-master#
… Il n’y a eu aucune plainte jusqu’à présent, j’ai donc exécuté make:
root@localhost:/usr/local/src/hidapi-master# make make all-recursive make[1]: Entering directory `/usr/local/src/hidapi-master' Making all in linux make[2]: Entering directory `/usr/local/src/hidapi-master/linux' CC hid.lo CCLD libhidapi-hidraw.la make[2]: Leaving directory `/usr/local/src/hidapi-master/linux' Making all in libusb make[2]: Entering directory `/usr/local/src/hidapi-master/libusb' CC hid.lo CCLD libhidapi-libusb.la make[2]: Leaving directory `/usr/local/src/hidapi-master/libusb' Making all in hidtest make[2]: Entering directory `/usr/local/src/hidapi-master/hidtest' CXX hidtest.o CXXLD hidtest-libusb CXXLD hidtest-hidraw make[2]: Leaving directory `/usr/local/src/hidapi-master/hidtest' Making all in testgui make[2]: Entering directory `/usr/local/src/hidapi-master/testgui' CXX test.o CXXLD hidapi-hidraw-testgui CXXLD hidapi-libusb-testgui make[2]: Leaving directory `/usr/local/src/hidapi-master/testgui' make[2]: Entering directory `/usr/local/src/hidapi-master' make[2]: Nothing to be done for `all-am'. make[2]: Leaving directory `/usr/local/src/hidapi-master' make[1]: Leaving directory `/usr/local/src/hidapi-master' root@localhost:/usr/local/src/hidapi-master#
… Rien à redire là aussi, donc je suis allé faire du make install:
root@localhost:/usr/local/src/hidapi-master# make install Making install in linux make[1]: Entering directory `/usr/local/src/hidapi-master/linux' make[2]: Entering directory `/usr/local/src/hidapi-master/linux' /bin/mkdir -p '/usr/local/lib' /bin/bash ../libtool --mode=install /usr/bin/install -c libhidapi-hidraw.la '/usr/local/lib' libtool: install: /usr/bin/install -c .libs/libhidapi-hidraw.so.0.0.0 /usr/local/lib/libhidapi-hidraw.so.0.0.0 libtool: install: (cd /usr/local/lib && { ln -s -f libhidapi-hidraw.so.0.0.0 libhidapi-hidraw.so.0 || { rm -f libhidapi-hidraw.so.0 && ln -s libhidapi-hidraw.so.0.0.0 libhidapi-hidraw.so.0; }; }) libtool: install: (cd /usr/local/lib && { ln -s -f libhidapi-hidraw.so.0.0.0 libhidapi-hidraw.so || { rm -f libhidapi-hidraw.so && ln -s libhidapi-hidraw.so.0.0.0 libhidapi-hidraw.so; }; }) libtool: install: /usr/bin/install -c .libs/libhidapi-hidraw.lai /usr/local/lib/libhidapi-hidraw.la libtool: install: /usr/bin/install -c .libs/libhidapi-hidraw.a /usr/local/lib/libhidapi-hidraw.a libtool: install: chmod 644 /usr/local/lib/libhidapi-hidraw.a libtool: install: ranlib /usr/local/lib/libhidapi-hidraw.a libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /usr/local/lib ---------------------------------------------------------------------- Libraries have been installed in: /usr/local/lib If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the `LD_RUN_PATH' environment variable during linking - use the `-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to `/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- /bin/mkdir -p '/usr/local/include/hidapi' /usr/bin/install -c -m 644 ../hidapi/hidapi.h '/usr/local/include/hidapi' make[2]: Leaving directory `/usr/local/src/hidapi-master/linux' make[1]: Leaving directory `/usr/local/src/hidapi-master/linux' Making install in libusb make[1]: Entering directory `/usr/local/src/hidapi-master/libusb' make[2]: Entering directory `/usr/local/src/hidapi-master/libusb' /bin/mkdir -p '/usr/local/lib' /bin/bash ../libtool --mode=install /usr/bin/install -c libhidapi-libusb.la '/usr/local/lib' libtool: install: /usr/bin/install -c .libs/libhidapi-libusb.so.0.0.0 /usr/local/lib/libhidapi-libusb.so.0.0.0 libtool: install: (cd /usr/local/lib && { ln -s -f libhidapi-libusb.so.0.0.0 libhidapi-libusb.so.0 || { rm -f libhidapi-libusb.so.0 && ln -s libhidapi-libusb.so.0.0.0 libhidapi-libusb.so.0; }; }) libtool: install: (cd /usr/local/lib && { ln -s -f libhidapi-libusb.so.0.0.0 libhidapi-libusb.so || { rm -f libhidapi-libusb.so && ln -s libhidapi-libusb.so.0.0.0 libhidapi-libusb.so; }; }) libtool: install: /usr/bin/install -c .libs/libhidapi-libusb.lai /usr/local/lib/libhidapi-libusb.la libtool: install: /usr/bin/install -c .libs/libhidapi-libusb.a /usr/local/lib/libhidapi-libusb.a libtool: install: chmod 644 /usr/local/lib/libhidapi-libusb.a libtool: install: ranlib /usr/local/lib/libhidapi-libusb.a libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /usr/local/lib ---------------------------------------------------------------------- Libraries have been installed in: /usr/local/lib If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the `LD_RUN_PATH' environment variable during linking - use the `-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to `/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- /bin/mkdir -p '/usr/local/include/hidapi' /usr/bin/install -c -m 644 ../hidapi/hidapi.h '/usr/local/include/hidapi' make[2]: Leaving directory `/usr/local/src/hidapi-master/libusb' make[1]: Leaving directory `/usr/local/src/hidapi-master/libusb' Making install in hidtest make[1]: Entering directory `/usr/local/src/hidapi-master/hidtest' make[2]: Entering directory `/usr/local/src/hidapi-master/hidtest' make[2]: Nothing to be done for `install-exec-am'. make[2]: Nothing to be done for `install-data-am'. make[2]: Leaving directory `/usr/local/src/hidapi-master/hidtest' make[1]: Leaving directory `/usr/local/src/hidapi-master/hidtest' Making install in testgui make[1]: Entering directory `/usr/local/src/hidapi-master/testgui' make[2]: Entering directory `/usr/local/src/hidapi-master/testgui' /bin/mkdir -p '/usr/local/bin' /bin/bash ../libtool --mode=install /usr/bin/install -c hidapi-hidraw-testgui hidapi-libusb-testgui '/usr/local/bin' libtool: install: /usr/bin/install -c .libs/hidapi-hidraw-testgui /usr/local/bin/hidapi-hidraw-testgui libtool: install: /usr/bin/install -c .libs/hidapi-libusb-testgui /usr/local/bin/hidapi-libusb-testgui make[2]: Nothing to be done for `install-data-am'. make[2]: Leaving directory `/usr/local/src/hidapi-master/testgui' make[1]: Leaving directory `/usr/local/src/hidapi-master/testgui' make[1]: Entering directory `/usr/local/src/hidapi-master' make[2]: Entering directory `/usr/local/src/hidapi-master' make[2]: Nothing to be done for `install-exec-am'. /bin/mkdir -p '/usr/local/share/doc/hidapi' /usr/bin/install -c -m 644 README.txt AUTHORS.txt LICENSE-bsd.txt LICENSE-gpl3.txt LICENSE-orig.txt LICENSE.txt '/usr/local/share/doc/hidapi' /bin/mkdir -p '/usr/local/lib/pkgconfig' /usr/bin/install -c -m 644 pc/hidapi-hidraw.pc pc/hidapi-libusb.pc '/usr/local/lib/pkgconfig' make[2]: Leaving directory `/usr/local/src/hidapi-master' make[1]: Leaving directory `/usr/local/src/hidapi-master' root@localhost:/usr/local/src/hidapi-master#
… rien à redire là aussi …
root@localhost:/usr/local/src/hidapi-master# cd linux root@localhost:/usr/local/src/hidapi-master/linux# make -f Makefile-manual g++ -Wall -g hid.o ../hidtest/hidtest.o `pkg-config libudev --libs` -lrt -o hidtest-hidraw cc -Wall -g `pkg-config libudev --libs` -lrt -shared -fpic -Wl,-soname,libhidapi-hidraw.so.0 hid.o -o libhidapi-hidraw.so root@localhost:/usr/local/src/hidapi-master/linux#
(Les deux actions ci-dessus ont produit un exécutable hidtest-hidraw.)
root@localhost:/usr/local/src/hidapi-master/linux# cd .. root@localhost:/usr/local/src/hidapi-master# cd testgui root@localhost:/usr/local/src/hidapi-master/testgui# make -f Makefile-manual g++ -Wall -g ../libusb/hid.o test.o -ludev -lrt -lpthread `fox-config --libs` `pkg-config libusb-1.0 --libs` -o testgui root@localhost:/usr/local/src/hidapi-master/testgui#
(Les trois étapes ci-dessus ont produit un exécutable testgui.)
… Maintenant je voulais effectuer des tests avec le logiciel HIDAPI:
root@localhost:/usr/local/src/hidapi-master/hidtest# ./hidtest-hidraw Device Found type: 0c45 7402 path: /dev/hidraw0 serial_number: Manufacturer: RDing Product: TEMPer1F_H1_V1.4 Release: 1 Interface: 0 Device Found type: 0c45 7402 path: /dev/hidraw1 serial_number: Manufacturer: RDing Product: TEMPer1F_H1_V1.4 Release: 1 Interface: 1 unable to open device root@localhost:/usr/local/src/hidapi-master/hidtest# ./hidtest-libusb Device Found type: 0c45 7402 path: 0003:002e:00 serial_number: (null) Manufacturer: RDing Product: TEMPer1F_H1_V1.4 Release: 1 Interface: 0 Device Found type: 0c45 7402 path: 0003:002e:01 serial_number: (null) Manufacturer: RDing Product: TEMPer1F_H1_V1.4 Release: 1 Interface: 1 unable to open device root@localhost:/usr/local/src/hidapi-master/hidtest#
… Puis j’ai essayé ce qui suit (changé le répertoire):
root@localhost:/usr/local/src/hidapi-master/hidtest# cd .. root@localhost:/usr/local/src/hidapi-master# cd linux root@localhost:/usr/local/src/hidapi-master/linux# ./hidtest-hidraw Device Found type: 0c45 7402 path: /dev/hidraw0 serial_number: Manufacturer: RDing Product: TEMPer1F_H1_V1.4 Release: 1 Interface: 0 Device Found type: 0c45 7402 path: /dev/hidraw1 serial_number: Manufacturer: RDing Product: TEMPer1F_H1_V1.4 Release: 1 Interface: 1 unable to open device root@localhost:/usr/local/src/hidapi-master/linux#
… Puis j’ai essayé ceci (changé de nouveau le répertoire):
root@localhost:/usr/local/src/hidapi-master/linux# cd .. root@localhost:/usr/local/src/hidapi-master# cd testgui root@localhost:/usr/local/src/hidapi-master/testgui# ./testgui
… Et il a finalement ouvert cette fenêtre:
… Puis j’ai essayé de me connecter au premier appareil répertorié (bien que les deux semblaient identiques):
… puis j’ai essayé d ‘ »Envoyer le rapport de sortie » (je n’ai rien renvoyé), suivi de « Envoyer le rapport de fonctionnalité » (il vient de fermer cette fenêtre prématurément), puis j’ai rouvert à nouveau cette interface graphique, suivi de « Obtenir le rapport de fonctionnalité » qui retourné quelques octets voir ci-dessous:
… C’était tout avec cette interface graphique. (La connexion au deuxième appareil répertorié était possible, mais l’envoi / la réception de rapports a échoué avec certains messages d’erreur peu clairs.)
Eh bien, je me suis remis au travail avec le package TEMPered:
root@localhost:/usr/local/src/hidapi-master/testgui# cd /usr/local/src/TEMPered-master root@localhost:/usr/local/src/TEMPered-master# root@localhost:/usr/local/src/TEMPered-master# make This