JMRI Install Guide: USB ComponentsStarting in version 2.1.5, JMRI contains some tools for direct access to USB devices. We built in this support initially so that we could directly access the QSI Programmer and certain Insteon Powerline adapters, but hope that it will eventually be generally useful.
JInputCertain types of USB devices can be attached as a "HID device". (That stands for "Human Interface Device device", but let's not get distracted) The JInput project has provided tools for accessing these devices which we can use to connect HID devices to events within the JMRI programs.
As a first approach to this, you can find a "USB Input Control" under the Debug menu in JMRI 2.1.5 and later. A screen-shot of it is shown to the right. When you open the tool, you'll get a window that lets you browse the HID devices on your computer, and attach them to specific JMRI sensors and memories. You can then have Routes, Logix and scripts access that information to do whatever you'd like with the device inputs.
For more information, including some info on limitations, please see the help page for the tool.
LibUSBLibUSB (also known as libusb and libUSB) is a powerful, but tough to use, library for general access to all USB devices, not just HID devices. We intend to use it in JMRI to access Insteon adapters and other devices that have complicated (i.e. powerful) interfaces.
In JMRI 2.1.5, there's only a "USB Device Viewer" browsing tool that we'll be using to check connections to various USB devices on various types of computers. By putting this out in the general test release, even if it doesn't do anything model-railroad related, it makes it much easier to test how well this works in various situations.
Eventually, we'll have more in this section.
LimitationsThe browsing tool comes directly from libusb, and is coded to end the application when the window is closed. The libusb authors consider this a feature. Since we don't want to distribute our own version of the library with that behavior changed, we'll just live with it for now.
Installing LibUSBBefore you can use LibUSB on your computer, you have to download and install a library. The following sections talk about how to do that.
Windows XP and laterDownload and install the libusb-win32 installer. This is called the "filter mode driver", and it's the one you want.
There is currently no version of LibUSB for versions of Windows before XP, due to limitations in their USB support.
Ubuntu LinuxStart by opening
System > Administration > Synaptic Package Manager
and search for "libusb". There are four packages that start with that name; install them all.
Mac OS XYou need to install a library package to use libUSB on Mac OS X. Click here for an installer (you don't need the TWAIN or others, just LibUSB), or you can download an installer using one of the following direct links.
|Version||Package Type||Panther (10.3.x)||Tiger (10.4.x)||Leopard (10.5.x)||Sources||Project Homepage||libusb||0.1.13 beta 2008-02-02||binary||Installer||Installer||Installer||http://libusb.sourceforge.net/|