Table of Contents

Serial Relay

The serial relay project allows the serial ports on a Cybiko Classic to be virtually linked with another, in full-duplex mode.

The program runs in a point-to-point mode, that is only communication between two Cybiko's is allowed. However, the range of the serial relay solution can be extended by the use of the Repeater program.

It doesn't always have to be a computer on the other end consider this interesting idea. This would allow a computer to remotely monitor a GPS unit that is moving around sending back it's coordinates.

When used with RFTerm the remote VT100 terminal emulator you can get serial access to any device. This would show all the NMEA strings that are being transmitted by the GPS unit onto another cybiko

This program will only work on the Classic as it requires an RS232 port. You will also need the comport.dl driver.

Usage

From the main screen several keyboard options are available, this help is also available by pressing the ? key on the cybiko.

Key Description
Select locate other Cybiko
Enter For options screen - Options are described below
I Information
L Toggle line numbers when in debug mode
C Clear console
D Toggle debugging mode
Esc to exit.

This program has been tested with kermit transferring a 1.3Mb file and it worked perfectly. It should work for other serial protocol; xmodem, ymodem, zmodem, ppp, slip etc..

SerialRelay to RFTerm Walkthrough

In this demonstration we will be connecting two cybiko to each other using RFTerm and SerialRelay. The cybiko have been given the nicknames: purple and green

Step 1

Starting up SerialRelay on green. When you first run the program you will see a screen similiar to that below. The D key has been pressed to enable debug tracing.

Step 2

Start hyperterminal or some other serial communication program on the PC, make sure you select the correct port that you have wired up the green cybiko to. The following hyperterminal settings match those of the default serial relay startup. That being 9600-n-8-1.

To verify that you at least have connectivity and all the serial port parameters are set correctly. We can type the string hello into hyperterminal this should appear on the serial relay console, it won't be sent to any remote cybiko at this point in time as we have not selected any. So To will appear as a ? question mark.

Step 3

Now to get some connectivity happening, on a 2nd cybiko (purple) fire up the RFTerm program and press the SELECT button. This will present you with a dialog of all other cybiko that are running. Locate the name of the one running the SerialRelay program and press ENTER. Once you have done this the cybiko running serialRelay (green) will show some information about this connection.

Step 4

Proving the connection works. Now return to the hyperterminal session once more we type the string hello this time as serialrelay now has a connection with RFTerm the characters will be transported from the cybiko connected to the PC onto the cybiko running RFTerm.

SerialRelay(Green) → RFTerm(Purple) →

Now that it is all working press D to turn off debug mode. There is a slight overhead when running in debug mode that will throttle your effective baud rate.

Options

Comments

  1. I'm assuming that the scrolling output on the screen has no 'history' and that you can't ask the cybiko to scroll back thru historic 'off screen' content? - This would obviously eat memory like mad.
  2. If these units are to be deployed in 'highish availability' apps, we will need to take an approach rather like that of the apache webserver, where a thread would kill itself after performing a predefined number of operations.
  3. Idea. We have a tuneable parameter, 'maxops'. Every time we do a Tx or Rx (or screen operation), maxops is decremented. If it hits zero, the Cybiko issues an XOFF. It then automatically does a hard reset on itself. On reboot, (assuming we've cracked the 'auto-run this app' piece), the app notices that it has just come back from a self-initiated reset & issues an XON. Of course, whatever is attached to the Cybiko serial port will have to be designed and coded to work with this behaviour.
  4. Thought. How about a function call that prints the available free RAM of the cybiko to the screen, this would help when trying to find out where leaks are coming from.
  5. Also, a client initiated 'just to a reboot now, please' command. This would allow a smart client to decide when it was a suitable time to have the Cybiko reboot.
  6. A hardware based solution. We can find out how to cause the little LED on the cybiko to flash from red to yellow (wireless traffic does this anyway). Our app would flash this LED every so often, like it was servicing a watchdog timer. Have a little RC circuit that notices if the LED stops flashing. If it sees this, it just pushes the 'reset' button.
  7. Point of interest. Whilst running serialrelay, I powered up a 3rd Cybiko. There was much buzzing and beeping when the serialrelay units noticed the presence of the new cybiko. Data xmission was unaffected - which is good. Interesting that this behaviour ran 'in the background'. Is this hardwired into the OS, or can we do this too?
  8. DK to introduce hard logging (with time/datestamp) onto the PC test harness programs so as to determing when things actually stopped. Must also try to characterise what brings on hangups - messagelength, repeat rates, baud rate etc, etc
  9. The fact that these ran with continual 2-way serial data traffic for (at least) over 6 hours is actually very encouraging.
  10. Point from Brett - Perhaps explore the use of the vibrator function to act as a way to drive the reset line on the Cybiko.
  11. If this project is still alive, what about writing a 'lite' version which has no options or interface, but purely forwards the RS232 port data?

Code

Feature Request

Done - Version 1.8

Change Log

22-Oct 1.11

4-Oct 1.10

18-Jun 1.9

14-Jun 1.8

6-Jun 1.7

3-Apr 1.6

14-Mar 1.5

13-Mar 1.4

Documentation

This is a Window CHM file generated automatically by http://www.doxygen.org/ that describes the internals of the code.