Keywords: OneWireViewer, Linux, iButton, 1-Wire Public Domain Kit
APPLICATION NOTE 5917

INSTRUCTIONS FOR COMPILING THE
ONEWIREVIEWER FOR LINUX
By: Wilson Tang, Member of Technical Staff
Abstract: This guide shows how to compile and run the OneWireViewer under 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 weretested 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 theheader 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 Javaheader 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 installThis will install the shared JNI library to /usr/local/lib.
The included OneWireAPI's OneWireAccessProvider has already been modified to include thePDKApapterUSB.

Page 1 of 4

You should not plug in the DS9490 until the following sections of instructions are completed. By default, thekernel modules ds2490 and wire are loaded when the device is plugged in, but in our case we would like toaccess 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.ruleswith 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.

Page 2 of 4

Figure 1. 1-Wire API for Java Setup Wizard.

1-Wire is a registered trademark of Maxim Integrated Products, Inc.
iButton is a registered trademark of Maxim Integrated Products, Inc.
Java is a registered trademark and registered service mark of Oracle and/or its affiliates.
Linux is a registered trademark of Linus Torvalds.

Related Parts
DS1921G

Thermochron iButton Device

DS1922L

iButton Temperature Loggers with 8KB Data-Log Memory

DS1922T

iButton Temperature Loggers with 8KB Data-Log Memory

DS1923iButton Hygrochron Temperature/Humidity Logger with 8KB
Data-Log Memory

DS2490

USB to 1-Wire Bridge Chip

DS9490

USB to 1-Wire/iButton Adapter

DS9490R

USB to 1-Wire/iButton Adapter

Page 3 of 4

Application Note 5917: http://www.maximintegrated.com/en/an5917
APPLICATION NOTE 5917, AN5917, AN 5917, APP5917, Appnote5917, Appnote 5917
© 2014 Maxim Integrated Products, Inc.
The content on this webpage is protected by copyright laws of the United States and of foreign countries.
For requests to copy this content, contact us.
Additional Legal Notices: http://www.maximintegrated.com/en/legal

Page 4 of 4