Stayton Board

Serial Ports

The Stayton has 2 serial ports onboard. The first, /dev/ttyS0, is the obvious one with the DB9 header. The other is build into the Berkley Motes connector, more information about this will be available later.
  1. If you plan to use the first serial port for IO then you have 2 problems. One is the the serial port is used as the console to print messages to (when an SSH connection terminates, or drivers are installed). The other is that by default a login terminal is started on the serial port.
  2. To solve the first problem, follow the steps below to stop the console messages from printing:
    mv /dev/console /dev/console.bak
    ln -s /dev/null /dev/console
  3. In order to make the login console go away, run init 4. This will change the runlevel to 4. It only affects the current session so you will need to redo this each time you boot the board. If you look at the /etc/inittab file you will see that the getty that runs on the serial port only runs in runlevels 2 and 3. The board boots up in 2. You could change it so that it wouldn't ever run the console but I think that is a bad idea because then you are really stuck if networking or SSH breaks. Maybe write a script that will run a minute after bootup to init 4. What I did is include init 4 and then a sleep (to give it time to end the login) in a shell script along with the program that I wanted to run that used the serial port.
  4. The other way to get around these 2 problems is to use a USB-to-Serial adapter instead of the built in serial port. To do that, follow the directions on the USB page.
  5. If you are using a cerebellum microcontroller board with the stayton, see the Cerebellum Documentation.