Ser2net: Difference between revisions
m (New page: When multiple USB-to-serial adapters are present on a Linux system, it is not obvious which port corresponds to which /dev/ttyUSBnnn device. The mapping of ttyUSBnnn devices depends on the...) |
mNo edit summary |
||
Line 29: | Line 29: | ||
</pre> | </pre> | ||
and start ser2net from /etc/rc.local: | and start ser2net from /etc/rc.local: | ||
<pre> | |||
/root/ser2net -c /root/ser2net.conf -p 3000 & | /root/ser2net -c /root/ser2net.conf -p 3000 & | ||
</pre> |
Revision as of 10:59, 14 August 2012
When multiple USB-to-serial adapters are present on a Linux system, it is not obvious which port corresponds to which /dev/ttyUSBnnn device. The mapping of ttyUSBnnn devices depends on the order that devices have been connected and disconnected, may change across system reboots, or when USB devices are re-enumerated after USB hardware errors.
This modification of the ser2net package from http://sourceforge.net/projects/ser2net attempts to solve this problem by specifying serial devices using USB paths instead of /dev/ttyUSBnnn names.
To build the package, get the package sources from svn and run "make" to produce the ser2net executable:
svn checkout https://ladd00.triumf.ca/svn/daqsvn/trunk/ser2net or firefox http://ladd00.triumf.ca/viewcvs/daqsvn/trunk/ser2net/
An example ser2net.conf file for 2 USB serial ports looks like this:
3001:raw:600:usb-2-2:9600 -XONXOFF -RTSCTS LOCAL 3002:raw:600:usb-2-4:38400 -XONXOFF -RTSCTS LOCAL
When the program starts it prints the names of all available USB-serial devices,
you can copy these names to ser2net.conf.
add ser2net entries to hosts.allow:
ser2net-control: 127.0.0.1 142.90.101.81 142.90.115.99 142.90.101.136 ser2net: 127.0.0.1 142.90.101.81 142.90.115.99 142.90.101.136
and start ser2net from /etc/rc.local:
/root/ser2net -c /root/ser2net.conf -p 3000 &