# Digitemp Issues with LinkUSB [resolved]

## rawbeefman

I am trying to get my 1 wire network running, using digitemp.  I have a LinkUSBi (usb to serial/cat5) adapter with one temp sensor connected.

When I run lsusb, I get:  

```

localhost ~ # lsusb

Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 004 Device 002: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC

Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

```

So I assume my device is at /dev/bus/usb/004/002.  But when I try to initialize the config file:

```

localhost ~ # digitemp -s/dev/bus/usb/004/002 -i

DigiTemp v3.5.0 Copyright 1996-2007 by Brian C. Lane

GNU Public License v2.0 - http://www.digitemp.com

Error 8: Open COM Failed

Error 24: Failed to initialize system resource

```

Anyone know what I'm missing?Last edited by rawbeefman on Fri Feb 25, 2011 8:55 pm; edited 2 times in total

----------

## chiefbag

Do you have the following modules compiled for the kernel?

For the serial to USB converter.

Device Drivers  --->

[*] USB support  --->

<M>   USB Serial Converter support  --->

<M>   USB FTDI Single Port Serial Driver

For the Maxim temp sensor.

Device Drivers  --->

<M> Dallas's 1-wire support  --->

1-wire Bus Masters  --->

<M> DS2490 USB <-> W1 transport layer for 1-wire

----------

## rawbeefman

Hey.  Sorry for the delay.  

I have all of those set, except for <M> USB FTDI Single Port Serial Driver  --  I couldn't find that one.

I am using kernel:   linux-2.6.34-gentoo-r1

lsmod shows:

```
localhost linux # lsmod

Module                  Size  Used by

usbserial              29109  0

ds2490                  6487  0

wire                   21686  1 ds2490

hwmon_vid               1947  0

skge                   35348  0

```

Thanks!

----------

## chiefbag

I am running 2.6.34-gentoo-r6 the module name is as below.

CONFIG_USB_SERIAL_FTDI_SIO=m

However I looked again at the hardware you are using and if its the one shown on the front of this link then I don't think you need the FTDI driver at all just the 1 wire module.

http://www.ibuttonlink.com/linkusb.aspx

Looking at the hardware, one end is a usb connection and the other is the rj11 connection for the sensors.

If this is the interface you are using then I'm pretty sure the ds2490 module is all you need.

This should be used to initilize the file.

digitemp -vv -i -c digitemp.conf -s USB

Your digitemp.conf should look something like this.

READ_TIME 1000

LOG_TYPE 1

LOG_FORMAT "%b %d %H:%M:%S Sensor %s C: %.2C"

CNT_FORMAT "%b %d %H:%M:%S Sensor %s #%n %C"

HUM_FORMAT "%b %d %H:%M:%S Sensor %s C: %.2C F: %.2F H: %h%%"

SENSORS 2

ROM 0 0x10 0xA0 0xCD 0x7D 0x01 0x08 0x00 0x81 

ROM 1 0x10 0xD6 0x03 0x7E 0x01 0x08 0x00 0xA3

This should work to read the sensor.

digitemp -c digitemp.conf -a -q USB > /tmp/current_temp.log

Hope this helps

----------

## rawbeefman

Thanks.

```
tux-server linux # digitemp -vv -i -c digitemp.conf -s /dev/bus/usb/004/002

DigiTemp v3.5.0 Copyright 1996-2007 by Brian C. Lane

GNU Public License v2.0 - http://www.digitemp.com

Error 8: Open COM Failed

Error 24: Failed to initialize system resource
```

I am beginning to think I have the wrong communication port?  How do I find the one I need?

----------

## chiefbag

I have'nt had this running in over a year but I'm fairly sure that just running 

digitemp -vv -i -c digitemp.conf -s USB

would pick up the device without specifying the actual address.

I ll try and dig out the hardware I have and double check.

----------

## rawbeefman

Thanks so much.

```
tux-server linux # digitemp -vv -i -c digitemp.conf -s USB

DigiTemp v3.5.0 Copyright 1996-2007 by Brian C. Lane

GNU Public License v2.0 - http://www.digitemp.com

Error, serial port 'USB' does not exists!
```

I am really stumped.  Thanks for you help.

----------

## rawbeefman

Here is something I am considering.  I just noticed here:  http://gentoo.linuxhowtos.org/portage/app-misc/digitemp

The build warning for digitemp:

```
If you don't choose a component to install, we default to ds9097u

/usr/bin/digitemp has been symlinked to /usr/bin/digitemp_${target}

If you want to access the others, they are available at /usr/bin/digitemp_*

```

And that the package has different use flags:  ds9097, ds9097u, ds2490.

As stated, digitemp defaulted to ds9097u.  Maybe if I re-emerge it with all of the USE flags and try it then?  When I get home I will give that a shot.[/quote][/code]

----------

## rawbeefman

Quick update; adding the USE flag was the way to go.  Now I get a different error output:

```
tux-server ~ # digitemp_DS2490 -s/dev/bus/usb -i

DigiTemp v3.5.0 Copyright 1996-2007 by Brian C. Lane

GNU Public License v2.0 - http://www.digitemp.com

USB ERROR: owAcquire called with invalid port string

```

Or ... 

