Errors |
Instructions for Compiling the OneWireViewer for Linux
This guide shows how to compile and run the OneWireViewer under Linux®. The OneWireViewer is a software program to exercise Maxim Integrated's 1-Wire® and iButton® devices. These instructions were tested for Ubuntu Linux.
Download the zip file. Open a terminal window and unzip the contents by:
$ unzip OneWireViewer-Linux.zip
First, build the PDKAdapterUSB Java® class for the OneWireViewer using Java Native Interface (JNI). This uses the DS2490 adapter with libusb and is based on the 1-Wire Public Domain Kit (PDK). The libusb development headers and build-essentials (compiler/build tools) can be installed by:
$ sudo apt-get install libusb-dev build-essential
The make file assumes that the installed Java version is the OpenJDK version. The make file uses the header files from JDK (Java Development Kit). Install the library and header files via:
$ sudo apt-get install openjdk-7-jdk
If a different Java version is used, you may need to modify the make file to include a path for the Java header files for the targeted Java version. OpenJDK is the default Java version in Ubuntu.
Next, compile the Java class, and install the system shared library:
$ cd OneWireViewer-Linux/PDKAdapterUSB $ make $ sudo make install
This will install the shared JNI library to /usr/local/lib.
The included OneWireAPI's OneWireAccessProvider has already been modified to include the PDKApapterUSB.
You should not plug in the DS9490 until the following sections of instructions are completed. By default, the kernel modules ds2490 and wire are loaded when the device is plugged in, but in our case we would like to access the DS9490R via libusb. You should modify the black list file to prevent this from occurring:
$ sudo gedit /etc/modprobe.d/blacklist.conf
Add a line to the bottom,
# Prevent ds2490 module from loading for OneWireViewer with libusb blacklist ds2490
To automatically set the correct permissions, create a new udev rule file to set the permissions. The DS9490 will be set to allow read and write to users in the plugdev group.
$ sudo gedit /etc/udev/rules.d/99-one-wire.rules
with the contents:
ATTRS{idVendor}=="04fa", ATTRS{idProduct}=="2490", GROUP="plugdev", MODE="0664"
Now, you may plug in the DS9490 and run OneWireViewer:
$ cd .. $ cd OneWireViewer $ bash run.sh
The run.sh script sets the Java classpath and library path for JNI. When the "1-Wire API for Java Setup Wizard" appears, select "USB1" for the port.
Figure 1. 1-Wire API for Java Setup Wizard.
Next Steps | ||
EE-Mail | Subscribe to EE-Mail and receive automatic notice of new documents in your areas of interest. | |
Download | Download, PDF Format |
© , Maxim Integrated Products, Inc. |
APP 5917:
APPLICATION NOTE 5917, AN5917, AN 5917, APP5917, Appnote5917, Appnote 5917 |