Gryphon Simple Gateway

1  Introduction

The Gryphon's simple gateway program is configured by creating one or more files in the /gryphon/gate/ directory. The Gryphon's LCD and front panel push buttons can be used to select which of the multiple configuration files to use. The same interface can be used to cause the gateway program to run or not run when the Gryphon is powered up.

2  Configuration File Layout

The order of the entries is not important. Entries consist of a label (which is case sensitive), zero or more spaces, an equal sign, zero or more spaces and a value. Order is observed by numbers appended to the labels. Blank lines and lines beginning with # are ignored. There are several configuration files shipped with the Gryphon Simple Gateway which may be used as examples if you need to create your own.

2.1  Logical channels

A logical channel has an input and an output channel and one or more rules that determine which messages are to be copied from its input to its output. input and output labels are used to define logical channels. A number (starting with 1) is appended to both labels to specify which logical channel is being specified. The following configures a single logical channel that reads from the first CAN channel and writes to the second CAN channel.

input1 = can1 
output1 = can2

If you want to pass messages passed in both directions, two logical channels need to be defined as shown below:

input1 = can1 
input2 = can2 
output1 = can2 
output2 = can1

As can be seen, relative channel numbers for each type of card are used. Channel can1 may be channel 1 or 2 or some other channel number depending upon the cards that are present in the Gryphon. Valid card types are as follows:

can 
j1850 
kwp2000 
ford_ubp 
chrysler_sci 
chrysler_c2d

2.2  Message selection

Message selection is based on the message header. The simple gateway allows the message header to be changed from the input channel to the output channel for one or more header values if desired. Header values are specified as idn where n is a sequential number starting with 1. The id values are associated with a logical input by appending them to a logical channel with an underscore character. The following defines that a message arriving on input 1 with an ID code (header) of 18FE DA03 be sent out on output 1 with an ID code (header) of 0250. (The data field of the message is not changed between the input and output.)

input1_id1 = 18FE DA03 
output1_id1 = 0250

To specify that all of the messages from the input are to be passed to the output without any changes, an id value of all is used. The following specifies that all of the messages coming in on input 1 should be sent out on output 1.

input1_id1 = all 
output1_id1 = all

By using one or more of the first type and one of the second, the specified messages will be changed as configured while the remaining messages are passed intact. Incoming messages are searched sequentially starting with id1 until a match is found. all matches everything so that if input1_id3 = all is present in the configuration file, input1_id4 and above are ignored.

2.3  Channel speed

The default bit rate for CAN channels on the Gryphon is 500,000 bps using 40 and 3a for btr0 and btr1 respectively. The bit rate for the first two CAN channels may be changed to 125,000, for example, by using the following lines, assuming that input1 has been set to can1 and that output1 has been set to can2

input1_btr0 = 03 
input1_btr1 = 1C 
output1_btr0 = 03 
output1_btr1 = 1C

2.4  Automatic initialization

Under normal circumstances a Bus Off event for a CAN bus indicates a serious problem that needs to be solved before proceeding. An occasional Bus Off event may be expected if the CAN bus is disrupted in the course of testing. This may be caused by electrical/RF interference, by mechanically disrupting the bus, by removing or powering down the only other device on the bus or by some other factor. Once a Bus Off event is reported on a transmitting channel, no more messages can be transmitted on that channel until it is initialized. The two entries described below allow a set of rules to be defined that control when an Initialize command will be sent to a CAN channel in response to a Bus Off event.
outputn_delaym = seconds
This entry specifies the time to wait after receiving a Bus Off event before sending the Initialize command. Since a Bus Off event can only occur while transmitting, the output of a logical channel should be specified. There may be up to eight delay times starting with 1. The number of seconds to wait can be specified with a resolution of 0.25.

The following two entries specify that the first and second delays for the first logical output channel are 3.25 and 14.5 seconds respectively.
output1_delay1 = 3.25 
output1_delay2 = 14.5
Each time a Bus Off event occurs, the next delay time is used. The last defined delay time is used repeatedly for all subsequent time delays. Using the above example entries, delays of 3.25, 14.5, 14.5 and 14.5 seconds are used for the first through fourth Bus Off events.

Valid times are from 0.25 through 63.75 seconds. The value 0.0 is interpreted as infinite. It makes no sense to define a delay time following one of 0.0 because an Initialize command will never be sent after a Bus Off event for which a delay time of 0.0 is specified.

outputn_reset = number
This entry specifies the number of successful transmissions after which the delays are reset. As noted above, each successive Bus Off event causes a wait of the the next defined delay time before an Initialization command is sent to the channel. If the number of successfully transmitted messages on the CAN bus between two Bus Off events equals or exceeds that specified by this entry, the first delay rather than the next or last is used. Valid numbers range between 1 and 4,294,967,295.

3  Configuration File Location

All of the gateway configuration files reside on the Gryphon in the /gryphon/gate/ directory. New configuration files may be created directly on the Gryphon by telnetting into the Gryphon and using pico. Another method is to create the files on a PC and transfer them to the Gryphon via ftp. Any file name may be used except default.

The filesystem on the Gryphon is normally write protected. In order to add or modify a configuration file, the write protection must be turned off. The wpflashoff command turns off the write protection; wpflashon turns the write protection back on.

To turn the write protection off, telnet into the Gryphon and log in as user root with a password of dggryphon. At the prompt, enter wpflashoff. After the new or existing file has been edited or added, enter wpflashon to restore the write protection.

An alternate method is to use the Gryphon's front panel menu. Select Filesystem utilities followed by Turn Flash WP OFF entries. Use Filesystem utilities followed by Turn Flash WP ON to restore the write protection.

4  Starting the Gateway With a Configuration File

Press and hold the left arrow button on the front of the Gryphon until the System utilities menu entry appears. Press the down arrow repeatedly until the Gateway Program menu entry appears. Press the right arrow key to enter the gateway configuration selection program. A list of gateway configuration files is then displayed. The down and up arrow keys may be used to scroll down and up the list if more than one configuration file is present. When the selection arrow is in front of the desired filename, press the right arrow key to start the gateway program using that configuration file. A new screen will be displayed showing that gateway program is starting with the selected configuration file. When the gateway program is ready do begin working, the display will return to the System utilities menu entry. Pressing the left arrow key at any time during the above procedure, returns the display to the System utilities menu entry.

Once the gateway has been started with the selected configuration file, the Gryphon may be configured to start the gateway program automatically on startup, using the same configuration file selected with the method described above. To do so, scroll down with the down arrow key until the System Programs menu entry appears. Press the right arrow key to enter the System Programs configuration program. Scroll down to the Gateway Program entry. If it is running, the word Running will be shown in front. If it is not running, the word Stopped will be shown in front. In either case, press the right arrow key once to toggle the state. If the word Running is now shown, the gateway program is running now and will be started the next time the Gryphon is turned on. If the word Stopped is shown, press the right arrow key once more. Press the left arrow key to exit the System Programs configuration program and return to the main menu.

The first paragraph describes a way to start or restart the gateway program using a different configuration file. Doing so does not modify the Gryphon's startup procedure vis-a-vis the gateway program. The second paragraph describes a way to change whether or not the gateway program is to be started at power up or not. The last selected (used) configuration file is identified by virtue of a symbolic link to it from default. Therefore, if the gateway program has been set to start on power up, and the the method outlined in the first paragraph is used to restart the gateway program with a different configuration file, the symbolic link is changed. The newly selected configuration file will be used on all subsequent power ups as well.
This document was translated from LATEX by HEVEA.