Installing Brainboxes USB to Serial products in Linux
Brainboxes USB-connected serial port products can be installed as standard Linux serial port
devices using the ftdi_sio module which is already available in any modern variety of
Linux. All that is required is to teach the module the plug-and-play codes which identify the
products, and we provide a shell script to automate that process. To set up your system to
automatically recognise and install all Brainboxes USB-connected serial port devices, you
need to have the ‘brainboxes-usb’ script run at start-up. The standard way to arrange for
scripts to be run at start-up is to use the System V style init system, and you can add the
script to the init system using the following steps. You will need superuser privileges to do
this, so either log in as root or prefix all the commands below with ‘sudo ’ (you will be asked
for the root password).
1. Download the ‘brainboxes-usb’ script onto your Linux system and save or copy it into
the
/etc/init.d
directory.
cd /etc/init.d
wget -qO- -O tmp.zip
http://www.brainboxes.com/files/pages/support/faqs/sample_code/brainb
oxes-usb.zip && unzip tmp.zip && rm tmp.zip
2. Use chmod to make the script executable
chmod +x /etc/init.d/brainboxes-usb
3. Make the file run at system start up:
o
Debian-type (including Raspbian for Raspberry Pi) systems, use this
command to add this script to the init system:
update-rc.d brainboxes-usb defaults
o
Redhat and SuSE Linux (including Centos) use a program called chkconfig
instead:
/sbin/chkconfig --add brainboxes-usb
o
On systems where neither of these programs are available, you can use
runlevel editors such as sysv-rc-conf or bum instead, or create the link
directly:
cd /etc
ln -s ../init.d/brainboxes-usb rcS.d/S20brainboxes-usb
Adjusting the sequence number '20' if necessary so that it is greater than the
sequence number of the udev start script. If your system has no
/etc/rcS.d
directory, you'll have to create links in
/etc/rc2.d
,
/etc/rc3.d
,
/etc/rc4.d
and
/etc/rc5.d
instead.
4. The script will now be run automatically at start-up. To run it the first time, either
reboot or run the script manually:
/etc/init.d/brainboxes-usb start
The USB-
connected serial ports will be installed as devices named
/dev/ttyUSBn
, where n is
a number.