[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Newbie help with simple C program, USB device under Debian



27-09-2007, Nick Lidakis:
> Sending this again as it did not seem to get to the list when I first 
> sent it this morning.

Oh, man, are you serious?

First. No one interested in you prev. email sending failures, right.
Because this is a noise, not information.

> I am need of some help with a USB device under Debian; trying last night
> multiple times to no avail.

Second. Debian is a software distribution. What system are using is
possible to see, after `uname -a`:

#v+
olecom@flower:/tmp$ uname -a
Linux flower 2.6.18-4-amd64 #1 SMP Fri May 4 00:37:33 UTC 2007 x86_64 GNU/Linux
olecom@flower:/tmp$
#v-

See Linux? That means, that a guy, talking to your hardware is Linux, not
Hurd or FreeBSD, alright.

> I have a Dallas Semiconductor Thermochron temperature data logger that I
> am trying to set. The data logger (DS1921G-F5) is attached to a USB
> bridge (DS1921G-F5). I downloaded their linux utilities which consist of
> two simple C programs: One to set a "mission"  and the other to download
> the datat logged:
>
> thermo21.c  thermo21.h  thermodl.c  thermoms.c
>
> The readme states:

Stop. If this info is available on-line, please give an URL. If this is
closed NDA stuff, and you are newbie driver programmer, then you'd better
keep it away. :)

> /These utilities are used to download (thermodl) and
> mission (thermoms) a DS1921G Thermochron iButton.  The
> DS1921Z/DS1921H are not supported with this application.
>
> THERMODL:
>
> usage: thermodl 1wire_net_name <output_filename> </Fahrenheit>
>   - Thermochron download on the 1-Wire Net port
>   - 1-wire_net_port required port name
>     example: "COM1" (Win32 DS2480B),"/dev/cua0"
>     (Linux DS2480B),"1" (Win32 TMEX)

Seem, like very old doc. I've just prepared a snip from current doc,
which, you can find in the upload directory of my server:

#v+
olecom@flower:/tmp$ grep -m7 -B7 -A12 cua <linux-2.6.22-rc4/Documentation/devices.txt
| tail -n20 >serial-devices.txt
olecom@flower:/tmp$ chmod o+r serial-devices.txt
#v-

>   - <output_filename> optional output filename
>   - </Fahrenheit> optional Fahrenheit mode (default Celsius)
>   - version 1.03
>
> Required on the command line is the 1-Wire port name:
>
> example:  "COM1"                (Win32 DS2480B)
>           "/dev/cua0"           (Linux DS2480B)

OK. The main idea, that they are using standard serial port (rs232)
interface for communication here.

>           "1"                   (Win32 TMEX)
>           "\\.\DS2490-1"        (Win32 USB DS2490)
>           "{1,5}"               (Win32 DS2480B multi build)
>           "{1,6}"               (Win32 USB DS2490 multi build)
>           "{1,2}"               (Win32 DS1410E multi build)

And unknown Windows magic here.

> /When the device is plugged in dmesg shows:
>
> usb 1-10: new full speed USB device using ohci_hcd and address 6
> PM: Adding info for usb:1-10
> PM: Adding info for No Bus:usbdev1.6_ep00
> usb 1-10: configuration #1 chosen from 1 choice
> PM: Adding info for usb:1-10:1.0
> PM: Adding info for No Bus:usbdev1.6_ep81
> PM: Adding info for No Bus:usbdev1.6_ep02
> PM: Adding info for No Bus:usbdev1.6_ep83

Is that all? His *is* the actual information. But there's no hint, that
you've cut it too late or too early. So, more output is needed.

> In /dev I have:
>
> usbdev1.1_ep81
> usbdev1.6_ep83
> usbdev1.6_ep02

One usb device with two endpoints(dmesg shows three). One with one (i
guess). Doc might say about what to use and how to use (but not that
you've quoted here). Try to look at sources. They provide sources for
Linux most of the time. Because Linux have stable API nonsense feature.
And those dude on Linux like to read sources.

> Trying something like: /sh thermodl /dev/usbdev1.1_ep81 t.txt  /results
> in an error.

Are you fan of the slash (i.e. `/')? Slash in UNIX-like OSes is
directory separator. It is *not* an option separator, like in the DOS.

`/sh' means loading for execution file `/sh', i.e. root directory, file
`sh'. But somehow shell got loaded and took the input, let's see.

> /thermodl.c: line 1:

Hgm. C file. Sources of the C language file.
This must be almost all you need!

> //------------------------------------------------------------------: No
> such file or directory
> thermodl.c: line 2: syntax error near unexpected token `('
> thermodl.c: line 2: `// Copyright (C) 2000 Dallas Semiconductor
> Corporation, All Rights 'eserved.

The shell does not like text of the sources of the C langage from that
file. :-\

> /Any hints on how to call the device?

``The data logger (DS1921G-F5)''?

_____:)



Reply to: