Archive:Wiimote : Compilation de cwiid sur Linux Mint 12

Ce wiki a été archivé en 2018.

Le nouveau wiki se trouve à: ressources.labomedia.org

Les fonctionnalités sont désactivées: vous pouvez faire une recherche sur Google site:https://wiki.labomedia.org et découvrir La Labomedia.

De Centre de Ressources Numériques - Labomedia
Aller à : navigation, rechercher

Modèle:Menu Interaction

Depuis les dépots

sudo apt-get install pd-wiimote lincwiid1 wmgui

Dans wmgui, l'info slow existe mais ne marche pas !
Donc il faut compiler !

Avec les sources

Il existe une bonne dizaine de fork de cwiid sur github

Vérification : patch appliqué ?

Les fichiers de cwiid sont bien ok pour motion plus slow message, inutile de patcher !

  • process.c
  • state.c
  • cwiid.h

Dépendances suffisantes mais non nécessaires

sudo apt-get install bison flex libbluetooth-dev libgtk2.0-dev python-dev libtool automake1.10 autoconf quilt patchutils python-all-dev cdbs lesstif2 poppler-data
sudo apt-get install autogen automake gcc bluetooth libbluetooth3-dev libgtk2.0-dev pkg-config python2.6-dev flex bison git-core libbluetooth-dev python-pygame python-tk

Compil de cwiid de abstrakraft

Error

make[1]: entrant dans le répertoire « /home/pierre/work/cwiid/wmdemo » gcc -g -Wall -W -DHAVE_CONFIG_H -I/home/pierre/work/cwiid/common/include -I../libcwiid -c -o wmdemo.o wmdemo.c wmdemo.c: In function ‘cwiid_callback’: wmdemo.c:313:63: attention : unused parameter ‘timestamp’ [-Wunused-parameter] gcc -L../libcwiid -o wmdemo wmdemo.o -lcwiid /usr/bin/ld: wmdemo.o: undefined reference to symbol 'str2ba' /usr/bin/ld: note: 'str2ba' is defined in DSO /usr/lib/libbluetooth.so.3 so try adding it to the linker command line /usr/lib/libbluetooth.so.3: could not read symbols: Invalid operation collect2: ld a retourné 1 code d'état d'exécution make[1]: *** [wmdemo] Erreur 1 make[1]: quittant le répertoire « /home/pierre/work/cwiid/wmdemo » make: *** [wmdemo] Erreur 2

Editer le fichier wmdemo/Makefile.in

La ligne 11 devient:

LDLIBS += -lcwiid -lbluetooth

puis

make clean
./configure
make

Compil de cwiid de bogado

aclocal
autoconf
./configure
make
sudo make install

Pas d'erreur. wmgui fonctionne bien, les infos "Slow" sont ok.

Compil de pd-wiimote

Créer un fichier Make.local dans le dossier pd-wiimote avec la ligne

CFLAGS += -DHAVE_CWIID_MOTIONPLUS_LOWSPEED

rm -f -- wiimote.o rm -f -- wiimote.pd_linux rm -f -- wiimote.o rm -f -- wiimote.pd_linux cc -DPD -I../../pd/src -Wall -W -g -I/usr/local/include -DVERSION='"0.3.2"' -fPIC -O6 -funroll-loops -fomit-frame-pointer -o "wiimote.o" -c "wiimote.c" wiimote.c: In function ‘addWiimsg’: wiimote.c:217:40: attention : unused parameter ‘mesg’ [-Wunused-parameter] wiimote.c:217:53: attention : unused parameter ‘timestamp’ [-Wunused-parameter] wiimote.c: Hors de toute fonction : wiimote.c:405:2: attention : #warning Balance ignores calibration data [-Wcpp] wiimote.c: In function ‘wiimote_dequeue’: wiimote.c:676:34: attention : parameter ‘nada’ set but not used [-Wunused-but-set-parameter] wiimote.c: In function ‘cwiid_error_callback’: wiimote.c:726:84: attention : unused parameter ‘ap’ [-Wunused-parameter] wiimote.c: In function ‘wiimote_doConnect’: wiimote.c:937:14: attention : variable ‘dong_bdaddr_ptr’ set but not used [-Wunused-but-set-variable] wiimote.c: Hors de toute fonction : wiimote.c:154:13: attention : ‘print_timestamp’ defined but not used [-Wunused-function] wiimote.c:217:13: attention : ‘addWiimsg’ defined but not used [-Wunused-function] cc -Wl,--export-dynamic -shared -fPIC -o "wiimote.pd_linux" "wiimote.o" -L/usr/local/lib -lcwiid -lbluetooth -lc chmod a-x "wiimote.pd_linux"

Seul l'info slow ne fonctionne pas dans pure data !

Utilisation du module python cwiid

Wiimote : Script python avec cwiid pour envoyer et recevoir en OSC propose d'utiliser le module python cwwid dans un script python qui envoie les datas en OSC.