You might find something useful in here: https://github.com/Microsoft/Windows-driver-samples/tree/master/usb/usbview.

Bring your waders though, there's quite a bit of code to sort through.

Ryan

On 3/9/2018 1:26 AM, Robert Poor wrote:
@Ryan:

We are using garden variety FT232R chips (VID 0403, PID 6001).  (Well, almost garden variety -- we've reprogramed their EEPROM so you can wiggle CBUS 03 in bitbang mode which turns on and off the 5V power to the connected instrument. That's why I need libftdi in the first place...)

Your udev solution sounds elegant.  There's just one problem: Window's isn't Linux.  :)

I'll keep digging.



On Thu, Mar 8, 2018 at 7:45 PM, Ryan Tennill <[email protected] <mailto:[email protected]>> wrote:

    That's a shame! I was excited to have such an easy solution for a
    decidedly annoying problem... I can't help much on the Windows
    side of things unfortunately. Are the devices off-the-shelf
    products or are they something custom built for your application?

    In the past I have used this udev rule to create symlinks that
    helped me map out the devices. If you use the PROGRAM={} you can
    run a script that produces the name of the device instead of using
    the symlink.

    http://www.reactivated.net/writing_udev_rules.html#external-naming
    <http://www.reactivated.net/writing_udev_rules.html#external-naming>

    # udev rule for AWARE MCCM G2 serial interfaces
    #identify FTDI devices with VID/PID pair and create a convent
    symlink in /dev
    SUBSYSTEM=="usb", ATTRS{idVendor}=="0403", GROUP="plugdev",
    SYMLINK+="%s{product}_%s{serial}"


    On 3/8/2018 8:56 PM, Robert Poor wrote:
    @Ryan:

    I was trying to ditch the pyserial lib specifically because of
    problems on Windows, notably:

    https://github.com/pyserial/pyserial/issues/283
    <https://github.com/pyserial/pyserial/issues/283>

    But since I have a workaround, I'll stick with that until someone
    tells me how to do it with libftdi...

    - Robert


    On Thu, Mar 8, 2018 at 5:59 PM, Ryan Tennill
    <[email protected] <mailto:[email protected]>> wrote:



        On 3/8/2018 7:48 PM, Robert Poor wrote:

            [Disclaimer: I'm using the pylibftdi library as my sole
            access to the libftdi library, so pardon any translation
            errors...]

            I'm running in an environment where there may be multiple
            FTDI devices plugged in.  And I'm running other code (a
            Modbus library) that needs to know the port names (i.e.
            /dev/cu.usbxxx on unix/osx or COMxx on Windows) for each
            FTDI device.

            I'm using ftdi_usb_find_all() (via pylibftdi's
            Device.list_devices()) to get the list of serial numbers
            -- that works.  But I need to know the port names for
            each device.

            Is there a call in libftdi that will produce the port
            name for a given serial number?

            TIA.

            - rdp

        Pyserial can do this.
        http://pyserial.readthedocs.io/en/latest/tools.html
        <http://pyserial.readthedocs.io/en/latest/tools.html>

        Not sure how well it works on osx/windows but I know it works
        on Linux.

        Ryan

        --
        libftdi - see http://www.intra2net.com/en/developer/libftdi
        <http://www.intra2net.com/en/developer/libftdi> for details.
        To unsubscribe send a mail to
        [email protected]
        <mailto:libftdi%[email protected]>



    ------------------------------------------------------------------------

    *libftdi* - see http://www.intra2net.com/en/developer/libftdi
    <http://www.intra2net.com/en/developer/libftdi> for details.
    To unsubscribe send a mail to
    [email protected]
    <mailto:[email protected]>




    ------------------------------------------------------------------------

    *libftdi* - see http://www.intra2net.com/en/developer/libftdi
    <http://www.intra2net.com/en/developer/libftdi> for details.
    To unsubscribe send a mail to
    [email protected]
    <mailto:[email protected]>




------------------------------------------------------------------------

*libftdi* - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to [email protected] <mailto:[email protected]>





--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to [email protected]   

Reply via email to