Echo (X) command
(see command description format info here)
|Function:||Returns DS status information|
|Can be issued through:||Network (broadcasts OK, login not required); serial port|
|Command format:||X[v], where v is an optional "command version" parameter (decimal number up to 255, when omitted defaults to 1). Command version is only recognized in firmware V3.54+|
|Possible replies (network):||Annn.nnn.nnn.nnn.nnn.nnn/ppppp/mseic[p]/ES/oo...o/dd...d, where|
nnn.nnn.nnn.nnn.nnn.nnn - MAC-address of the DS;
ppppp - data port number of the DS;
m - fixed to 'N' (means that the application firmware, not the NetLoader is running);
s - programming mode: '*' (none), 'S' (serial ), 'U' (out-of-band UDP ), 'T' (inband TCP or command-phase TCP );
e - error status: '*' (no errors detected), 'E' (running in the error mode ); 'N' (Ethernet port failure)
i - IP-address status: '*' (not obtained yet), 'I' (obtained via DHCP ), 'M' (fixed, set manually);
c - data connection status: '' (closed), 'A' (sending ARP *OR** [V3.54+] establishing PPP link), 'O' (being established), 'C' (TCP connection established or being closed), 'U' (UDP connection established), 'R' (reset by remote host), 'F' (Link Server login failed), 'L' (Link Server login in progress);
[V3.54+] p - only returned when command version parameter of >1 is supplied : '*' (PPPoE disabled), 'D' (PPPoE login denied), 'N' (PPPoE link not opened), 'B' (PPPoE link is being established), 'P' (PPPoE link established);
E - Ethernet-to-serial buffer overflow: '*' (no overflow), 'E' (overflow detected);
S - serial-to-Ethernet buffer overflow: '*' (no overflow), 'S' (overflow detected);
oo...o - owner name ;
dd...d - device name .
|Possible replies (serial):||Amseic[p]/ES (see field description above)|
|First introduced:||Earlier than "baseline" V3.14/V3.51, functionality extended in V3.54|
|See also:||Network programming, Serial programming, PPPoE|
The primary use of the network Echo command is to auto-discover Device Servers on the network: when the network host sends this command in the broadcast mode, it collects the replies from all locally attached Device Servers (hence, the name of the command). Reply from each DS contains all necessary information (MAC-address, etc.) that is needed to continue communicating with each specific DS in a non-broadcast mode.
Information returned by the Echo command contains the following data:
|•||MAC-address is the most important field that can be used to uniquely identify each DS*! Besides, the MAC-address is used (and, therefore, must be known in advance) as a reference to the particular DS in such commands as Assign IP-address (A) and Select in Broadcast Mode (W).|
|•||Data port number field is read directly from the Port Number (PN) setting of the DS.|
|•||Follow are several one-character flag fields that tell the network host about the present status of the DS:|
|•||m flag always returns 'N'. This is meant to indicate that the DS is running (this) application firmware. In contrast, when the NetLoader is running this flag shows 'L' (NetLoader also supports Echo command);|
|•||s flag shows whether or not any form of programming is in progress. 'S' is returned when the serial port of the DS is in the serial programming mode. If the network programming session is in progress the 'U' is returned for out-of-band (UDP) programming session and 'T' is returned for inband (TCP) or command-phase (TCP)programming sessions;|
|•||e flag indicates whether or not the DS is running in the error mode. Additionally, for serial Echo command this flag can be set to 'N' indicating hardware failure of the Ethernet port;|
|•||i flag reflects current IP-address status. It is useful when the DHCP is enabled (see the DHCP (DH) setting). The flag is set to '*' while the DS is trying to obtain the IP-address from the DHCP server. When this is done the flag is set to 'I'. When the DHCP is off this flag returns 'M' (for "manual");|
|•||c flag reflects the connection state;|
|•||[V3.54+] p flag reflects PPPoE link state. This flag is only returned when optional command version parameter is supplied and is >1;|
|•||E and S flags display routing buffer overflows. Both flags are reset automatically when the data connection is closed or aborted. The flags can also be reset manually through the Reset Overflow Flags (R) command.|
|•||oo...o and dd...d fields return the data from the Owner Name (ON) and Device Name (DN)settings. Using meaningful names simplifies identification of a particular DS.|
Optional command version parameter has been introduced in firmware V3.54 . Command version is a decimal number (up to 255). When command version is omitted it is assumed to be 1. Earlier firmware releases do not support this parameter and will simply ignore it (result will be the same as having command version set to 1). When command version of 2 or higher is supplied Echo command returns an additional p flag in the reply. This flag reflects the state of PPPoE link.
Example #1: supposing X command returns the following reply**:
This means that the MAC-address of this DS is 0.150.30.213.55.74, data connections are accepted on port 1001, the DS is operating normally, has serial programming in progress. The IP-address of this DS was successfully obtained via the DHCP, TCP connection is currently established, serial-to-Ethernet buffer overrun has been detected (within current data connection). The owner name and device name of this DS is "BigCorp" and "Device1" respectively.
Example #2: here is a command with version parameter**:
DS-->: A0.150.30.213.55.74/1001/N**MU P /**/BigCorp/Device1
In this example the DS is operating normally, is not being programmed, has a fixes IP-address (DHCP is off), has UDP "connection" in progress and PPPoE link established .
It is noteworthy that reply to Echo command should not be parsed basing on the optional command version parameter. Remember that older firmware ignores this parameter so there is no guarantee that extended information ( p flag ) will be returned by the DS. Of course, it is always possible to process the reply basing on the firmware version of the DS but recommended solution is to simply check the presence of additional ASCII character before the forward slash that separates flags mseic[ p] from flags E and S .
Some comment should also be made about flag c . Status 'A' of this flag now means that either ARP packets are being sent in order to discover the destination network host OR PPPoE link establishment is currently in progress. The usage of a single status to designate these two different processes is possible because they are never needed at the same time. When PPPoE is enabled (PPPoE Mode (PP) setting is either 1 or 2) and the destination host is on a different network segment the DS doesn't need an ARP but needs to establish a PPPoE link (for more information see PPPoE ). In all other cases the DS doesn't need PPPoE but has to send ARP.
When issued through the serial port, the Echo command returns the same information minus the MAC-address, data port number, owner name, and device name fields. This is because these fields are only needed to discover and identify the DS on the network and are not required on the serial side. The primary application of the serial Echo command is for the attached serial device to inquire current data connection and routing status of the DS. This may be used by the serial device, in conjunction with the modem commands (serial-side parameters and instructions) to control and monitor data connection establishment and termination by the DS.
There is also a Status (U) command that returns additional information about the status of the DS.
* This is because each DS, like any other Ethernet device, has a unique MAC-address preset during the production.
** Encapsulation characters such as IEC, STX, CR, and the command ID field are not shown