Tutorial: GPRS Modem PADS (Packet Assember/Disassembler) Configuration And Usage


Introduction

In data connectitvity, it is advantages and many of times to be able to send data to TCPIP network wirelessless using GPRS Network for example fleet managment, datalogger, meter reading, hydrography etc.  The following tutorial goes over the various AT command to do data connectivity using GPRS via a Enfora GSM Modem that is optimised for GPRS connectivity applications.

The intent of this document is to give the user a basic understanding of the Enfora GSM Modem architecture that addresses the Configuration and use of the internal Packet Assembler/Disassembler or PAD

For simple Transparent GPRS Connectivity, see tutorial: GPRS Netework Transpaency Configuration

Basic PAD Parameters

The following commands are used to define the PAD interface and functionality. Please refer to the  Enfora enabler IIG AT Command Set document for detailed command syntax and function. Additional information related configuration and use in different network transparency environments is available in GSM0000AN012 - Network Transparency Configuration for PAD.

Destination IP Address and Port. (AT$PADDST)

This parameter provides the destination IP address and port number to be used in communication with a host. The destination IP address is the IP for PAD data. PAD data is sent to and received from this IP. A destination IP address of 0 will allow PAD access from any IP destination, and will cause all locally generated PAD data to be sent to the IP address associated with the last remotely received PAD data. The destination port is the port for PAD data. PAD data is sent to and received from this port. A destination port of 0 will allow PAD access from any port, and will cause all locally generated PAD data to be sent to the port associated with the last remotely received PAD data.

A value of 0 will allow any IP/port access to the TCP PAD. If populated and in passive, server mode (AT$ACTIVE=0) the TCP PAD will limit access to the IP/port defined.

Source Port. (AT$PADSRC)

The source port defines the port number provided in the data packet header from the PAD. The source IP address will be the IP address obtained from the network. PAD source port is used as the source port in all outgoing PAD data messages. The remote host must use this port number as the destination port for PAD data sent to the device.

PAD Block Size. (AT$PADBLK)

This parameter defines the size of the PAD data buffer used to trigger the transmission of data based on the amount of data buffered. PAD data will be created at the requested PAD block size (number of bytes) unless an enabled forward character or PAD timeout forces the data to be sent out at a smaller block size. Block size does NOT include the IP or TCP/UDP header size.

PAD Command Features. (AT$PADCMD)

This command allows for the configuration of various PAD features. The command controls items like forwarding character, backspace, and escape sequence processing.

Please note that the port number configured using the AT$UDPAPI command cannot be the same as the one used in the AT$PADRSC command. An ERROR will be returned by the modem if the same port is used.

PAD Timeout Value. (AT$PADTO)

This command defines the PAD timeout value. Data will be forwarded to the PAD destination even if the PAD block size has not been reached if <pad timeout> period has elapsed since the last PAD character was received from the local host.

PAD Forwarding Character. (AT$PADFWD)

This command defines the PAD forwarding character. If PAD forward is enabled via AT$PADCMD, receipt of this character will immediately forward all currently buffered PAD data.

PAD Backspace Character. (AT$PADBS)

This command allows the definition of the PAD backspace character. If PAD edit is enabled via AT$PADCMD, this character will cause the previous character to be deleted from the PAD output buffer. If the previous character has already been forwarded due to a PAD timeout or receipt of an enabled forward character, receipt of the PAD edit character will have no affect.

PAD Parameters (Available in TCP PAD Operation ONLY)

TCP PAD State Operation . (AT$ACTIVE)

This command determines the active or passive state of the TCP PAD connection. If passive is chosen, the PAD will be in server mode and listen for inbound TCP connection requests. If active is chosen, the PAD will be in client mode and will initiate a connection based on the ATDT command. A value of 0 indicates passive, server mode of operation. A value of 1 indicates active, client mode of operation. ATDT will be used to initiate the passive, server mode functionality. If ATDTxxx.xxx.xxx.xxx/xxxx is used, it will override the passive mode and replace the AT$PADDST parameters as it does in UDP PAD mode.

TCP PAD Connection Timeout Value. (AT$CONNTO)

This command is used to indicate the amount of time, in seconds, to spend attempting to establish a TCP connection. A value of 0 will indicate infinite connection wait time. This command pertains to client mode operation only. Valid range is 0, 10-3600.

TCP PAD Disconnect. (AT$DISC)

The existing AT$DISC command is used for API requests to terminate a TCP PAD session. The command checks for AT$HOSTIF=2 to function as a disconnect request via the API call. This is ONLY functional over the air, as the serial port is occupied processing the PAD interface.

TCP PAD Idle Timeout Value. (AT$IDLETO)

Idle timeout is the length of time, in seconds, a TCP session connection will remain active without the remote connection sending any data. If no communication is received from the remote connection in the specified time, the modem should gracefully attempt to close the connection. Default timeout should be two minutes. Valid range is 10 to 86400.

Additional Commands for PAD Operation

The following commands are necessary for the proper definition of the physical serial port of the Enabler®-G and automated PAD initiation. The serial interface commands allow for proper matching of serial port speed, character framing, and flow control.

Serial Port Speed. (AT+IPR)

This command allows the user to define the port speed from 75 to 115,200.

Character Framing. (AT+ICF)

