Index by title

Build Environment

I am using the MinGW compiler to build this project under windows. I was not able to find a MinGW quick-start guide on their web site and their download page appears instead to provide a lesson in history. Therefore, I have written up the exact steps that I used to get a working build environment here:

  1. Install MinGW (Use the Automated MinGW installer from http://sourceforge.net/project/showfiles.php?group_id=2435)
    1. Add mingw make to the list of components to install
  2. Add C:\MinGW\bin to the system PATH
  3. copy C:\MinGW\bin\mingw32-make.exe to C:\MinGW\bin\make.exe
  4. Install putty
    1. Add putty to the system PATH

I also use the Wine environment under linux to perform build tests - these binaries can behave significantly differently to a pure windows binary, so I need to do final builds on a Windows system. I have also been meaning to install MinGW on linux and start building like that, but since I need a real windows system to test the serial port access routines, I will probably continue building on the windows system for some time.


Commandline option

Starting wconsd with the '-h' option will show a help screen:

C:\>wconsd -h

wconsd: Serial Console server (version 0.2.5)
        (see http://wob.zot.org/2/wiki/wconsd for more info)

Usage: wconsd [-i pathname | -r | -d | -p port ]
Just start with no options to start server
   -i pathname     install service 'wconsd'; pathname
                   must be the full path to the binary
   -r              remove service 'wconsd'
   -d              run wconsd in foreground mode
   -p port         listen on the given port in foreground mode

Features

Faults

The following are some known non-features, some of which may be addressed in future versions.


Foreground mode

If wconsd cannot successfully contact the Service Control Manager, or if the '-d' Commandline option is supplied, then it will startup as a console application in Foreground mode. This means that it will not go into the background and all messages will be sent to the CMD.exe window that started it.


Menu Commands

Note that it is currently planned to completely replace the menu system for the next version of wconsd, so these commands will be changing.

close

binary

This command toggles the state of the binary mode. Binary mode is required for correct use of file transfer protocols, such as xmodem. This mode will be automatically turned on by some telnet clients (if they send the telnet option DO BINARY TRANSMISSION) in which case it may need to be manually turned off using this command.

close

close

If the serial port is current open, this command will close it and stop any serial communications.

copyright

Print the copyright notice

data

data 5|6|7|8

Sets the number of data bits. This command will not have any affect until the port is closed and re-opened.

help

Show some quick help for the menu commands

keepalive

keepalive

Toggles the state of Telnet keepalives. If keepalives are turned on, then a Telnet Keepalive option is sent approximately once every two seconds. This will create significantly more network traffic than normal, but will help to avoid sessions being terminated unexpectedly

kill_conn

kill_conn Connection ID

Stop a given connection's serial communications. This will close the serial port being used by the given connection ID and thus allow someone else to open that port. This command can be used when an existing session has crashed, or if someone else has logged in and is blocking your work. Since there is no authentication, this command is obviously open to abuse.

open

open [port number]

Connect or resume communications with a serial port. If no port number is specified then the current default port number is used. If an serial port is already open, this will just resume communication with that port.

parity

parity no|even|odd|mark|space

Set the serial parity. This command will not have any affect until the port is closed and re-opened.

port

port port number

Set serial port number. This command will not have any affect until the port is closed and re-opened.

quit

quit

Exit from this session

show_conn_table

show_conn_table

Show the connections table. This table is mostly used for internal debugging information, however it contains the connection ID for all the current connections, which can be used with the kill_conn command

w000c2989d2df> show_conn_table
Flags: A - Active Slot, N - Network active, S - Serial active,
       M - Run Menu, B - Binary transmission, E - Echo enabled,
       K - Telnet Keepalives, * - This connection

s flags   id mThr net  netTh serial serialTh netrx nettx peer address
- ------- -- ---- ---- ----- ------ -------- ----- ----- ------------
0    ME    1 1884                               55  1598 192.168.1.1:43686
1 ANSMBEK  2 1888 1880     0   1844     1836    68  4264 192.168.1.1:57184
2*AN ME    3 1856 1868     0                   109  4657 127.0.0.1:4629
3          0    0                                0     0
4          0    0                                0     0
5          0    0                                0     0
6          0    0                                0     0
7          0    0                                0     0

speed

speed bits per second

Set serial port speed. This command will not have any affect until the port is closed and re-opened.

status

status

Show current serial port status

w000c2989d2df> status
status:

  port=1  speed=9600  data=8  parity=0  stop=0
  state=open

  connectionid=1  hostname=w000c2989d2df
  echo=1  binary=0  keepalive=0

stop

stop 1|1.5|2

Set number of stop bits. This command will not have any affect until the port is closed and re-opened.


Screenshots

Server Startup messages

When starting wconsd from a cmd window, you should see something like the following

C:\>wconsd.exe

wconsd: Serial Console server (version 0.2.4)
        (see http://wob.zot.org/2/wiki/wconsd for more info)

wconsd: Foreground mode
wconsd: Hostname is w000c2989d2df
wconsd: IP Address is 192.168.1.2
wconsd: listening on port 23

When you first connect to the server, a menu is shown


wconsd serial port server (version 0.2.6)

NOTE: the commands will be changing in the next version

available commands:

binary          - toggle the binary comms mode
close           - Stop serial communications
copyright       - Print the copyright notice
data            - Set number of data bits
help            - This guff
kill_conn       - Stop a given connection's serial communications
keepalive       - toggle the generation of keepalive packets
open            - Connect or resume communications with a serial port
parity          - Set the serial parity
port            - Set serial port number
quit            - exit from this session
show_conn_table - Show the connections table
speed           - Set serial port speed
status          - Show current serial port status
stop            - Set number of stop bits

w000c2989d2df>

Connecting to a serial device

w000c2989d2df> open
Opening default port

Router>
Router>
Router>

Wconsd

wconsd is a small application that will turn any windows PC into a simple serial port server. You can just telnet to the workstation and use the serial ports remotely. You can download wconsd by going to the Files tab above and downloading the most recent version.

To start using wconsd, just run the executable. For long term usage, there is also a Windows Service mode that will automatically start wconsd when the windows system starts up.

Quick Start Instructions

  1. launch wconsd
    Simply double-click on the executable. This will launch the wconsd server in a terminal window. wconsd can optionally be started with command-line options to modify its operation.
  2. Determine the server IP address and Port
    When starting up, wconsd will print out the hostname, IP address and port number that it is listening on
  3. Connect to the server from a remote computer
    just use telnet to connect to the correct hostname. As soon as you connect, a quick help menu will be shown.
  4. Connect through to the serial port
    Use the command "open" to connect to the serial port
    By default, the serial port will be COM1: but that can be changed using the "port" command.
  5. Finish up
    To stop using the serial port, just quit your telnet session.