![]() |
Hardware: simple utility for send hex commands to usb device - Printable Version +- Forums (https://www.vdrift.net/Forum) +-- Forum: Community (https://www.vdrift.net/Forum/forumdisplay.php?fid=3) +--- Forum: General Discussion (https://www.vdrift.net/Forum/forumdisplay.php?fid=8) +--- Thread: Hardware: simple utility for send hex commands to usb device (/showthread.php?tid=848) |
- thelusiv - 03-17-2008 I don't think it's a 64-bit problem, as it works under Ubuntu Gutsy 64 for me. I think the problems are coming from your system's usb.h conflicting with the usb.h in the directory with the usbtool. - rm - 03-17-2008 Okay it works now. I was running either "python ./usbtool" or just "./usbtool". It turns out, I had to use "python2.5 ./usbtool", as Python 2.4 is the default version of Python in Debian. Another problem... ![]() Code: $ sudo python2.5 ./usbtool -d 044f:b202:0 f78e edit: Made a workaround for that by adding a line to usb.py to use "IN" endpoint as "out" (there are no any "OUT" endpoint, so it was failing). Dunno if this is correct at all. Anything I try to send to the device just causes it to unregister itself now. - thelusiv - 03-17-2008 You might also find it useful to use usbmon to log usb traffic while you play around with it. Use google to find a site detailing how to use usbmon, I don't remember well enough the steps to replicate it, but it was pretty easy. /dev/js0 disappeared - tof8pool - 04-21-2008 Hello, I can successfully use your usbtool . after each use, the /dev/jsX device file disappear, but we can just enter the following commands to make it appear again : sudo rmmod joydev sudo rmmod usbhid sudo modprobe usbhid at least, it works on my gentoo distrib. Hope this helps ! Full G25 wheel support under Linux (except force feedback) - pouillot - 05-12-2008 Hi, all. For the happy owners of a Logitech G25 wheel that did not manage yet to enjoy the full features of the beast under Linux, this is a small summary of what I found on the net and my own humble experience about it on a 2.6.22.9 Kernel (Mandriva 2008.0 x86_64) : Note: This is only my own understanding and summarizing of what people cleverer than me discovered by themselves. My work only consisted to put all the stuff together in an as clear, simple and explict as possible sum-up. See at the bottom for references and real authors. 1) when plugged in, the G25 identies itself as a Logitech Formula Force EX USB device (046d:c294) ; you only get 4 axes and 12 buttons, that is neither clutch pedal nor any of the 3trd to 6th gear on the grid shifter 2) to get the lacking native features of the beast, it must be sent a command to switch to its native mode, that makes it disconnect and reconnect as itself this time (USB device ids 046d:c299) Note: Another similar command can also switch it to the Logitech Driving Force Pro mode. 3) to send the command, you need a userland tool that basically writes the associated bytes on the USB device, and the one I am using is usbtool <ftp> (the package includes pre-built binaries for python 2.5, and sources if you need to build it yourself) ; to switch the G25 to its native mode, after plugging it in, I simply use : ./usbtool -v g25-set-extended-mode Note: you can also send other pre-configured commands with the usbtool (run ./usbtool --list-commands to see which) like g25-set-range-wheel-900 (teasing ;-) BUT: I never succeeded to send 2 successive commands to the device : the first one is generally OK (sometimes, though, you may need to repeat it), but the second (and following ones) seems to be completely ignored. 4) but this makes disappear the /dev/jsX and /dev/input/eventY devices ! to get them back and be able to play with the G25, I use : sudo rmmod joydev sudo rmmod usbhid sudo modprobe usbhid (man sudo and sudoers to be able to run these root commands) 5) Then, if you find that the "dead zone" at the center of the wheel is too large (the centered angle where nothing happens when you steer into), it is only beacause you need to calibrate your device. I use jscal (ff-utils @ http://www.sourceforge.net/projects/libff) to do that : a) plug-in the device b) send the native mode-switch command if you like (see above 3) c) jscal -c /dev/jsX (X being 0, 1, ... look which in /dev after plugging-in) d) jstest /dev/jsX (to test if everything fits your desire) e) jscal -p /dev/jsX (to get the jscal command to put in your .bashrc or any script you would run before your favorite games ...) Note: All this stuff should also work for a Driving Force Pro, and some says that it's also true for the Momo Racing wheels ... but don't tested. Now, as far as force feedback is concerned, I have no such good news for the moment : fftest and ffcstress don't work for me for the moment. References: Thanks to avl, eckzow, anrp, thelusiv, tof8pool, synapse247 and cuckoo, on http://vdrift.net forum : http://vdrift.net/Forum/viewtopic.php?t=866&postdays=0&postorder=asc&start=0 http://vdrift.net/Forum/viewtopic.php?t=412&postdays=0&postorder=asc&start=45 http://vdrift.net/Forum/viewtopic.php?t=541&postdays=0&postorder=asc&start=0 ftp://srv.l14.ru/pub/usbtool-0.1.tar.gz Thanks to Jiri Kosina, Chris Guirl, from the Linux input dev team http://www.mail-archive.com/linux-input@atrey.karlin.mff.cuni.cz http://www.mail-archive.com/linux-input@vger.kernel.org (search "g25" on each list) Hoping this helps ... Pouillot. G25 all axes / buttons AND force feedback - tof8pool - 09-27-2008 Here is my experience and some little tricks. First of all, I had to modify my kernel source code. I'm not a kernel developper, so I don't know If all the modification were needed. All those modifications shouldn't break anything as they are only new declarations, no logic has been modified. My kernel is a 2.6.25 In your /usr/src/linux/drivers/hid/hid-ff.c, add this line near line 60 : { 0x46d, 0xc299, hid_lgff_init }, /* Logitech G25 */ the file should look like this : Quote:#ifdef CONFIG_LOGITECH_FF In your /usr/src/linux/drivers/hid/hid-lgff.c, add this near line 58 : { 0x046d, 0xc299, ff_joystick }, the file should look like this : Quote:static const struct dev_type devices[] = { In your /usr/src/linux/drivers/hid/hid-quirks.c add this line near line 316 : #define USB_DEVICE_ID_LOGITECH_WHEELG25 0xc299 and this line near line 608 : { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WHEELG25, HID_QUIRK_NOGET }, the file should look like this: Quote:#define USB_DEVICE_ID_LOGITECH_HARMONY_64 0xc14fand this : Quote: { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVMC, HID_QUIRK_NOGET }, Once your new kernel has been compiled and booted, we can play a little bit with udev to make it run the commands needed to have /dev/jsX recreated when using usbtool. Create a file named /etc/udev/rules.d/99-G25.rules which content is : Quote:KERNEL=="event*", MODE="660", GROUP="games" then create a file named /etc/init.d/usbhid which content is : Quote:#!/bin/shAt least run udevadm control --reload_rules Now when U use usbtool to toggle your G25 wheel to extended mode, you should still have force feedback working and your /dev/jsX file should already have been recreated. With those tips I'm able to drive in vdrift with all axes and force feedback. Sorry, if some of my sentences are not very easy to understand, english is not my native language. Hope this helps - joevenzon - 09-28-2008 How does the force feedback feel? I haven't tried it yet. - bunder - 10-11-2008 i applied that patch to 2.6.25-gentoo-r8 and i still can't get fftest / ffcstress to acknowledge that the wheel has force feedback. were there any other modifications you had to make? thanks - tof8pool - 10-12-2008 bunder, I do not run 2.6.25-r8 yet because I can't compile the nvidia-driver with it. I did not modify anything else than already said. Can you give a little bit more details on how you're using fftest and ffcfstress ( are you getting error messages ?). Do you have any foce feedback before using usbtool ? For me fftest works only with effect number 1 ( constant force ). To run it, I have to use /dev/input/event2 like this : fftest /dev/input/event2 ffcfstress -d /dev/input/event2 joevenzon, the force feedback in the game is not very good compared to games like Rfactor or Live For Speed, but at least it does exist and to my knowledge, it is the first linux game trying to use force feedback. So because Vdrift is the first one, we need to be patient. No doubt they will succeed. - bunder - 10-12-2008 i unplugged my wheel, and plugged it in and ran fftest. it said it could only run effect 1 like yours did, but i couldn't tell any difference while it was running. on the other hand, ffcstress did work. now to find out why its still not working after i run usbtool and "rmmod joydev && rmmod usbhid && modprobe usbhid" :? i'll keep trying. thanks update: i got working. now to find out why wine/LFS (is that a bad word around here? heh) isn't using it... thanks a bunch guys ![]() - Rich43 - 10-18-2008 Thanks for the so called "fix", Ive tried recompiling a custom 2.6.27 kernel and just the module itself but have had no luck with force feedback. I can get it into 900 degrees and extended mode but thats as far as I get. No force feedback. Its the only thing stopping me from getting rid of windows for good as wine has vastly improved. I'm a avid driving game enthusiast. I use Ubuntu, I need someone to get this working on ubuntu! I have been frustrated with this problem since I bought the wheel about a year ago. I really badly want it to work fully and I am willing to write a python gui frontend for this once done (similar to the logitech tools on windows)! I can upload the .deb kernel image for ubuntu, it is 266MB though. Reply if you want it. Theres a ubuntu intrepid beta out, it comes with 2.6.27. - bunder - 10-19-2008 Rich43 Wrote:I can get it into 900 degrees and extended mode but thats as far as I get. No force feedback. can you run ffcstress against the /dev/input/event# device? also, you'll need to modify the permissions on the device, making it owned by the games group should be all you need. that way users can use the wheel with the ffb enabled. my script, in case you're not using the udev rule above: Code: # cat dowheel output looks like this: Code: # ./dowheel - Rich43 - 10-19-2008 Ok, I had another bash at it, found a small typo in my patch (missing comma) and reinstalled my custom kernel. It seems to put the g25 on event3. richie@richie-desktop:~/ff-utils$ sudo ./ffcfstress -d /dev/input/event3 ERROR: device (or driver) has no force feedback support [ffcfstress.c:165] Debug info: Code: custom g25 kernel: Code: richie@richie-desktop:~/usbtool-0.1$ sudo ./dowheel Code: richie@richie-desktop:~/ff-utils$ jstest /dev/input/js0 Code: richie@richie-desktop:~/ff-utils$ ./ffcfstress -d /dev/input/event3 Code: richie@richie-desktop:~/ff-utils$ ./fftest /dev/input/event3 Code: richie@richie-desktop:~/ff-utils$ ls -l /dev/input Code: richie@richie-desktop:~/ff-utils$ lsusb - tof8pool - 10-20-2008 Do you get force feedback before switching your wheel to extended mode ? - Rich43 - 10-20-2008 tof8pool Wrote:Do you get force feedback before switching your wheel to extended mode ? Nope, I think i need some way to tell if the modified driver was loaded or some ordinary driver. Perhaps some log message? How do I program that in? Im unfamiliar with kernel dev. Tho if you have other ideas to fix this, then that will help too. |