libftdi Archives

Subject: Re: Writing succeeds, but reading fails

From: Magnus Therning <magnus@xxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Thu, 8 May 2014 14:15:29 +0200
On Thu, May 8, 2014 at 12:51 PM, Uwe Bonnes
<bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>>>>>> "Magnus" == Magnus Therning <magnus@xxxxxxxxxxxx> writes:
>
>     Magnus> The full application I want to port uses ftd2xx to find devices
>     Magnus> to talk to, I think doing that discovery is easiest via libftdi.
>     Magnus> However, maybe a combination works well enough, as long as I
>     Magnus> somehow can tie the items in a `ftdi_device_list` to
>     Magnus> /dev/ttyUSBx somehow.
>
> To name the kernel device, I use udev. Look at appended udev rule. I program
> deviced like:
> usb 3-10: new full-speed USB device number 7 using xhci_hcd
> usb 3-10: New USB device found, idVendor=0403, idProduct=6001
> usb 3-10: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> usb 3-10: Product: CPS_CONN
> usb 3-10: Manufacturer: IKDA
> usb 3-10: SerialNumber: 0003
>
> and the udev rule created a link like:
> crw-rw----  1 root dialout 188,   0  8. Mai 12:00 ttyUSB0
> lrwxrwxrwx  1 root root           7  8. Mai 12:00 CPS_CONN_0003_00 -> ttyUSB0

Yes, I did find some mentions of using udev to generate names for
devices.  It's neat on one level, but I have to say I'm not
enthusiastic about users having to install extra udev rules just to
use the program.  It may very well be the best way though as
everything points to it being impossible to tie a `libusb_device` to a
`/dev/ttyUSBx` in an easy way, apparently one has to go via sysfs :(

Thanks for the udev rule file, the ones I've found have not been as
clear and easy to follow.

>     Magnus> Then it's of course also irritating; serial communication via
>     Magnus> libftdi ought to work, right? ;)
>
> Well, is should. I tested your program on my own hardware with loopback
> here, and nothing is read too. Perhaps somebody else has any hints?

Hopefully, but in any case you have given me a way to proceed now, and
you've even removed the dependency on libftdi ;)

/M

-- 
Magnus Therning                      OpenPGP: 0xAB4DFBA4
email: magnus@xxxxxxxxxxxx   jabber: magnus@xxxxxxxxxxxx
twitter: magthe               http://therning.org/magnus

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread