The information in this article applies to: 4200, 4400, 4600, 5200, 5400, 5600, 5800, 6400, 6600, and 6800 modems.
What is the Serial IP function?
The purpose of this function is to enable access to remote legacy devices (with no TCP/IP stack) over the wireless network. This function is particularly used in telemetry applications such as meter reading and SCADA devices. In the case of a serial connection between an attached terminal and the modem, there are instances when data exchanged between the terminal and modem is not IP traffic but raw serial data (typically layer 2 data). The Serial IP function can be best described in the diagram below.
How does Serial IP work?
When set in Serial IP mode, upon reception of the IP packets, the modem transparently strips off the IP headers and passes the packets to the attached device as raw data perceived correctly by the device. When the device is sending data, the modem encapsulates the data in IP packets to be transmitted over-the-air to an assigned destination.
Flush parameters are essential for local serial communication. Such parameters could be directly related to the type of protocol running at the RS232 level between modem and attached device. The flush parameters determine the manner of encapsulation of data received from the attached terminal. There are three manners which the modem follows when encapsulating the serial data:
- Flush on Timeout is a value in milliseconds. It represents the timeout between serial packets sent by the terminal. The most popular setting of this parameter is 1 millisecond. This minimal setting allows the modem to encapsulate serial data on first chance of its reception.
- Flush on Byte Count is in bytes. It determines the number of bytes received before the modem encapsulates data in IP packets. When the number of bytes in a packet is unknown, it is typical to set this parameter to zero to disable it.
- Flush on Byte Sequence is a hexadecimal value. It is used when there is a particular byte sequence that designates the end of a received packet. If none exist, this parameter should be left empty.
If any one of the above three conditions is met, the modem flushes the serial data received by encapsulating it in IP packets then sends it over the air to a home server application. There are three basic scenarios where the Serial IP function is needed.
Scenario #1: Terminal responds to queries
A polling station queries a field device by sending polls over IP targeting the WAN IP address of the modem. The modem forwards the requests locally at the serial port and listens for data back from the attached device. The modem encapsulates the data based on the flush conditions in place and sends a response back to the same source port following IP socket handling.
An application acts as a TCP/IP client that connects to the Serial IP server of modem then pushes polling requests to the modem. The TCP server responds to these polls and maintains socket handling. The modem is said to be in a TCP poll state.
Considering the fact that UDP is a connectionless transport protocol, BlueTree has implemented Response to UDP Source feature allowing the modem to respond to the same IP address and port source.
The necessary steps to program a modem based on the above description:
- Enable the Serial IP server on the modem. In BlueVue Device Manager, under Modem Configuration page, click on the General tab and check Enable Serial IP Server. The default Operational Mode of the modem is Command mode. The modem operational modem flips from Command mode to Serial IP mode once the listening server has been targeted by incoming data to the modem, and the socket has been established.
- Click on Serial IP tab. Enter the flush conditions, the serial IP listening server port number, and transport protocol.
- Click on Serial Port and match the settings with those of the attached device on serial port.
Scenario #2: Terminal transmits data unilaterally
A field device sends an alarm over the serial port to the attached modem. The modem performs the data encapsulation and sends the report to the pre-programmed destination. Performing as a TCP client, the modem connects/sends requests to the TCP server at the home application side or another listening SCADA device that is being polled. The modem is said to be in a TCP push state.
The necessary steps to program a modem based on the above description:
- In BlueVue Device Manager, under Modem Configuration page, click on the General tab and set the modem Operational Mode to Serial IP. The modem performs encapsulation on all incoming serial packets from the attached terminal (modem will not respond to AT commands with such settings).
- Click on Serial IP tab and set the flush conditions accordingly as described earlier.
- Click on Serial IP tab and set a destination IP address and port number. The destination could be a remote server or another BlueTree modem (in a TCP poll state) attached to another field device.
- Click on Serial Port and match the settings with those of the attached SCADA device.
The modem can also be in a UDP Push State in case the listening home server has a UDP listening socket.
Scenario #3: Scenario 1 + Scenario 2
If a terminal attached to the modem is periodically queried by a remote application while it might need to send reports independently to a remote server:
- Modem should be set to be always in Serial IP mode.
- Serial IP server on the modem has to be enabled.
- Flush conditions have to be present.
- Report destination has also to be set*.
The corresponding settings in the software are displayed below.
*This scenario causes the modem to respond to the incoming request plus send to destination(s) set in the modem. Refer to dial-on-demand serial IP feature below for more details on how to avoid such occurrence.
Serial IP Notes:
DTR signal change: A firmware feature states that a change in the incoming DTR signal status ON/OFF at the serial port causes the modem operational mode to flip from previously set Serial IP mode to Command mode unless the modem configuration is set to ignore change in DTR signal status. The change takes effect only to the running configuration on the modem. Recycling power or resetting the operational modem on the modem brings back the original configuration. If an attached terminal toggles the DTR signal, it is recommended to set the modem to ignore fluctuation in DTR signal.
Escape sequence: BlueTree firmware defines a serial IP escape sequence. Sending ‘+++’ or three plus signs within one second causes the modem firmware to abort serial IP operational modem temporarily. The change takes effect only to the running configuration on the modem. Recycling power or resetting the operational modem on the modem brings back the original configuration.
Inactivity timeout: BlueTree firmware feature defines a serial IP inactivity timeout affecting the TCP listening socket. If set to any value but zero seconds (default), the modem hangs up the current socket connection if the timeout period has passed with no data being passed on that socket. The client has to establish a fresh connection for the next connection attempt.
LED behavior: The behavior of the indicators on the modem could be helpful in troubleshooting serial IP setup. DTR LED indicates a signal sent from an attached terminal. It should be solid on while attached device is connected. TX LED flashes when attached terminal transmits data. RX LED flashes when attached terminal receives data. ACT flashes displaying RF activity.
AT commands: The serial IP configuration AT commands are listed in the BlueTree AT command manual:
+BSIPDS: Serial-IP Remote Destination Settings +BSIPSV: Serial-IP Server Settings +BSIPSE: Enable the SIP server in AT command mode +BSIPFB: Serial-IP Flush on Byte Count +BSIPFS: Serial IP Flush on Byte Sequence +BSIPFC: Serial-IP Flush on Special Character +BSIPFT: Serial-IP Flush on Timeout +BSIPIT: Serial-IP Inactivity Timer
Serial port settings AT commands:
+IFC: Serial Port Flow Control +ICF: Serial Port Character Framing +IPR: DCE Serial Port Speed +BSERMD: Serial Port Operational Mode +BSERAO: Serial Port Always-On
Dial-on-demand Serial IP:
Consider scenario 3 described earlier. The modem serial IP server is listening for incoming requests as scenario #1 specifies. The modem is programmed with a serial IP destination to support the attached device in case it requires sending a message to remote server as scenario #2 specifies. From the enterprise software side, send a polling request to the modem. This causes the modem to propagate back the response from attached terminal back to source socket. Also, the modem - being programmed to encapsulate any data available at serial port- would send another identical packet to programmed destination. This might be an unwanted scenario. In order to avoid such a scenario, use dial-on-demand serial IP feature. Dial-on-demand serial IP allows an attached terminal to place the modem in serial IP mode and connect to remote server without any previous settings on the modem to allow such capability except for necessary flush conditions*. This is particularly helpful with devices that have smart scripting capability. A terminal can issue a dialing command with the following syntax
ATD<remote IP address>,<port number>,<1 for TCP; 0 for UDP>
The modem returns a CONNECT message to terminal, after which the terminal can start sending data. To hang up the current call, the terminal toggles DTR signal or send the ‘+++’ break sequence to bring the modem back to command mode.
*The Dial-on-demand serial IP only supports TCP destinations currently.
Device reading field setup example:
Common scenario is remote device reading and diagnostics such as scheduled meter reading data collection. Device serial port is 9600 baud with flow control disabled.
User configuration tool:
IP address: modem <WAN IP> address Port number: TCP 7700
*Local corporate network should allow application traffic. Wireless carrier should allow incoming traffic at specified port.
SCADA field setup example
A SCADA master application is running on a Windows PC. The computer connects via a standard straight-through serial cable to a 4200 modem designated as a master modem. A SCADA slave device connects via a non-standard serial cable to another 4200 modem designated as a slave modem.
The SCADA master polls the slave on a scheduled basis by sending polls over RS232 to the serial port of the master modem. The master modem encapsulates the requests in an IP packet and sends data to the slave modem. The slave modem performs de-capsulation of the data and forwards it to the serial port where the slave is connected. Below is the AT commands configuration of each modem.
Master modem configuration
The Windows application raises DTR every time it starts. Set the modem to ignore DTR change.
Slave modem configuration
The SCADA slave has pins TX, RX, DTR, and GND available. The slave configuration example disables flow control because no flow control pins are available. The slave toggles the DTR signal continuously as a pattern of communication with the attached modem. Setting ‘AT&D0’ goes about ignoring this DTR signal changing pattern.
Following the above mentioned configuration is helpful in troubleshooting a successful setup.
It is the customer's responsibility to review the advice provided herein and its applicability to the system. Red Lion makes no representation about specific knowledge of the customer's system or the specific performance of the system. Red Lion is not responsible for any damage to equipment or connected systems. The use of this document is at your own risk. Red Lion standard product warranty applies.
Red Lion Technical Support
If you have any questions or trouble contact Red Lion Technical Support by clicking here or calling 1-877-432-9908.
For more information: http://www.redlion.net/support/policies-statements/warranty-statement