Hallo,
ich möchte grade den JoyWarrior24f14 zum laufen bringen. Sowohl unter Ubuntu als auch unter Raspbian wird der Sensor unter lsusb gefunden. Wenn ich aber den auf der libapi basierten Beispielcode vom Hersteller ausführen will, sagt mir die Shell einfach:
Unter Raspbian:
pi@raspberrypi ~/Desktop/jw $ ./jw24f14 JoyWarrior not found
aber:
pi@raspberrypi ~/Desktop/jw $ lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. Bus 001 Device 004: ID 07c0:1116 Code Mercenaries Hard- und Software GmbH JoyWarrior24F14 Bus 001 Device 005: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS] pi@raspberrypi ~/Desktop/jw $
Und unter Ubuntu funktionierts:
tollerbenutzer@Ubuntubox:~/Desktop/jw$ jw24f14 Device Found type: 07c0 1116 path: /dev/hidraw0 serial_number: 000009BB interface_number: 0 Manufacturer: Code Mercenaries Product: JoyWarrior24F14 Device Found type: 07c0 1116 path: /dev/hidraw1 serial_number: 000009BB interface_number: 1 Manufacturer: Code Mercenaries Product: JoyWarrior24F14 Device open Manufacturer String: Code Mercenaries Product String: JoyWarrior24F14 Serial Number String: (48) 000009BB 0 bytes read.x 0 y 0 z 0 x -1900 y 174 z 3707 x -1903 y 171 z 3706 x -1901 y 174 z 3709 x -1900 y 177 z 3712 x -1903 y 180 z 3713 x -1902 y 180 z 3715 x -1904 y 180 z 3713 x -1903 y 180 z 3710 x -1903 y 178 z 3707 x -1903 y 177 z 3708 x -1903 y 177 z 3706 x -1902 y 177 z 3707 x -1897 y 176 z 3709 x -1898 y 177 z 3709 x -1900 y 177 z 3706 x -1901 y 177 z 3706 x -1903 y 178 z 3705 x -1904 y 178 z 3706 x -1905 y 179 z 3707 x -1907 y 180 z 3710 x -1904 y 180 z 3712 x -1905 y 180 z 3715 x -1906 y 179 z 3716 x -1904 y 179 z 3713 x -1901 y 181 z 3710 x -1900 y 182 z 3711 x -1900 y 182 z 3712 x -1903 y 182 z 3714 x -1907 y 181 z 3714 x -1906 y 178 z 3715 x -1904 y 178 z 3714 x -1904 y 179 z 3713 x -1901 y 179 z 3715 x -1901 y 177 z 3715 x -1903 y 177 z 3716 x -1902 y 180 z 3720 x -1900 y 181 z 3721 x -1899 y 180 z 3717 x -1900 y 180 z 3711 x -1902 y 181 z 3711 x -1903 y 178 z 3711 x -1903 y 176 z 3709 x -1905 y 173 z 3709 x -1905 y 175 z 3712 x -1905 y 176 z 3713 x -1904 y 178 z 3715 x -1904 y 178 z 3715 x -1903 y 176 z 3715 x -1899 y 176 z 3714 x -1901 y 175 z 3712 x -1902 y 175 z 3709 x -1903 y 176 z 3710 x -1904 y 179 z 3711 x -1902 y 178 z 3715 x -1902 y 176 z 3714 x -1903 y 177 z 3714 x -1905 y 178 z 3713 x -1905 y 177 z 3712 x -1904 y 177 z 3710 x -1903 y 177 z 3713 x -1901 y 177 z 3720 x -1901 y 178 z 3722 x -1899 y 177 z 3720 x -1900 y 175 z 3715 x -1903 y 174 z 3709 x -1906 y 175 z 3704 x -1909 y 176 z 3704 x -1906 y 178 z 3706 x -1902 y 179 z 3706 x -1904 y 180 z 3705 x -1905 y 180 z 3703 x -1904 y 180 z 3707 x -1905 y 178 z 3711 x -1906 y 175 z 3714 x -1905 y 175 z 3712 x -1903 y 175 z 3710 x -1905 y 174 z 3709 x -1906 y 174 z 3706 x -1908 y 173 z 3706 x -1905 y 176 z 3708 x -1903 y 177 z 3710 x -1903 y 178 z 3711 x -1906 y 178 z 3710 x -1907 y 176 z 3713 x -1906 y 176 z 3716 x -1906 y 174 z 3716 x -1903 y 175 z 3716 x -1904 y 176 z 3716 x -1903 y 175 z 3713 x -1902 y 173 z 3709 x -1901 y 171 z 3707 x -1900 y 172 z 3706 x -1897 y 175 z 3710 x -1897 y 175 z 3710 x -1900 y 176 z 3711 x -1902 y 176 z 3712 x -1902 y 174 z 3712 x -1905 y 174 z 3710 x -1904 y 174 z 3710 tollerbenutzer@Ubuntubox:~/Desktop/jw$
aber:
tollerbenutzer@Ubuntubox:~/Desktop$ lsusb Bus 001 Device 002: ID 5986:0241 Acer, Inc BisonCam, NB Pro Bus 001 Device 003: ID 0bda:0158 Realtek Semiconductor Corp. USB 2.0 multicard reader Bus 002 Device 002: ID 07c0:1116 Code Mercenaries Hard- und Software GmbH JoyWarrior24F14 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Der Hersteller meinte, dass es evtl. daran liegt, dass ich den User der Gruppe root zuweisen muss:
Unter Ubuntu gibt es keine reinen Root-User, daher musste ich meine Profil explezit die root-Gruppe zuweisen. Evtl auch mal die USERS Gruppe zuweisen (0666 Rechte aus der rules Datei).
Für die Rules liegt ja die 99-hid.rules bei, die ja genau das da unten vornimmt.
Die hidlib/hidapi bekommt man aus dem Git-Repo (http://www.signal11.us/oss/hidapi/).
Die 99-hid.rules Datei wurde mir vom Hersteller des JoyWarrior zur Verfügung gestellt und beinhaltet:
# This is a sample udev file for HIDAPI devices which changes the permissions # to 0666 (world readable/writable) for a specified device on Linux systems. # If you are using the libusb implementation of hidapi (hid-libusb.c), then # use something like the following line, substituting the VID and PID with # those of your device. Note that for kernels before 2.6.24, you will need # to substitute "usb" with "usb_device". It shouldn't hurt to use two lines # (one each way) for compatibility with older systems. # HIDAPI/libusb SUBSYSTEM=="usb", ATTRS{idVendor}=="07C0", ATTRS{idProduct}=="0140", MODE:="666", GROUP="users" SUBSYSTEM=="usb", ATTRS{idVendor}=="07c0", ATTRS{idProduct}=="1116", MODE:="666", GROUP="users" # If you are using the hidraw implementation, then do something like the # following, substituting the VID and PID with your device. Busnum 1 is USB. # HIDAPI/hidraw KERNEL=="hidraw*", ATTRS{idVendor}=="07c0", ATTRS{idProduct}=="0140", MODE:="666", GROUP="users" KERNEL=="hidraw*", ATTRS{idVendor}=="07c0", ATTRS{idProduct}=="1116", MODE:="666", GROUP="users" # Once done, optionally rename this file for your device, and drop it into # /etc/udev/rules.d and unplug and re-plug your device. This is all that is # necessary to see the new permissions. Udev does not have to be restarted. # Note that the hexadecimal values for VID and PID are case sensitive and # must be lower case. # If you think permissions of 0666 are too loose, then see: # http://reactivated.net/writing_udev_rules.html for more information on finer # grained permission setting. For example, it might be sufficient to just # set the group or user owner for specific devices (for example the plugdev # group on some systems).
uname -a schmeißt mir aufm Pi aus:
Linux raspberrypi 3.2.27+ #307 PREEMPT Mon Nov 26 23:22:29 GMT 2012 armv6l GNU/Linux
und unter Ubuntu 12.10 32bit:
Linux Ubuntubox 3.5.0-18-generic #29-Ubuntu SMP Fri Oct 19 10:27:31 UTC 2012 i686 i686 i686 GNU/Linux
Somit sollte die rules-Datei auch auf beiden Systemen funktionieren.
# Once done, optionally rename this file for your device, and drop it into # /etc/udev/rules.d and unplug and re-plug your device. This is all that is # necessary to see the new permissions. Udev does not have to be restarted.
Auf beiden Systemen habe ich die rules-Datei verschoben und den Sensor mal aus- und wieder eingesteckt, zur Sicherheit aber das System auch mal rebootet, aber ich bekomme beim Raspbian immer die Meldung, dass der JoyWarrior nicht gefunden werden kann, während Ubuntu mir Messwerte ausspuckt.
So langsam weiß ich nicht mehr, was ich machen könnte, um den Sensor auf dem Pi zu betreiben...