Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install consoleserver

How to install ConsoleServer

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install consoleserver
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
Windows (64-bit)
Mac OS X (10.5+)
Linux (32-bit)
Linux (64-bit)
0.9 Available View build log
 
License
GPL
Imports
Lastest release
version 0.9 on Jan 9th, 2014

This is a console server. It can connect to 1 or more serial ports and make these available over SSH. The data to and from the serial port can be logged to local disk. There is also a cli interface that can be used to reconfigure the serial ports.

The reason for writing this is the off the self solutions, Cyclades etc., are not cheap, a similar solution can be acheived using a raspberry pi and readily available usb to serial adaptors. e.g. this 16 port one for under £200 http://www.easysync-ltd.com/product/636/usb2-h-1016-m.html

Authentication

Version 0.2 and later uses unix password file and users authorised keys for logon.

Priviledges

The consoleserver has to run as root currently to access password file for user authentication to work at ssh login.

The CLI interface is only allowed by users who are members of the groups root or sudo.

Issues

USB hot plug

On ubuntu modem-manager is run against all serial ports to probe for it being a modem, this interferes with the monitored console collection. You may want to add a blacklist udev rule to prevent this. 99-usb-blacklist.rules is a sample rule file and goes into /etc/udev/rules.d

Group membership

By default serial devices belong to the dialout group so the user running the console server needs to be a member of this group or to run as root.

CLI Interface

There is a CLI interface accessible over SSH that can be used to reconfigure the server and serial ports, as of version 0.3 this can only be accessed by users belonging to the root or sudo groups - i.e. they have admin rights on the server. This by default is on port 8022 so ssh -p <username>@<address>.

The configuration of active serial ports is not acted on immediatly issue reload <port name> this is so you can change multiple parameters.

Configuration changes are not committed to disk until they are committed using the commit command. This allows for temporary changes to try and get a port working.

Port names are the full device name, i.e. /dev/ttyUSB0

Commands
help
Simple help.
list
List configured ports, these may not all exists on the system.
status
Show active ports.
exit
exit and close CLI connection.
create <portname>
Create a new port configuration in the config file. The default config already lists 32 ports.
reload <portname>
Close and reopen the named port
show <portname>
Show current configuration of the port
stop <portname>
Close the port
start <portname>
Open the port
enable <portname> <0,1>
Mark port for auto open as soon as it is seen. Note it may be a USB device that is not yet plugged in but will be opened once plugged in.
baud <portname> <baud>
Change port baud rate.
bytesize <portname> <5,6,7,8>
Change port number of data bits.
stopbits <portname> <1,2>",
Change port number of stop bits.
parity <portname> <N,E,O,M,S>",
Change port parity, None, Even, Odd, Mark, Space.
rtscts <portname> <0,1>",
Change port to use RTSCTS for flow control - hardware flow control.
xonxoff <portname> <0,1>",
Change port to use XON XOFF for flow control - software flow control.
sshport <portname> <nnnn>",
Change ssh port that directly connects to the serial port.
logfile <portname> <logfile>",
Change The name of the log file for this port. logfile can be blank in which case the port is not logged. If the logfile is not an absolute path then it is relative to /var/log/consoleserver, the extension .log i forced.
portmonitor <location>
Change the directory to monitor for new serial ports, the port (device) names must alredy exist in the config for the consoleserver to open them as soon as they are plugged in.

Installation

The package is set up to install on Ubuntu at present dropping relevnt files where required on the file system. You should be able to install and then enter sudo /etc/init.d/consoleserver start to get it running as a daemon. sudo consoleserver will run it in a terminal window logging to the screen.

File locations

Config File

The system will create a default config file in /etc/consoleserver called config.ini this will be created to access serial ports ttyUSB0..ttyUSB31. The default management port is 8022 and the default serial ports are on 8023..8054.

LogFiles

The default entries are setup to create logfiles in /var/log/consoleserver. If installed with pip install consoleserver then a logrotate file will be installed to rotate these files daily.

Others
/etc/init.d/consoleserver /etc/logrotate.d/consoleserver /etc/udev/rules.d/99-usb-blacklist.rules

You will have to make /etc/init.d/consoleserver executable if you wish to run this as a daemon.

Unit Tests

Most of the code is unit tested.

Licence

The code is licenced using the GPL, see included LICENCE file. At present any other licence is subject to negotiation.

(C) Copyright L P Klyne 2013

Subscribe to package updates

Last updated Jan 9th, 2014

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.