Library Mixup

I have two 1-Wire adapters that permit a computer to act as a bus master on a 1-Wire network.  The DS9097 is a serial to 1-Wire adapter, and requires a computer with a serial port.  The DS9490 is a USB to 1-Wire adapter and requires a USB port. I have used the DS9490 with my Windows workstation, and the DS9097 with my Linux weather station computer.  I needed a different plan with the Guruplug, as it doesn’t have a serial port like the old computer did.  I have an inexpensive USB to serial converter that could be used with the DS9097 if needed.

I had downloaded and installed the 1-Wire API for Java, but haven’t been able to get it to work properly with the DS9490 USB adapter on my current Windows workstation. It worked fine with my DS9097 serial port adapter.  I had it working previously (several years ago), but have since upgraded the OS on my workstation from Windows XP 32 bit to Vista 64 bit and then to Windows 7 64 bit.  Yes, it’s been a while since I tested my weather application on this workstation.  I hadn’t needed to run the application on my workstation since the XP days.  I just made changes as needed on Windows and tested on Linux, where I was running the DS9097 serial port adapter.  When I first ran into problems on my Windows workstation, I switched to the serial port adapter until I could diagnose the problem, chalking it up to a 32bit/64 bit driver issue.

Well, I finally got back to looking at the issue.  I ran the 1-Wire viewer that came with the Java API on my workstation, and it couldn’t see the USB adapter.  When I downloaded and ran the jump start version direct from the Dallas web site, it did see the adapter.  Also, the 64 bit version bundled with the driver could see the adapter as well.  I downloaded the newer source for the one bundled with the drivers, so I could study and compile the code.  It referenced classes and methods that weren’t in my 1-Wire API jar file.  I had  the library source as part of the API, and those classes weren’t there at all.  Also, the source for the 1-Wire viewer used the same methods for discovering and opening the adapter that my application was using.  So I couldn’t compile the viewer locally, and the source used the same methods for opening the adapter that I was using.

After some searching, I found that Dallas has an FTP site, where they had a newer version of the library and source than what was included in the official API.  Once I installed this “secret” library in place of the official one, the USB adapter worked fine.  For anybody stuck with the same problem as I was, here is a link to the FTP site.  Grab the onewireapi.jar file (and the corresponding source file if desired), and replace the one that came with the official API. The one wire viewer application source may provide some useful examples as well.