RUT955 RS232: Difference between revisions

From Teltonika Networks Wiki
No edit summary
 
(42 intermediate revisions by 9 users not shown)
Line 1: Line 1:
==Summary==
{{Template: Networking_rutos_manual_rs232
 
<!------------------------DEVICE----------------------->
RS232 and RS485 functions are designed to utilize available serial interfaces of the router. Serial interfaces provide a possibility for legacy devices to gain access to IP networks. This chapter is an overview of the RS232/RS485 functions in RUT routers.
| name      = RUT955
 
| series    = RUT9
==RS232==
<!----------------------SEPARATORS--------------------->
 
| baud_rate  = 115200                                  <!-- Default baud rate -->
[[File:Services rs232 v 2.png]]
| baud_rates = 300 {{!}} 600 {{!}} 1200 {{!}} 2400 {{!}} 4800 {{!}} 9600 {{!}} 19200 {{!}} 38400 {{!}} 57600 {{!}} 115200  <!-- All baud rate values-->
 
| data_bit  = 8                                      <!-- Default data bits -->
<table class="nd-mantable">
| data_bits  = 5 {{!}} 6 {{!}} 7 {{!}} 8              <!-- All data bits values -->
    <tr>
| modem     = 1
        <th>field name</th>
}}
      <th>value</th>
      <th>description</th>
    </tr>
    <tr>
      <td>Enabled</td>
      <td>yes {{!}} no; Default: '''no'''</td>
      <td>When checked, enables the RS232 service</td>
    </tr>
    <tr>
      <td>Baud rate</td>
      <td>300 {{!}} 1200 {{!}} 2400 {{!}} 4800 {{!}} 9600 {{!}} 19200 {{!}} 38400 {{!}} 57600 {{!}} 115200; Default: '''115200'''</td>
      <td>Sets the data rate for serial data transmission (in bits per second)</td>
    </tr>
    <tr>
    <td>Data bits</td>
        <td>5 {{!}} 6 {{!}} 7 {{!}} 8; Default: '''8'''</td>
        <td>The number of data bits for each character</td>
    </tr>
    <tr>
    <td>Parity</td>
        <td>None {{!}} Odd {{!}} Even; Default: '''None'''</td>
        <td>In serial transmission, parity is a method of detecting errors. An extra data bit is sent with each data character, arranged so that the number of 1 bits in each character, including the parity bit, is always odd or always even. If a byte is received with the wrong number of 1s, then it must have been corrupted. However, an even number of errors can pass the parity check. <br> '''None''' ('''N''') - no parity method is used <br> '''Odd''' ('''O''') - the parity bit is set so that the number of "logical ones (1s)" has to be odd <br> '''Even''' ('''E''') - the parity bit is set so that the number of "logical ones (1s)" has to be even</td>
    </tr>
    <tr>
      <td>Stop bits</td>
      <td>1 {{!}} 2; Default: '''1'''</td>
      <td>Stop bits sent at the end of every character allow the receiving signal hardware to detect the end of a character and to resynchronise with the character stream. Electronic devices usually use one stop bit. Two stop bits are required if slow electromechanical devices are used</td>
    </tr>
    <tr>
      <td>Flow control</td>
      <td>None {{!}} RTS/CTS {{!}} Xon/Xoff; Default: '''None'''</td>
      <td>In many circumstances a transmitter might be able to send data faster than the receiver is able to process it. To cope with this, serial lines often incorporate a "handshaking" method, usually distinguished between hardware and software handshaking. <br> '''RTS/CTS''' - hardware handshaking. RTS and CTS are turned OFF and ON from alternate ends to control data flow, for instance when a buffer is almost full <br> '''Xon/Xoff''' - software handshaking. The Xon and Xoff characters are sent by the receiver to the sender to control when the sender will send data, i.e., these characters go in the opposite direction to the data being sent. The circuit starts in the "sending allowed" state. When the receiver's buffers approach capacity, the receiver sends the Xoff character to tell the sender to stop sending data. Later, after the receiver has emptied its buffers, it sends an Xon character to tell the sender to resume transmission</td>
    </tr>
    <tr>
    <td>Serial type</td>
        <td>[[TRB142_RS232#Console|Console]] {{!}} [[TRB142_RS232#Over_IP|Over IP]] {{!}} [[TRB142_RS232#Modem|Modem]] {{!}} [[TRB142_RS232#Modbus_gateway|Modbus gateway]] {{!}} [[TRB142_RS232#NTRIP_client|NTRIP client]]; Default: '''Console'''</td>
        <td>Specifies the serial connection type.</td>
    </tr>
    <tr>
    <td>Echo</td>
        <td>yes {{!}} no; Default: '''no'''</td>
        <td>Toggles RS232 echo ON or OFF. RS232 echo is a loopback test usually used to check whether the RS232 cable is working properly</td>
    </tr>
</table>
 
===RS232 Connector Pinout===
----
RS232 connector type on this device is DCE female. DCE stands for Data Communication Equipment.
 
[[Image:Services rs232 connector.PNG]]
 
<table class="nd-othertables">
    <tr>
        <th style="width: 30px">PIN</th>
      <th style="width: 60px">NAME*</th>
      <th style="width: 170px">DESCRIPTION*</th>
        <th style="width: 400px">DIRECTION ON THIS DEVICE</th>
    </tr>
    <tr>
      <td>1</td>
      <td>DCD</td>
      <td>Data Carrier Detect</td>
      <td>Output</td>
    </tr>
    <tr>
      <td>2</td>
      <td>RXD</td>
      <td>Receive Data</td>
      <td>Output</td>
    </tr>
    <tr>
    <td>3</td>
        <td>TXD</td>
        <td>Transmit Data</td>
      <td>Input</td>
    </tr>
    <tr>
    <td>4</td>
        <td>DTR</td>
        <td>Data Terminal Ready</td>
      <td>Input</td>
    </tr>
    <tr>
      <td>5</td>
      <td>GND</td>
      <td>Signal Ground</td>
      <td>-</td>
    </tr>
    <tr>
      <td>6</td>
      <td>DSR</td>
      <td>Data Set Ready</td>
      <td>Output</td>
    </tr>
    <tr>
    <td>7</td>
        <td>RTS</td>
        <td>Ready To Send</td>
      <td>Input</td>
    </tr>
    <tr>
    <td>8</td>
        <td>CTS</td>
        <td>Clear To Send</td>
      <td>Output</td>
    </tr>
    <tr>
    <td>9</td>
        <td>RI</td>
        <td>Ring Indicator</td>
      <td>Output (connected to +5V permanently via a 4.7k resistor) </td>
    </tr>
</table>
 
'''*''' The names and descriptions that indicate signal direction (such as TXD, RXD, RTS, CTS, DTR, and DSR) are named from the point of view of the DTE device.
 
===Cables===
----
{{Template: webui_services_rs232_cables}}
 
==RS485==
 
'''RS-485''' is a different serial data transmission standard for use in long ranges or noisy environments.
 
[[Image:Services rs485.PNG]]
 
<table class="nd-mantable">
    <tr>
        <th>field name</th>
      <th>value</th>
      <th>description</th>
    </tr>
    <tr>
      <td>Enabled</td>
      <td>yes {{!}} no; Default: '''no'''</td>
      <td>Toggles the RS485 serial port function ON or OFF</td>
    </tr>
    <tr>
      <td>Baud rate</td>
      <td>300 {{!}} 1200 {{!}} 2400 {{!}} 4800 {{!}} 9600 {{!}} 19200 {{!}} 38400 {{!}} 57600 {{!}} 115200; Default: '''115200'''</td>
      <td>The communication speed of the serial interface</td>
    </tr>
    <tr>
    <td>Parity</td>
        <td>None {{!}} Odd {{!}} Even; Default: '''None'''</td>
        <td>The parity bit setting used for error detection during data transfer</td>
    </tr>
    <tr>
    <td>Flow control</td>
        <td>None {{!}} RTS- CTS {{!}} Xon-Xoff; Default: '''None'''</td>
        <td>Specifies how many stop bits will be used to detect the end of character</td>
    </tr>
    <tr>
      <td>Serial type</td>
      <td>Console {{!}} Over IP {{!}} Modem {{!}} Modbus Gateway {{!}} NTRIP Client; Default: '''Console'''</td>
      <td>Specifies the function of the serial interface</td>
    </tr>
    <tr>
    <td>Interface</td>
        <td>LAN {{!}} WAN {{!}} VPN {{!}} L2TP {{!}} PPTP {{!}} GRE {{!}} HOTSPOT; Default: '''LAN'''</td>
        <td>Interface used for connection</td>
    </tr>
    <tr>
    <td>Allow IP</td>
        <td>ip; Default: " "</td>
        <td>Allows IP to connect to server</td>
    </tr>
</table>
 
===Maximum data rate vs. transmission line length===
----
RS-485 standart can be used for network lengths up to 1200 meters, but the maximum usable data rate decreases as the transmission length increases. A device operating at the maximum data transfer rate (10Mbps) is limited to a transmission length of about 12 meters, while the 100kbps data rate can achieve a distance up to 1200 meters. A rough relation between maximum transmission length and data rate can be calculated using this approximation:
 
[[Image:Services rs485 formula.PNG]]
 
Where Lmax is the maximum transmission length in meters and DR is maximum data rate in bits per second.
 
Twisted pair is the prefered cable type for RS-485 networks. Twisted pair cables pick up noise and other electromagnetically induced voltages as common mode signals, which are rejected by the differential receivers.
 
===Cable Type===
----
Recommended cable parameters:
 
<table class="nd-othertables">
    <tr>
        <th style="width: 300px">PARAMETER</th>
      <th style="width: 350px">VALUE</th>
    </tr>
    <tr>
      <td>Cable Type</td>
      <td>22-24 AWG, 2 – pair (used for full-duplex networks ) or 1-pair (used for half duplex networks). One addtitional wire for ground connection is needed</td>
    </tr>
    <tr>
      <td>Characteristic cable Impedance</td>
      <td>120 Ω @ 1MHz</td>
    </tr>
    <tr>
    <td>Capacitance (conductor to conductor)</td>
        <td>36 pF/m</td>
    </tr>
    <tr>
    <td>Propagation Velocity</td>
        <td>78% (1.3 ns/ft)</td>
    </tr>
</table>
 
===RS485 connector pin-out===
----
[[Image:Services rs485 port.PNG]]
 
{| class="wikitable"
|+
! style="width: 25px; border: 1px solid white; border-bottom: 2px solid #0054A6; background: white; color: #0054A6; text-align: left;" | NAME
! style="width: 190px; border: 1px solid white; border-bottom: 2px solid #0054A6; background: white; color: #0054A6; text-align: left;" | DESCRIPTION
! style="width: 165px; border: 1px solid white; border-bottom: 2px solid #0054A6; background: white; color: #0054A6; text-align: left;" | TYPE
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | D_P
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Driver positive signal
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Differential Output
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | D_N
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Driver negative signal
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Differential Output
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | R_P
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Receiver positive signal
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Differential Input
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | R_N
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Receiver negative signal
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Differential Input
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Ground
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Device ground
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Differential Output
|-
|}
 
===2-Wire and 4-Wire Networks===
----
Below is an example of a 4-wire network electrical connection. There are 3 devices shown in the example. One of the devices is the “master” and other two are “slaves”. Termination resistors are placed at each cable end. Four-wire networks consists of one „master“ with its transmitter connected to each of the “slaves‘” receivers on one twisted pair. The “slave” transmitters are all connected to the “master” receiver on a second twisted pair.
 
[[Image:Services rs485 4wire.PNG]]
 
Example 2-wire network electrical connection: to enable a 2-wire RS-485 configuration on a Teltonika router, you need to connect D_P to R_P and D_N to R_N on the device’s RS-485 socket. Termination resistors are placed at each
cable end.
 
[[Image:Services rs485 2wire.PNG]]
 
===Termination===
----
'''When to use (place jumper)'''
 
Termination resistor, equal in resistance to cable characteristic impedance, must be connected at each end of the cable to reduce reflection and ringing of the signals when the cable lengths get relatively long. Rise time of the RUT955 RS-485 driver is about 5 ns, so the maximum unterminated cable length is about 12 cm. As transmission line cables will always be longer than 12 cm, termination is mandatory all the time if RUT955 is located at the end of the cable.
 
'''When not to use (remove jumper)'''
 
If your RS-485 consists of more than two devices and the RUT955 router is located not on the end of the line but, for example, in the middle, RUT955 termination resistor needs to be disabled. In this case, place termination at other devices which are situated at the ends of the line.
 
'''How to enable termination'''
 
120 Ω termination resistor is included on the RUT955 PCB and can be enabled by shorting contacts (shown in the picture below), placing 2.54mm pitch jumper:
 
[[Image:Services rs485 jumper.PNG]]
 
===Number of devices in an RS-485 Network===
----
One RUT955 RS-485 driver is capable of driving a maximum of 32 receivers, provided that the receiver input impedance is 12 kΩ. If receiver impedances are higher, the maximum number of receivers in the network increases. Any combination of receiver types can be connected together, provided their parallel impedance does not exceed RLoad > 375 Ω.
 
==Modes of different serial types in RS232 and RS485==
 
===Console===
----
In this mode the serial interface set up as a Linux console of the device. It can be used for debugging purposes, to get the status of the device or to control it.
 
===Over IP===
----
In '''Over IP Serial''' type the router provides a connection to a TPC/IP network for the devices connected via serial interfaces.
 
====Mode: Server====
----
[[Image:Services rs232 rs485 overip server.PNG]]
 
{| class="wikitable"
|+
! style="width: 250px; border: 1px solid white; border-bottom: 2px solid #0054A6; background: white; color: #0054A6; text-align: left;" | FIELD NAME
! style="width: 250px; border: 1px solid white; border-bottom: 2px solid #0054A6; background: white; color: #0054A6; text-align: left;" | VALUE
! style="width: 579px; border: 1px solid white; border-bottom: 2px solid #0054A6; background: white; color: #0054A6; text-align: left;" | DESCRIPTION
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Protocol
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | TCP; Default: '''TCP'''
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Specifies the protocol used in the communication process
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Mode
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Server {{!}} Client {{!}} Bidirect; Default: '''Server'''
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Specifies the device's role in the connection: <br> '''Server''' - the device waits for incoming connections <br> '''Client''' - the device initiates the connection <br> '''Bidirect''' - acts as client by default but waits for incoming connections at the same time
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | No leading zeros
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | yes {{!}} no; Default: '''no'''
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Specifies that the first hex zeros should be skipped
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | TCP port
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | integer [0..65535]; Default: " "
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | The port number used to connect to the server
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Timeout (s)
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | integer; Default: " "
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Disconnects clients after the amount of inactivity time (in seconds) specified in this field
|-
|}
 
====Mode: Client====
----
[[Image:Services rs232 rs485 overip client.PNG]]
 
{| class="wikitable"
|+
! style="width: 250px; border: 1px solid white; border-bottom: 2px solid #0054A6; background: white; color: #0054A6; text-align: left;" | FIELD NAME
! style="width: 250px; border: 1px solid white; border-bottom: 2px solid #0054A6; background: white; color: #0054A6; text-align: left;" | VALUE
! style="width: 579px; border: 1px solid white; border-bottom: 2px solid #0054A6; background: white; color: #0054A6; text-align: left;" | DESCRIPTION
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Protocol
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | TCP; Default: '''TCP'''
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | The protocol used for data transmission
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Mode
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Server {{!}} Client {{!}} Bidirect; Default: '''Server'''
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | '''Server''' - waits for incoming connection
 
'''Client''' - initiates the connection
 
'''Bidirect''' – acts as a client by default, but at the same time waits for incoming connections
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | No leading zeros
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | yes {{!}} no; Default: '''no'''
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Skips first hex zeros
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Server address
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | host {{!}} ip; Default: '''no'''
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Server address to which the client will connect to
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | TCP port
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | integer [0..65535]; Default: " "
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | The port number used to listen for incoming connections
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Reconnect intervals (s)
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | integer; Default: " "
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Indicates the time period between reconnection attempts
|-
|}
 
====Mode: Bidirect====
----
[[Image:Services_rs232_rs485_overip_bidirect.PNG]]
 
{| class="wikitable"
|+
! style="width: 250px; border: 1px solid white; border-bottom: 2px solid #0054A6; background: white; color: #0054A6; text-align: left;" | FIELD NAME
! style="width: 250px; border: 1px solid white; border-bottom: 2px solid #0054A6; background: white; color: #0054A6; text-align: left;" | VALUE
! style="width: 579px; border: 1px solid white; border-bottom: 2px solid #0054A6; background: white; color: #0054A6; text-align: left;" | DESCRIPTION
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Mode
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Server {{!}} Client {{!}} Bidirect; Default: '''Server'''
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | '''Server''' - waits for incoming connection
 
'''Client''' - initiates the connection
 
'''Bidirect''' – acts as a client by default, but at the same time waits for incoming connections
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | No leading zeros
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | yes {{!}} no; Default: '''no'''
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Skips first hex zeros
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Server address
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | host {{!}} ip; Default: '''no'''
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Server address to which the client will connect to
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | TCP port
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | integer [0..65535]; Default: " "
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | The port number used to listen for incoming connections
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Reconnect intervals (s)
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | integer; Default: " "
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Indicates the time period between reconnection attempts
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | TCP port
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | integer [0..65535]; Default: " "
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | The port number used to listen for incoming connections
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Timeout (s)
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | integer; Default: " "
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Disconnects client after the specified timeout of inactivity
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Output
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | OC Output {{!}} Relay Output; Default: '''OC Output'''
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Output to indicate that application switched from client (default) to server state
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Output state
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | integer [0..1]; Default: '''0'''
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Output state value after the application reverts to server mode
|-
|}
 
===Modem===
----
With Modem Serial type, the router imitates a dial-up modem. Connections to TCP/IP networks can be established using AT commands. The connection can be initiated by the device connected via serial interface with an ATD command: ATD <host>:<port>. If Direct connect settings are specified, the connection to the server is always active. Data mode can be entered by issuing the ATD command. Incoming connections are indicated by sending a RING to the serial interface.
 
[[File:Services rs232 rs485 modem v 2.png]]
 
{| class="wikitable"
|+
! style="width: 250px; border: 1px solid white; border-bottom: 2px solid #0054A6; background: white; color: #0054A6; text-align: left;" | FIELD NAME
! style="width: 250px; border: 1px solid white; border-bottom: 2px solid #0054A6; background: white; color: #0054A6; text-align: left;" | VALUE
! style="width: 579px; border: 1px solid white; border-bottom: 2px solid #0054A6; background: white; color: #0054A6; text-align: left;" | DESCRIPTION
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Direct connect
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | host:port {{!}} ip:port; Default: " "
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Maintains a constant connection to specified host. Leave empty to use an ATD command to initiate the connection
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | TCP port
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | integer [0..65535]; Default: " "
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | The port number used to listen for incoming connections. Leave it empty to disable incoming connections
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Initiation string
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | string; Default: " "
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | A command string that will be sent to the modem to initiate it in some special way
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | No extra CR LF in response
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | yes {{!}} no; Default: '''yes'''
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Removes extra CR LF before and LF after response code
|-
|}
 
This is the AT command set used in Modem mode of the serial interfaces:
 
{| class="wikitable"
|+
! style="width: 10px; border: 1px solid white; border-bottom: 2px solid #0054A6; background: white; color: #0054A6; text-align: left;" | COMMAND
! style="width: 175px; border: 1px solid white; border-bottom: 2px solid #0054A6; background: white; color: #0054A6; text-align: left;" | DESCRIPTION
! style="width: 325px; border: 1px solid white; border-bottom: 2px solid #0054A6; background: white; color: #0054A6; text-align: left;" | USAGE
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | A
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Answers incoming call
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | To answer incoming connection: ATA
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | D
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Dial a number
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | To initiate data connection: ATD <host>:<port>
 
To enter data mode with Direct connect settings: ATD
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | E
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Local echo
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Turn local echo on: ATE1
 
Turn local echo off: ATE0
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | H
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Hang up current call
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | To end data connection: ATH
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | O
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Return to data mode
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | To return to data mode from command mode: ATO
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Z
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Reset to default configuration
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | To reset the modem to default configuration: ATZ
|-
|}
 
===Modbus gateway===
----
The Modbus gateway Serial type allows redirecting TCP data coming to a specified port to RTU specified by the Slave ID. The Slave ID can be specified by the user or be obtained directly from the Modbus header.
 
[[Image:Services_rs232_rs485_modbus_gateway.PNG]]
 
{| class="wikitable"
|+
! style="width: 250px; border: 1px solid white; border-bottom: 2px solid #0054A6; background: white; color: #0054A6; text-align: left;" | FIELD NAME
! style="width: 250px; border: 1px solid white; border-bottom: 2px solid #0054A6; background: white; color: #0054A6; text-align: left;" | VALUE
! style="width: 579px; border: 1px solid white; border-bottom: 2px solid #0054A6; background: white; color: #0054A6; text-align: left;" | DESCRIPTION
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Listening IP
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | ip; Default: '''0.0.0.0'''
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | IP address on which the Modbus gateway will wait for incoming connections
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Port
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | integer [0..65535]; Default: " "
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | The port number used to listen for incoming connections
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Slave ID configuration type
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | User defined {{!}} Obtained from TCP; Default: '''User defined'''
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Specifies whether slave IDs are user defined or automatically obtained from TCP
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Slave ID {{!}} Permitted slave IDs
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | integer {{!}} range of integers; Default: '''1'''
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Specifies the slave ID of range of permitted slave IDs. The way this field is named and its function depends on the value of the ''Slave ID configuration'' field. <br> A range of IDs can be specified by placing a '''hyphen''' ('''-''') between two integer numbers. For example, if you permitt slave IDs in the range of 10 to 20, you would specify it as: '''10-20''' <br> You can also specify multiple values that are not connected in a range using '''commas''' (''','''). For example, to specify 6, 50 and 100 as permitted slave IDs, you would have to use: '''6,50,100'''
|-
|}
 
===NTRIP===
----
Networked Transport of RTCM via Internet Protocol (Ntrip) is a protocol for streaming differential GPS (DGPS) data over the Internet in accordance with specification published by RTCM.
 
[[Image:Services rs232 rs485 ntrip.PNG]]
 
{| class="wikitable"
|+
! style="width: 250px; border: 1px solid white; border-bottom: 2px solid #0054A6; background: white; color: #0054A6; text-align: left;" | FIELD NAME
! style="width: 250px; border: 1px solid white; border-bottom: 2px solid #0054A6; background: white; color: #0054A6; text-align: left;" | VALUE
! style="width: 579px; border: 1px solid white; border-bottom: 2px solid #0054A6; background: white; color: #0054A6; text-align: left;" | DESCRIPTION
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | IP address
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | ip; Default: '''0.0.0.0'''
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | IP address of the NTRIP server
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Port
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | integer [0..65535]; Default: " "
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | TCP/UDP port used for NTRIP communication
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Mount point
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | string; Default: " "
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | NTRIP mount point
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Data format
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | NTRIP V2.0 TCP/IP {{!}} NTRIP V2.0 RSTP/RTP {{!}} NTRIP V1.0 {{!}} Automatic detection {{!}} NTRIP V2.0 UDP; Default: '''NTRIP V1.0'''
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Specifies the used version of NTRIP
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Username
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | string; Default: " "
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | User name for NTRIP authentication
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Password
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | string; Default: " "
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Password for NTRIP authentication
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Default NMEA string
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | string; Default: " "
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Optional NMEA string that will be used as the default value when initiating the connection to the NTRIP server (this value is only sent to the server if there is no NMEA from router's GPS device)
|-
! style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Use device GPS
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | yes {{!}} no; Default: '''no'''
| style="border: 1px solid white; border-bottom: 2px solid #E8E8E8; text-align: left; vertical-align: top; background: white;" | Allows to obtain default NMEA string from the router's GPS device. Only works if GPS service is enabled and location fix is obtained at the time of NTRIP service start
|-
|}

Latest revision as of 14:55, 25 April 2022

Main Page > EOL Products > RUT955 > RUT955 Manual > RUT955 WebUI > RUT955 Services section > RUT955 RS232

The information in this page is updated in accordance with firmware version RUT9_R_00.07.06.16.

RS232 service was moved to Serial Utilities page from FW version RUT9_R_00.07.03.
Note: click here for the old style WebUI (FW version RUT9XX_R_00.06.09.5 and earlier) user manual page.

Summary

The RS232 page is used to configure the operating parameter of RS232 serial connector.

This manual page provides an overview of the RS232 page in RUT955 devices.

General information

RS232 connector pinout

The RS232 connector type on this device is a DCE female. DCE stands for Data Communication Equipment.

PIN NAME* DESCRIPTION* DIRECTION ON THIS DEVICE
1 DCD Data Carrier Detect Output
2 RXD Receive Data Output
3 TXD Transmit Data Input
4 DTR Data Terminal Ready Input
5 GND Signal Ground -
6 DSR Data Set Ready Output
7 RTS Ready To Send Input
8 CTS Clear To Send Output
9 RI Ring Indicator Output (connected to +5V permanently via a 4.7k resistor)

Cables

There are two types of RS232 serial devices: DTE and DCE. DTE typically refers to the serial port on a PC or terminal, while DCE refers to communication devices. Connectors mounted on DTE are likely to be male, and those mounted on DCE are likely to be female.

This device is DCE and has a female connector.


To connect a standard DTE device, use a straight-through Female/Male RS232 cable:

See straight cable pinout below:


To connect another DCE device to RUT955, a Null-modem (crossed) Male/Male cable should be used:

See straight crossed cable pinout below:


Maximum cable length is 15 meters or the cable length equal to a capacitance of 2500 pF (for a 19200 baud rate). Using lower capacitance cables can increase the distance. Reducing communication speed can also increase maximum cable length.

RS232 Configuration

The RS232 Configuration section is used to set up the main operating parameters and the serial type of the RS232 connector.

Field Value Description
Enabled off | on; default: off Turns the RS232 service on or off.
Baud rate 300 | 600 | 1200 | 2400 | 4800 | 9600 | 19200 | 38400 | 57600 | 115200; default: 115200 Data rate for serial data transmission (in bits per second (bps)).
Data bits 5 | 6 | 7 | 8; default: 8 Number of data bits for each character.
Parity None | Odd | Even; default: None In serial transmission, parity is a method of detecting errors. An extra data bit is sent with each data character, arranged so that the number of 1 bits in each character, including the parity bit, is always odd or always even. If a byte is received with the wrong number of 1s, then it must have been corrupted. However, an even number of errors can pass the parity check.
  • None (N) - no parity method is used.
  • Odd (O) - the parity bit is set so that the number of "logical ones (1s)" has to be odd.
  • Even (E) - the parity bit is set so that the number of "logical ones (1s)" has to be even.
Stop bits 1 | 2; default: 1 Stop bits sent at the end of every character allow the receiving signal hardware to detect the end of a character and to resynchronise with the character stream. Electronic devices usually use one stop bit. Two stop bits are required if slow electromechanical devices are used.
Flow control None | RTS/CTS | Xon/Xoff; default: None In many circumstances a transmitter might be able to send data faster than the receiver is able to process it. To cope with this, serial lines often incorporate a "handshaking" method, usually distinguished between hardware and software handshaking.
  • RTS/CTS - hardware handshaking. RTS and CTS are turned OFF and ON from alternate ends to control data flow, for instance when a buffer is almost full.
  • Xon/Xoff - software handshaking. The Xon and Xoff characters are sent by the receiver to the sender to control when the sender will send data, i.e., these characters go in the opposite direction to the data being sent. The circuit starts in the "sending allowed" state. When the receiver's buffers approach capacity, the receiver sends the Xoff character to tell the sender to stop sending data. Later, after the receiver has emptied its buffers, it sends an Xon character to tell the sender to resume transmission.
Serial type Console | Over IP | Modem | Modbus gateway; default: Console Specifies the serial connection type.
Look to the sections below for information on different RS232 serial type options.

Console


Console mode requires no further configuration than the settings above and is used as a direct-access method to the device's shell interface. For this purpose you may want use such applications as PuTTY on Windows and microcom, minicom, picocom or similar applications on Linux.

Over IP


The Over IP serial type is used to manage serial connections over a TCP/IP network.

Field Value Description
Protocol TCP | UDP; default: TCP Protocol used in the communication process.
Raw mode off | on; default; default: off When enabled, all data will be transmitted transparently.
Mode Server | Client | Bidirect; default: Server This device's role in the connection:
  • Server - the device waits for incoming connections.
  • Client - the device initiates the connection.
  • Bidirect - acts as client by default but waits for incoming connections at the same time.
No leading zeros off | on; default: off When checked, indicates that the first hex zeros should be skipped.
Server settings: Port integer [0..65535]; default: none Internal port number used to listen for incoming connections.
Server settings | TCP: Timeout (s) integer [0..32767]; default: 300 Specifies an inactivity time limit (in seconds) after which an inactive clients is disconnected.
Bidirect: OutputOutput (4) | Isolated Output (3,4,8) | Relay (5,10); default: Output (4) Specifies which output to manage.
Bidirect: Output state 0 | 1; default: 0 Default output state value, when the application is started.
Server settings | UDP: Number of clients 1-10; default: 1 Specifies how many UDP clients will be supported simultaneously (predefined clients does not count towards this limit).
Server settings | UDP: Predefined client 1 address ip4; default: none Specifies IP address for predefined connection 1.
Server settings | UDP: Predefined port 1 port; default: none Specifies port number for predefined connection 1.
Server settings | UDP: Predefined client 2 address ip4; default: none Specifies IP address for predefined connection 2.
Server settings | UDP: Predefined port 2 port; default: none Specifies port number for predefined connection 2.
Client settings: Server Address ip | host; default: none IP address or hostname of the server that this client will connect to.
Client settings: Port integer [0..65535]; default: none Server's listening port number.
Client settings: Reconnect interval (s) integer; default: none Time period (in seconds) between reconnection attempts in case a connection fails.
Serial device read time integer [0..1000]; default: none Specifies custom read time for the serial device.
Echo off | on; default: off Turns RS232 echo on or off. RS232 echo is a loopback test usually used to check whether the RS232 cable is working properly.
Server settings | TCP: Max clients integer [1..32]; default: 32 Specifies how many clients are allowed to connect simultaneously.
TCP: Always reconnect off | on; default: off When enabled, a new TCP connection will be made after sending every data package.

Modem


The Modem serial type is used to manage modem functionality which could be accessed using shell interface. For this purpose you may want use such applications with CR/LF (Carriage Return, Line Feed) capable applications like PuTTY on Windows and microcom, minicom, cutecom or similar applications on Linux.

Field Value Description
Mode Partial control | Full control; default: Partial control Specifies modem control mode.
    • Partial control- enables modem control with AT commands, mobile connection will be controlled by RUTOS.
    • Full control- enables modem control with AT commands, mobile connection will be controlled by user.

Modbus gateway


The Modbus gateway serial type allows redirecting TCP data coming to a specified port to an RTU specified by the Slave ID. The Slave ID can be specified by the user or be obtained directly from the Modbus header.

Field Value Description
Listening IP ip; default: 0.0.0.0 IP address to listen for incoming connections. The default value (0.0.0.0) means that this device will listen for incoming connections on any interface or IP address.
Port integer [0..65535]; default: 502 Port number to listen for incoming connections.
Slave ID configuration type User defined | Obtained from TCP;
default: User defined
Specifies whether slave IDs are user defined or automatically obtained from TCP.
Slave ID | Permitted slave IDs integer | range of integers;
default: 1 or 1-247
Specifies the slave ID of range of permitted slave IDs. The way this field is named and its function depends on the value of the Slave ID configuration field.
A range of IDs can be specified by placing a hyphen (-) between two integer numbers. For example, if you permit slave IDs in the range of 10 to 20, you would specify it as: 10-20
You can also specify multiple values that are not connected in a range using commas (,). For example, to specify 6, 50 and 100 as permitted slave IDs, you would have to use: 6,50,100
Open port automatically off | on; default: on Automatically adds a traffic rule in the firewall configuration to open the required port for serial communication.
Caution: use with care if listening IP is left as the default value (0.0.0.0). Leaving it as such will leave the device open for remote connections on the specified port.
Echo off | on; default: off Turns RS232 echo on or off. RS232 echo is a loopback test usually used to check whether the RS232 cable is working properly.

IP Filter

The IP Filter section is used for configuring which network is allowed to communicate with the device. You may add a new instance by selecting the Interface and pressing Add.

Then enter the IP address and save.