Writing to a USB Device

NoOp glgxg at sbcglobal.net
Sun Jun 15 01:34:45 UTC 2008


On 06/14/2008 04:41 PM, John wrote:
> 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
> 

You might want to have a look at John's home page for w1retap:
http://www.zen35309.zen.co.uk/wx/tech.html

Also if you search the archives for this list, you will find a few
interesting posts from last year by Brian Fahrlander & his 1 Wire
project (Hardware hackers rejoice! etc).

  He was getting parts etc., from http://hobby-boards.com/ and
particularly the USB to 1wire serial adaptor:
<http://www.hobby-boards.com/catalog/product_info.php?products_id=1503&osCsid=efe35fe517d8ec2e84fef5fd8722d909>

You might also find these helpful:
hhttps://help.ubuntu.com/community/1wireSoftware
http://www.i2cchip.com/
http://en.wikipedia.org/wiki/1-Wire
http://www.1wire.org/

And then there is always X10:
<http://www.yolinux.com/TUTORIALS/LinuxTutorialX10SmartHomeNetworking.html>
http://packages.ubuntu.com/gutsy/x10-automate
http://packages.ubuntu.com/search?searchon=names&keywords=x10








More information about the ubuntu-users mailing list