PXS Auto Configuration

The PXS Auto Configuration application, pxsautocfg, is a standard eCos program which can be stored in Flash aboard the PXS. It can exectute almost any configuration command available either through the onboard webserver or at the RedBoot prompt, including burning new program images into Flash. It can either be executed from the RedBoot prompt using the run command, or the PXS can be configured to run pxsautocfg automatically at startup by using the RedBoot auto command:

RedBoot> auto enable
Auto configuration: enabled
RedBoot>

When auto is enabled and pxsautocfg is stored in Flash, the PXS will start pxsautocfg instead of the default application at the next reboot. If the PXS has never been configured before, when the PXS boots pxsautocfg, pxsautocfg will wait for user input via the onboard web server:

PXS Auto Configuration Web Site
PXS Auto Configuration Web Site

If the PXS was previously configured using pxsautocfg or if the update command has been issued manually, pxsautocfg will attempt to automatically update the configuration of the PXS. If it succeeds, it will reboot the PXS back to the default application and continue normal operations. This allows for unattended software and configuration updates. If the configuration does not succeed, the PXS will not reboot and the reason for failure can be determined from the log displayed by the web server (see below).

For an initial configuration, pxsautocfg waits for a user to confirm or correct its network configuration and the parameters to use for doing the auto configuration:

PXS Auto Configuration Start Page
PXS Auto Configuration Start Page

Once the PXS is configured with the correct network parameters, the user can start the auto configuration process. Once started, pxsautocfg will retrieve a configuration script using an HTTP GET request from a remote web server. The script is then parased and executed. Any additional files required are also requested HTTP GET requests from the same server. pxsautocfg will log every step of the execution of the script in real time. The log can be viewed from the onboard web server:

PXS Auto Configuration Status Page
PXS Auto Configuration Status Page

A sample of a complete auto configuration log is shown below:

Starting auto configuration task...

Auto configuration task started.

Starting initial auto configuration for 'zurich' - PXS 1309671422.
Downloading '/cgi-bin/pxsautocfg.cgi' from 192.168.168.247, port 80.
Download completed successfully - 808 bytes.
/cgi-bin/pxsautocfg.cgi parsed to 38 commands.
agent enabled.
async enabled.
community set to 'laygopxscom'.
contact set to 'Alphonse'.
control enabled.
default set to 'ecostest'.
dhcp disabled.
dns set to 192.168.168.2.
domain set to 'arc.advancedrelay.com'.
environment cleared.
facility set to '7'.
ftp set to 192.168.168.247.
heartbeat disabled.
host set to 'pxs231'.
http set to 192.168.168.247.
idle set to '150'.
location set to 'Zurich Data Center'.
log set to 192.168.168.149.
logging enabled.
monitor disabled.
ntp set to 192.168.168.149.
options cleared.
password cleared.
primary disabled.
script set to '/cgi-bin/pxsautocfg.cgi'.
smtp set to 192.168.168.149.
snmp set to 192.168.168.149.
standby set to 192.168.168.149.
tag set to 'zurich'.
telnet enabled.
tftp set to 192.168.168.247.
timeout set to '15'.
trap enabled.
utc set to '-8'.
virtual set to 0.0.0.0.
web enabled.
license set to 'FA85B092-10136EED'.
features set to '0x00000000'.
Starting update of pxscfg in flash block 0x053E0000.
Flash block 0x053E0000 erased.
3072 bytes written to flash block 0x053E0000.

Auto configuration completed successfully.

Auto configuration task ended.

Once the configuration is completed successfully, the user can simply click the start the application link on the status page to reboot the PXS and start the default application. During an initial configuration, the user must manually start the application. The PXS will not automatically reboot as it will for an update configuration.

Configuring pxsautocfg

Since the pxsautocfg application must coexist with the default application, it uses no command line parameters. Any parameters required are either input via the web interface or must be stored elswewhere in the PXS configuration. During initial configuration, the script should explicitly set the values of:

If a port other than port 80 is used, its value should be written to the environment. For instance, if the HTTP requests should be addressed to port 8080, the configuration script should include:

environment   AUTOCFGPORT=8080

The Configuration Server

The configuration server can be any program which can handle HTTP requests, including the Apache HTTP Server and Internet Information Services (IIS) from Microsoft. Customers can use whatever means they chose to store and server configuration data. On request, Advanced Relay can provide sample code for a CGI script which can dynamically generate configuration scripts.

Configuration Scripts

A configuration script is a plain ASCII text file which essentially consists of a subset of the RedBoot command set. (The exception is the burn command which has no direct counterpart in RedBoot.) Lines beginning with # are ignored as are blank lines. Other lines are considered configuration commands. With a few exceptions, the commands take a single argument which is the value of some configuration parameters. Commands must start at the beginning of the line. The format of each command is:

  <command name><whitespace><argument(s)><end-of-line>

The following commands are supported:

Command ArgumentsComments
agent 1enable/disable
async 1enable/disable
burn 2Burn a program image to Flash
Arguments are:
  • URL of image
  • Application name
community 1
contact Nfree form, accepts "clear"
control 1enable/disable
default 1
dhcp 1enable/disable
dns 1
domain 1accepts "clear"
environment NNAME=value, accepts "clear"
facility 1
features 1
ftp 1
heartbeat 1enable/disable
host 1
http 1
idle 1
laygocfg 1URL of laygocfg image
license 1accepts "clear"
location Nfree form, accepts "clear"
log 1
logging 1enable/disable
monitor 1enable/disable
ntp 1
options Nfree form, accepts "clear"
password 1accepts "clear"
primary 1enable/disable
reliable 1enable/disable
script 1URL, accepts "clear"
smtp 1
snmp 1
standby 1
tag 1accepts "clear"
telnet 1enable/disable
tftp 1
timeout 1
trap 1enable/disable
utc 1
virtual 1
web 1enable/disable

The following is a complete configuration script:

agent       enable
async       disable
burn        /pxs/hdlcsrv.bin hdlcsrv
community   laygopxs
contact     clear
control     enable
default     hdlcsrv
dhcp        disable
dns         0.0.0.0
domain      clear
environment DLMHOST=10.0.0.1
facility    7
features    0
ftp         10.0.0.1
heartbeat   disable
host        pxs
http        10.0.0.1
idle        150
laygocfg    /pxs/laygocfg.img
license     clear
location    clear
log         10.0.0.1
logging     enable
monitor     disable
ntp         0.0.0.0
options     clear
password    clear
primary     disable
reliable    disable
script      /cgi-bin/pxsautocfg.cgi
smtp        0.0.0.0
snmp        0.0.0.0
standby     0.0.0.0
tag         clear
telnet      enable
tftp        10.0.0.1
timeout     15
trap        enable
utc         -8
virtual     0.0.0.0
web         enable