How To Configure a WPAN Gateway to work with a Wireless Serial Gateway

Configuration

The commands listed in this section refer to the configuration of the WPAN Gateway and Wireless Serial Gateway when used as a serial line replacement solution. The WPAN Gateway is the server connected to the DCE device and the Wireless Serial Gateway (WSG) is the client and is connected to the remote serial device (ie, RTU).

PAD refers to Packet Assembly and Disassembly and is the protocol by which serial data is packetized to be sent over the wireless link. The receiving side disassembles these packets and outputs raw serial data.

There are two modes of operation of the Wireless Serial Gateway (WSG) and WPAN Gateway: transparent mode and multi-point/multi device. In transparent PAD mode (WSG client and WPAN Gateway (PAD=2 mode)), serial data is buffered until a condition is met for sending it over the wireless link. The condition can be one of the following:

  1. Maximum data length reached (PADFWDL)
  2. Maximum packetization timeout expired (PADFWDT) 
The Wireless Serial Gateway (WSG) or client is always using transparent mode.

In Multi-point/multi device mode, WPAN Gateway data is formatted into sentences in the form:
$PWPAN,ID,HeaderPayload*hh<CR><LF>
Where:
ID = 64-bit hex address of the device that sent the message
HeaderPayload = 3-byte header and variable length payload formatted as hex digits.

Messages to the WSG or client are in the form of:
$PPQ,WPAN,ID,HeaderPayload*hh<CR><LF>
Where:
ID = 64-bit hex address of the endpoint device
HeaderPayload = 3-byte header and variable length payload formatted as hex digits.

Peer to peer mode graph


Multi-point / multi-device mode graph


AT^PAD=n n=0 => PAD disabled (default)
n=1 => PAD client enabled (transparent client mode)
n=2 => PAD server enabled (transparent server mode)
AT^PAD? Queries the command setting

Note: If a transparent connection is required, the Wireless Serial Gateway (client) is configured as PAD=1 and the WPAN Gateway (server) as PAD=2.
If point to multi point communication is required, the Wireless Serial Gateway (WSG)(client) is configured as PAD=1 and the Gateway (server) must be configured as PAD=0.

AT^PADFWDL=n n is forwarding data length in characters (1-64). Default=20.
AT^PADFWDL? Queries the command setting


AT^PADFWDT=n n is the forwarding data time in 50ms increments.
n=0 => disabled
n=20 => 1s (default)
n=255 => maximum value
AT^PADFWDT? Queries the command setting


AT^PADECHO=n Controls pad echo.
n=0 => echo disabled
n=1 => echo enabled (default)
AT^PADFWDT? Queries the command setting

Escape Sequence

+++ is used as an escape sequence with 1 second guard time before and after the sequence.

Connection Establishment

Connection is automatically established after a reset in PAD=1 and PAD=2 modes.
ATO command is required to reconnect after the escape sequence.
Once a client connection is established, a CONNECT message is displayed. Note that this can be disabled with ATQ1. When in transparent mode, the server side also displays a “connect” message with the ID of the client device.

Detecting Lost Connections

Once a client (WSG) connection is established, the client (WSG) detects if the connection is broken and tries to re-establishes the connection. If there is data being sent, the client (WSG) keeps retrying for up to 5 seconds until it gets a positive acknowledgment. If communication still fails after 5 seconds, the connection is detected as broken and the registration sequence begins again and keeps retrying until a successful connection is established. A no carrier message is displayed on the client side (PAD=1) and server side in transparent mode (PAD=2).

Transparent Mode vs. Multi Point/Multi Device

The Wireless Serial Gateway (WSG) or client is always using transparent mode. Data from the serial port is encapsulated into packets with a proprietary 3-byte header and sent out to the WPAN Gateway (server) using point to point communication.

The server can be in transparent mode as well (PAD=2). In this mode, the 2 devices, one Wireless Serial Gateway and one WPAN Gateway act as a wireless serial link. No other device types are supported in this mode and only 1 client is allowed.

In PAD=0 mode, the server WPAN Gateway outputs data using the PWPAN/PPQ, message structure. In this mode, the server WPAN Gateway can simultaneously talk to multiple devices (Man-Down Pendant, etc) and also multiple PAD client devices.

PAD Client Device Type (Multi Point)

In order to be able to distinguish between different kinds of devices device type needs to be programmable on the PAD client side.
The configuration is done using the following command:

AT^PADDEVTYPE=n n=10-20 (default = 10)
AT^PADDEVTYPE? Queries the command setting

Examples:

In the below examples, the client refers to the Wireless Serial Gateway connected to the remote serial device and the server refers to the WPAN Gateway connected to the DCE device.

Transparent Mode Configurations:
Client settings (Wireless Serial Gateway / WSG):
AT^PADECHO=0
AT^PAD=1
AT&W

Server settings (WPAN Gateway):
AT^PADECHO=0
AT^PAD=2
AT^ZBEEADDDEV=0013A200........
AT&W

Multi-point Mode Configurations:

Client settings (Wireless Serial Gateway / WSG):
AT^PADECHO=0
AT^PAD=1

Server settings (WPAN Gateway):
AT^PADECHO=0
AT^PAD=0
AT^ZBEEADDDEV=0013A200........
AT^ZBEEADDDEV=0013A200........
AT^ZBEEADDDEV=0013A200........

Client Side Power Management

In order to reduce power consumption of the WSG client side and extend operating life, a power saving mode has been implemented. It works by reducing the frequency of registration attempts and keeping the device in low power mode between attempts.

The client side is required to register to the server. In order to save battery power, this registration period is configurable. This is done using the following command:

AT^PADREGT=p,i
Where:
p is the registration period in seconds.
p=0 => try registering with no delay
p=10 => 10seconds (default)
p=255 => maximum value
i is the registration period increment
i=1 => minimum value
i=10 => 10s (default)
i=255 => maximum value

After power up or lost connection, the client will try registering immediately. If it fails, it will wait for a period that increments by i every failed attempt until it reaches the value of p, where it will continue to attempt to register until a valid connection is made.

Example: p=60, i=10

Attempt Delay (seconds)
1 0
2 10
3 20
4 30
5 40
6 50
7 60
8 60
9 60
.. ..
…. …..