Writing to a USB Device
John
John at DMJ-Consultancy.co.uk
Sat Jun 14 23:41:29 UTC 2008
Jonathan Hudson wrote:
> On Sat, 14 Jun 2008 15:23:02 -0600
> Karl Larsen <k5di at zianet.com> wrote:
>
>
>> John wrote:
>>
>>> Hi,
>>>
>>> I'm gathering the courage to write a program which controls an external
>>> device via a USB port. The development and target operating systems are
>>> Ubuntu 8.
>>>
>>> Are there any good books or web sites which would give me an idea of
>>> what is involved?
>>>
>>> TIA
>>>
>>> J
>>>
>>> (Although couched as a general question, the external device is a Lenz
>>> LVZ100 Model Railway controller!)
>>>
>>>
>>>
>>>
>> Well it should be a short book. To see what device your USB device
>> is plugged into use $dmesg | tail and you see this:
>>
>>
>
> Sadly, once again Karl chooses to pollute the NG with a load of
> stuff that is not helpful to the OP .....
>
> John, you have (at least) two choices, depending on the
> programming language and your skills:
>
> (a) Write a kernel device driver to interface to the controller, a
> Google search for "linux device drivers" will find you excellent
> references on the subject;
>
> (b) Write a user-space application using libusb. A google search for
> 'libusb' will find you the documentation.
>
> I would recommend the latter, which is what I used to to write w1retap,
> <http://sourceforge.net/projects/w1retap/>, an application with gathers
> data from one-wire weather stations via (inter alia), a USB device.
>
> Unless you device is well documented, be prepared for a lot of hard
> work reverse engineering the protocol.
>
> -jh
>
>
Thanks to Jonathon and Nils for their helpful contributions; the
difference between a programmer and an end user is glaringly obvious
sometimes!
Google - here I come (again!)
J
More information about the ubuntu-users
mailing list