digitemp_DS2490 fails to detect sensors

Bug #1397382 reported by Patrick Smears
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
digitemp (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

 The version of digitemp_DS2490 in Trusty and later (and possibly previous versions, though it has worked for us before) does not detect temperature sensors connected to the One-wire network. For reference, we're using

digitemp:i386/trusty 3.6.0+dfsg1-2

but it is likely that other versions are affected too.

To reproduce:
 - Connect some temperature sensors via a DS2490 USB-to-1wire adapter
 - Run: digitemp_DS2490 -i

Expected results:
 - The sensors are detected and listed on the output (and in a .digitemprc file); this takes a few seconds

Actual results:
 - No sensors are detected; the program returns immediately.

Diagnosis:
This seems to be a (long-standing?) bug in how the code resets the 1-Wire bus via USB. There are a number of issues:
 - The DS2490 returns the operation result via interrupt data, but the program reads it via normal data.
 - A result is only returned if the appropriate bit is set to request it; the program does not set this bit.
 - The program requests 32 (0x20) bytes from the USB device, but does not check how many were actually returned (and hence whether any result actually came back) - the device will always return 16 (0x10) status bytes, but any result bytes follow these.

Thus the program detects status or failure by reading a byte in the buffer that the device has not actually modified. In cases where the program worked, this is likely to be because the value happened to be set to the right value (0 will do) by chance.

Fix:
I'll attach a patch to the bug that addresses these issues.

Tags: patch
Revision history for this message
Patrick Smears (patri5k) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Patch to fix issue reading result after resetting 1wire bus via USB" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package digitemp - 3.6.0+dfsg1-4

---------------
digitemp (3.6.0+dfsg1-4) unstable; urgency=medium

  * Update Vcs location
  * Properly reset the 1-Wire bus on DS2490 (LP: #1397382)
  * Bump standards version to 3.9.6, no change

 -- Ryan Finnie <email address hidden> Sun, 29 Nov 2015 02:43:36 +0000

Changed in digitemp (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.