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 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.

1-Wire API for Java Setup Wizard. 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  
DS1923 iButton Hygrochron Temperature/Humidity Logger with 8KB Data-Log Memory  
DS2490 USB to 1-Wire Bridge Chip  
DS9490 USB to 1-Wire/iButton Adapter  


Next Steps
EE-Mail Subscribe to EE-Mail and receive automatic notice of new documents in your areas of interest.
Download Download, PDF Format (780.8kB)  

© Jun 15, 2015, 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.

APP 5917: Jun 15, 2015
APPLICATION NOTE 5917, AN5917, AN 5917, APP5917, Appnote5917, Appnote 5917