This command determines the number of data/stop/parity bits that will be used by the serial interface.

Flow Control. (AT+IFC)

This command determines the flow control interface. The parameters include hardware, software, or no flow control.

Host to Modem Interface. (AT$HOSTIF)

This command configures the desired Host to Modem interface. This parameter determines the behavior of the ATD command. The command allows for automated PAD initiation. When $HOSTIF is 1, and the ATD*99# command is used, UDP PAD operation will be invoked. When $HOSTIF is 2, and the ATD*99# command is used, TCP PAD operation will be invoked.

Automated Context Activation. (AT$AREG)

This command controls the ability of the modem to automatically context activate. If the value of this command is a 2, the modem will context activate and enter the mode designated in the AT$HOSTIF parameter upon powerup. If the AT$AREG is a 1, the modem will only context activate when the ATD*99# is issued.

If you are operating in a non-transparent GPRS network, please refer to application note  Network Transparency Configuration for PAD for further information. The PAD feature will not function properly if the configuration is not followed.

Basic UDP PAD Operation

The UDP PAD can be configured to forward data based on several parameters. The UDP PAD can forward data based on a forwarding character as defined by the AT$PADFWD. Additionally, the forwarding character can be included or excluded in the data packet using the AT$PADCMD command. The UDP PAD can forward data based on a timeout value using AT$PADTO. The data will be forwarded regardless of the AT$PADFWD and AT$PADBLK definitions if the timer value expires prior to the other definitions. The UDP PAD can forward data based on data buffer size using the AT$PADBLK command.

To invoke the UDP PAD, issue the ATD*99# command while AT$HOSTIF=1.

Additionally, the UDP PAD can be invoked by using ATDPxxx.xxx.xxx.xxx/xxxx or ATDP"DNS_Name",xxxx*; where xxx.xxx.xxx.xxx is the desired destination IP or "DNS_Name"* is the desired destination URL and xxxx is the desired destination port number. If this command is used, it will overwrite entries made in the AT$PADDST command.

* DNS_Name supported on software versions 0.7.6 and higher

Local disconnect requests are accomplished via escape sequence (+++), dropping DTR, or connection timeout. Once disconnected the modem will return to AT command mode.

• Escape sequence consists of a one second (or longer) guard time, +++, one second (or longer) guard time. There must be less than a second between each '+' character. Escape sequence detection is controlled with the AT$PADCMD command.

Proper analysis of terminal device requirements and application timing and control are required to fine-tune the UDP PAD for proper operation. Some experimentation may be required adjusting command settings to gain the best configuration settings for a particular solution. Each terminal device will have unique requirements and time should be spent in testing various configurations.

Basic TCP PAD Operation

The TCP PAD can be configured to forward data based on several parameters. The TCP PAD can forward data based on a forwarding character as defined by the AT$PADFWD. Additionally, the forwarding character can be included or excluded in the data packet using the AT$PADCMD command. The TCP PAD can forward data based on a timeout value using AT$PADTO. The data will be forwarded regardless of the AT$PADFWD and AT$PADBLK definitions if the timer value expires prior to the other definitions. The TCP PAD can forward data based on data buffer size using the AT$PADBLK command.

To invoke the TCP PAD, issue the ATD*99# command while AT$HOSTIF=2.

Additionally, the TCP PAD can be invoked by using ATDTxxx.xxx.xxx.xxx/xxxx or ATDT"DNS_Name",xxxx*; where xxx.xxx.xxx.xxx is the desired destination IP or "DNS_Name"* is the desired destination URL and xxxx is the desired destination port number. If this command is used, it will overwrite entries made in the AT$PADDST command.

Local disconnect requests are accomplished via escape sequence (+++), dropping DTR, or connection timeout. Once disconnected the modem will return to AT command mode.

  • Escape sequence consists of a one second (or longer) guard time, +++, one second (or longer) guard time. There must be less than a second between each '+' character. There is no way to disable the escape sequence detection in the TCP PAD.

  • A remote TCP disconnect request or AT$IDLETO will return the modem to LISTEN mode when the TCP PAD is configured as AT$ACTIVE=0.

    In server or client mode, CONNECT will echo only after the TCP connection is established and the modem is ready to receive PAD data.

    When configured in passive, server mode, LISTEN will echo only when context activation is complete.

    Only a single TCP connection is supported at a time. Cannot have connections to multiple TCP hosts simultaneously. Can disconnect one TCP connection and then start a new TCP connection.

    Use the UDP API Wakeup/Keep-alive mechanism to have modem report its IP address to remote hosts. This is necessary for a passive modem to inform the remote host of its dynamic IP address.

    Proper analysis of terminal device requirements and application timing and control are required to fine-tune the TCP PAD for proper operation. Some experimentation may be required adjusting command settings to gain the best configuration settings for a particular solution. Each terminal device will have unique requirements and time should be spent in testing various configurations.

    Link: GPRS Network Transarent Connectivity for Enfora GSM/GPRS Modem

    Link: Documentation and AT Command Set for Enfora GSM Modem

    Link: Testech M2M Solutions -> we provide complete M2M and SMS/GPRS Development services and Remote Terminal Units, Water/Weather sensors.

     


     

      Back to Enfora Main Page    |    Back to Testech Home Page    |    Wireless Modules