in reply to Device::SerialPort and new RS-232 cards

modprobe is simply a Linux command to load a kernel module; a maybe-necessary prerequisite for working with hardware but probably not. (The udev facility will probably do that for you.)

The real “issue” here is device-name stability. And, looking at the big-picture here, I don't think that you should have any assumption (much less dependency) concerning the mapping of device-names to the various pieces of equipment that you will need to be talking to.

Essentially, you should assume that this mapping will change for one reason or another:   controller cards can move, cables can be moved, different Linux/Unix versions, and so-on. None of which have any meaning to anyone in terms of the actual application... who have the very odd tendency to give various devices names like “Sneezy” and “Grumpy.”

Therefore... just let 'em do that. Set up a configuration file of some kind that allows them to map an arbitrary moniker to an arbitrary device-name:

grumpy=/dev/ttys4
And then refer to all devices, anywhere and everywhere, by those monikers.

grumpy thus becomes an abstract, symbolic name that actually means something to somebody. When (not if...) someone moves cables around, only this file needs to be changed.

If the devices in question have some way to identify themselves, e.g. a device serial-number query or some other kind of unique-identifier, then so much the better:   you can give your program both a list of devices to consider and (separately) a list of identifiers to seek.

  • Comment on Re: Device::SerialPort and new RS-232 cards