Coder Social home page Coder Social logo

conserver's Introduction

Serial Console Server

This is a replacement for the very old "cu" program (original part of UUCP!). It can be used at the shell prompt to connect to a serial port or can be used to turn a Linux box into a console server, so that you can "telnet linux-box 2002" to connect to ttyS2.

There is on-line help. You will see when you run the program.

Setup for console server use

Put this into /etc/xinetd.d/direct_ttyS2

# default: on
# description: The telnet server serves telnet sessions; it uses \
#       unencrypted username/password pairs for authentication.
service direct_ttyS2
{
        flags           = REUSE
        type            = UNLISTED
        socket_type     = stream        
        wait            = no
        user            = root
        port            = 2002
        protocol        = tcp
        server          = /usr/sbin/in.telnetd
        server_args     = -L /root/c2
        log_on_failure  += USERID
        disable         = no
}

If you have a multi-port serial card, you can use setserial to add these extra ports:

/etc/rc.local:

# assign Siig/oxford serial ports

/bin/setserial /dev/ttyS2 port 0x4020 irq 96 uart 16950
/bin/setserial /dev/ttyS3 port 0x4028 irq 96 uart 16950
/bin/setserial /dev/ttyS4 port 0x40A0 irq 104 uart 16950
/bin/setserial /dev/ttyS5 port 0x40A8 irq 104 uart 16950

Build instructions:

su root
cd
cc -o c c.c
ln -s c c0
ln -s c c1
ln -s c c2

Link to c for each serial port you have. For example c2 for ttyS2. Create an rc file for each of these. For example, this is for c2:

/root/.c2rc

port = "/dev/ttyS4"
baud = "9600"
flow = "rtscts"
off = "/root/power off 1"
on = "/root/power on 1"

The parameters available in the rc file as the same as the command line options, see below.

For direct use on command line:

Just type:

./c /dev/ttyS2 --baud=19200

or:

./c /dev/ttyUSB0 --baud=9600

Included is a shell script to control a CPS Power string (uses 300 baud serial port):

power

Command line options

--baud=9600	Set baud rate

--flow=none	Set flow control: none, rtscts, or xonxoff

--stop=1	Set number of stop bits: 1 or 2

--bits=8	Set number of data bits: 6, 5, 7 or 8

--parity=none	Set parity: none, even or odd

--hup=off	Lower DTR on exit: on or off

--cd=off	Exit if carrier detect goes low: on or off

--on='power on 1'	Shell command to turn on power

--off='power off 1'	Shell command to turn off power

--help		Show this help

--send='foo'	Send a string ot the serial port and exit

--noansi	Suppress ANSI sequences

--hexdump	Display received data in hexadecimal

Commands

Once connected, these ~ commands are available:

~b		Send break

~q		Exit

~h		Show help

~f		Turn machine off

~n		Turn machine on

~!command	Execute shell command

~<file		Send a file

~<!command	Send command output

~>file		Log to a file

~>		Close log file

~m		Modify options (such as baud rate)

~o		Show current options

~w		Save current options as defaults

~s		Print status information

~x		Toggle hex-dump mode

~a		Toggle no-ANSI mode

conserver's People

Contributors

jhallen avatar jallennk avatar

Stargazers

Jeffrey H. Johnson avatar

Watchers

James Cloos avatar Jeffrey H. Johnson avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.