Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6978093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:42:40+00:00 2026-05-27T17:42:40+00:00

I have three different serial devices connected to three usb-serial converters (FTDI USB-RS232). If

  • 0

I have three different serial devices connected to three usb-serial converters (FTDI USB-RS232). If I connect them, I get the generic device names /dev/ttyUSBx as expected. When I try to write some udev rules, udevadm shows me the same output for the three devices except in some device serial id attributes.

Those serial id’s will change on every device so if I use a different usb-serial converter, my rules won’t work anymore. So, I need a way to communicate with the specific device connected to the serial converters and identify it by its response.

“Writing udev rules” HOWTO, says the following about using PROGRAM functionality to call an external program to name devices:

PROGRAM is used for running programs which produce device names (and they shouldn’t do anything other than that). When those programs are being executed, the device node has not yet been created, so acting upon the device in any way is not possible,

Rule example:
SUBSYSTEM=="usb", PROGRAM="/bin/device_namer %k", SYMLINK+="%c"

so I can’t write to /dev/ttyUSBx from there to identify the device. Then, I have the RUN functionality, but it seems that it can’t create a new SYMLINK as udev won’t get RUN’s output.

Rule example:
SUBSYSTEM=="usb", RUN="/bin/program"

Can I instruct udev from that RUN script to create the symlink? Or can I create that symlink by hand from there?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:42:40+00:00Added an answer on May 27, 2026 at 5:42 pm

    Blindly chatting on a serial port automatically the moment it is connected to the computer is quite a scary thing to do. Are you sure you want to do this? First of all it will take some time, which will delay the appearance of the device node if udev has to wait for a result before creating it. If the device happens to be powered off or its serial port is disconnected then you won’t be able to name it properly (and you will need to have a timeout to detect this). Finally, if another device besides one of the ones you expect is connected, you may be sending it garbage that has unintended consequences.

    You might consider relying on the adaptors’ serial numbers to tell them apart, and associate each adaptor to an external device in a consistent fashion. If your adaptors even have real serial numbers instead of placeholder strings like 00000000 then you are already lucky!

    Nevertheless, this is how you would do it.

    As you suspected, you can’t use RUN, because that’s too late, the device node has already been created. You have to use PROGRAM. In your program you are going to have to create the device node yourself using mknod because udev hasn’t done it yet. You should create a temporary node in a temporary location and destroy it before your program exits.

    ### Create the temporary device node in /tmp
    device="/tmp/udev_device_guesser.$$"
    # Note: mknod does not appear to be vulnerable to a symlink attack
    mknod "$device" c "$MAJOR" "$MINOR"
    
    ### Use this device node to query what's attached to the serial port
    insert your code here
    
    ### Get rid of the temporary node
    rm -f "$device"
    exit 0
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have three different List collections. How can I show them in one ListBox
Scipy and Numpy have between them three different functions for finding eigenvectors for a
I have three different configurations on my project, all three do not require all
I have three different development machines. Do I need three different iPhone Developer Program
If I have three different tables like this table_1 Field 1: victories Field 2:
My problem is that I have three different stock sizes for each product that
I'm playing with a GWT/GAE project which will have three different pages, although it
I have developed three different versions(as different projects) of an app(large,normal,small). How can I
I have built three different cells in my storyboard and hooked all the outlets
I have three UILabel with different font and I want to put then on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.