06-24-2015, 09:42 PM
(06-24-2015, 07:11 PM)curlymo Wrote: Why don't you just make sure your fix the ttyUSB assignments?
Simply because this arbitrary assignment can change over time. If you attach more than one adapter to you board you will get into trouble with different device names over time.
If you want to be sure that this and only this very special adapter gets your preferred and configured device name than it's better to use a udev rule and fix it.
In my case after installation the 2 attached adapters changed their kernel name (ttyUSBX), and only pilight was configured to a fixed ttyUSB1. The other program was able to find the right device name because it is using a symbolic link created by udev. One might get after reboot the same address than before, but you can not be sure, and if you connect our device later all chances are lost.
So for me its the only logical solution to give device names depending on some unique features like the ftdi serial number, and its extremely simple. Just insert a line like
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="XXXXXX", SYMLINK+="nano0"
to you udev rules and aou are done.
On the other hand there is no need to check for a valid device name with you implemented table because milliseconds later you would get an serious error if you errorneous configured device does not exist (fopen would fail), time enough to check the config...
For me this is only an annoying check with less to no significance.
regards