```
tux-server ~ # digitemp_DS2490 -vv -i -c digitemp.conf -s USB

DigiTemp v3.5.0 Copyright 1996-2007 by Brian C. Lane

GNU Public License v2.0 - http://www.digitemp.com

USB ERROR: Attempted to select invalid port number

```

Hopefully you know where go from there?  Thanks!

----------

## rawbeefman

I made some ground.  I found and compiled the FTDI module in the kernel, and loaded it.  Now:

```
tux-server ~ # digitemp_DS9097U -vv -i -c digitemp.conf -s /dev/ttyUSB0

DigiTemp v3.5.0 Copyright 1996-2007 by Brian C. Lane

GNU Public License v2.0 - http://www.digitemp.com

Turning off all DS2409 Couplers

Searching the 1-Wire LAN

```

It doesnt find my sensors.  If I use digitemp_DS9097, it hangs on Turning off all DS2409 Couplers, so I assume I dont have that.  But really, dont know.

Any feedback?  Thanks!

----------

## chiefbag

@rawbeefman

Ok I got this up and running from what I can see and remember the ds2490 module should not be loaded.

Note below I had to unmask the latest version of digitemp for x86.

### Kernel Config ###

Device Drivers --->

<M> Dallas's 1-wire support  --->

vi /etc/portage/package.keywords

app-misc/digitemp ~x86

vi /etc/portage/package.unmask

=app-misc/digitemp-3.5.0-r1

lsusb

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 005 Device 002: ID 04fa:2490 Dallas Semiconductor DS1490F 2-in-1 Fob, 1-Wire adapter

Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

### Removed ds2490 Module ###

rmmod ds2490

### To Configure Sensors, Note the actual address of the device is not specified it will pick it up automatically  ###

digitemp_DS2490 -vv -i -c digitemp.conf -s USB

DigiTemp v3.5.0 Copyright 1996-2007 by Brian C. Lane

GNU Public License v2.0 - http://www.digitemp.com

Found DS2490 device #1 at 005/002

Turning off all DS2409 Couplers

...

Searching the 1-Wire LAN

10A0CD7D01080081 : DS1820/DS18S20/DS1920 Temperature Sensor

10D6037E010800A3 : DS1820/DS18S20/DS1920 Temperature Sensor

ROM #0 : 10A0CD7D01080081

ROM #1 : 10D6037E010800A3

Wrote digitemp.conf

### To Read Sensors ###

digitemp -c digitemp.conf -a -q USB

Found DS2490 device #1 at 005/002

Jan 28 11:55:52 Sensor 0 C: 23.31 F: 73.96

Jan 28 11:55:53 Sensor 1 C: 22.69 F: 72.84

----------

## rawbeefman

I removed the ds2490, and got this:

```
tux-server ~ # digitemp_DS2490 -vv -i -c digitemp.conf -s USB

DigiTemp v3.5.0 Copyright 1996-2007 by Brian C. Lane

GNU Public License v2.0 - http://www.digitemp.com

USB ERROR: Attempted to select invalid port number
```

Then I realize, bad new:

```
tux-server ~ # lsusb

Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 004 Device 002: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC

Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
```

It looks like we have different hardware.  Really bummed, I want this to work so badly.  It's holding up my bathroom remodel.  

Thanks for the help.

----------

## chiefbag

Can you post a link to the exact hardware you are using?

----------

## rawbeefman

Its this one:  http://www.ibuttonlink.com/linkusbi.aspx

I wonder how often these are defective?

----------

## chiefbag

Humm, I wonder looking at the docs I see the below excerpt 

"The FTDI driver creates a virtual COM port on the host computer to communicate with

the LinkUSB™"

Maybe you should look under /dev and see what device appears when you plug in the adaptor.

I'm guessing something like the following command may solve your problem

digitemp_DS2490 -vv -i -c digitemp.conf -s /dev/ttyS0

Or

digitemp_DS2490 -vv -i -c digitemp.conf -s /dev/ttyUSB0

Also you could try installing the windows drivers and on a Windows box to prove the hardware is ok

----------

## chiefbag

 *Quote:*   

> tux-server ~ # digitemp_DS9097U -vv -i -c digitemp.conf -s /dev/ttyUSB0
> 
> DigiTemp v3.5.0 Copyright 1996-2007 by Brian C. Lane
> 
> GNU Public License v2.0 - http://www.digitemp.com
> ...

 

Sorry missed out on that part of your earlier post. 

Looks like your on the right track.

Id say try running that command a few times it seems to hang and return nothing on occasion.

After that I would double check the wiring of the sensors.

Hope that helps some.

----------

## chiefbag

I reckon you have defiantly overcome the hardware to OS problem. 

As from your above posts it can be seen that you are observing the same output from the digitemp program as it attempts to probe the sensors. 

Searching the 1-Wire LAN

I will take a few snaps of the actual wiring to the sensors and the module. 

Note I see on diff already that you have an RJ45 and I have an RJ11.

----------

## rawbeefman

Welp -- issue solved.  It came down to a bad cat5 wire.  All of your posts turned out to be a really incredible reference when I picked this up a month later.  Chiefbag, you are the man.  Thank you for all your effort.

----------

## chiefbag

@rawbeefman

I'm glad I could be of assistance, had similar wiring problems myself at the start and its not easy to diagnose.

I'm always interested in this type of stuff so please PM me if you have any other similar projects in the future  :Smile: 

----------

