Marc's Public Blog - Linux Hacking


All | Aquariums | Arduino | Btrfs | Cars | Cats | Clubbing | Computers | Diving | Dreamstate | Edc | Electronics | Exercising | Festivals | Flying | Halloween | Hbot | Hiking | Linux | Linuxha | Monuments | Museums | Oshkosh | Outings | Public | Rc | Sciencemuseums | Solar | Tfsf | Trips



>>> Back to post index <<<

2010/06/17 Dealing with many USB to Serial Port Converters on linux and device naming
π 2010-06-17 01:01 in Linux, Linuxha
So, if you have more than one USB to serial adapter, you might have issues with which order they load in, causing the serial port numbers (/dev/ttyUSB0 .. x) to change pseudo randomly at boot, it's pretty annoying.

In my case, I picked up an 8 port ftdi usb to serial converter for only $15 on Ebay (woot!) but even its ports may not come up in sequence at boot time if other modules are loaded at the same time (a race condition can cause the pl2303 port to be in between one of the 8 ports from the ftdi hub).

Turns out there is a solution to this problem with udev, iff your usb to serial adapters have serial numbers (my ftdi ones did, but my pl2303 ones did not), or if you only have one serial adapter of each brand (like ftdi, pl2303, keyspan).

In my case, I have (don't laugh), 11 serial devices on my server:

  • Server serial console
  • 1-wire serial adapter
  • Insteon PLM
  • APC ups
  • W800 X10RF and X10sec gateway
  • X10 MR26a X10RF gateway
  • First ECM 1240 power meter
  • Second ECM 1240 power meter
  • Brand One Meter serial adapter
  • HAI thermostats (2 on one line)
  • Rfxcom 433.92Mhz (433.92Mhz RF gateway for Oregon Scientific Weather Sensors)
  • This is what you do with udev:

    gargamel:~# cat /etc/udev/rules.d/50-local-usb-serial.rules 
    # /etc/udev/rules.d/50-local-usb-serial.rules
    

    # http://www.reactivated.net/writing_udev_rules.html#udevinfo # was udevinfo -a -p /class/tty/ttyUSB0 # now udevadm info --attribute-walk -p /class/tty/ttyUSB0

    SUBSYSTEMS=="usb", ATTRS{product}=="FT232R USB UART", ATTRS{serial}=="A7006gvN", SYMLINK+="usb-serial-ftdi-8_1" SUBSYSTEMS=="usb", ATTRS{product}=="FT232R USB UART", ATTRS{serial}=="A7006gvO", SYMLINK+="usb-serial-ftdi-8_2" SUBSYSTEMS=="usb", ATTRS{product}=="FT232R USB UART", ATTRS{serial}=="A7006gvP", SYMLINK+="usb-serial-ftdi-8_3" SUBSYSTEMS=="usb", ATTRS{product}=="FT232R USB UART", ATTRS{serial}=="A7006gvR", SYMLINK+="usb-serial-ftdi-8_4" SUBSYSTEMS=="usb", ATTRS{product}=="FT232R USB UART", ATTRS{serial}=="A7006gvQ", SYMLINK+="usb-serial-ftdi-8_5" SUBSYSTEMS=="usb", ATTRS{product}=="FT232R USB UART", ATTRS{serial}=="A7006gvS", SYMLINK+="usb-serial-ftdi-8_6" SUBSYSTEMS=="usb", ATTRS{product}=="FT232R USB UART", ATTRS{serial}=="A7006gvT", SYMLINK+="usb-serial-ftdi-8_7" SUBSYSTEMS=="usb", ATTRS{product}=="FT232R USB UART", ATTRS{serial}=="A7006gvU", SYMLINK+="usb-serial-ftdi-8_8"

    SUBSYSTEMS=="usb", ATTRS{product}=="FT232R USB UART", ATTRS{serial}=="A800dMFk", SYMLINK+="rfxcom"

    SUBSYSTEMS=="usb", ATTRS{product}=="USB-Serial Controller", ATTRS{manufacturer}=="Prolific Technology Inc.", SYMLINK+="usb-serial-pl2303"

    After making a change udevadm trigger will update symlinks.


    More pages: July 2002 February 2004 March 2004 November 2004 April 2005 August 2005 January 2006 July 2006 August 2007 November 2007 January 2008 October 2008 November 2008 December 2008 January 2009 May 2009 July 2009 August 2009 September 2009 November 2009 December 2009 January 2010 March 2010 April 2010 June 2010 August 2010 October 2010 January 2011 July 2011 August 2011 December 2011 January 2012 March 2012 May 2012 August 2012 December 2012 January 2013 March 2013 May 2013 September 2013 November 2013 January 2014 March 2014 April 2014 May 2014 October 2014 January 2015 March 2015 May 2015 January 2016 February 2016 June 2016 July 2016 August 2016 October 2016 January 2017 September 2017 January 2018 March 2018 December 2018 January 2019 January 2020 May 2020 January 2021 September 2021 March 2023 April 2023 December 2023 June 2024 November 2024

    >>> Back to post index <<<

    Contact Email