Difference between revisions of "Serial OverIP communication between Server and Client"

From Teltonika Networks Wiki
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
<p style="color:red">The information on this page is updated in accordance with the [https://wiki.teltonika-networks.com/view/FW_%26_SDK_Downloads'''00.07.09'''] firmware version .</p>
 
=Introduction=
 
=Introduction=
 
This article provides a configuration example to enable communication from a serial device connected to the TRB142/5 to another serial device (e.g. RUT955/6) using OverIP via public IP or RMS VPN.
 
This article provides a configuration example to enable communication from a serial device connected to the TRB142/5 to another serial device (e.g. RUT955/6) using OverIP via public IP or RMS VPN.
Line 9: Line 10:
 
*Public IP or RMS VPN configured.
 
*Public IP or RMS VPN configured.
 
==Topology==
 
==Topology==
[[File:Serial overip7.png|border|class=tlt-border|1100x700px]]
+
 
 +
[[File:Serial overip86.png|border|class=tlt-border|1094px]]
 +
 
 
=Configuration=
 
=Configuration=
==OverIP server==
+
==Over IP Server==
Firstly, we'll need to configure the Serial-Over-IP server. Navigate to '''Services->RS232''', or (if you're going to use '''RS485''', navigate there instead).
+
 
[[File:Serial overip1.png|border|class=tlt-border|1100x700px]]
+
====Obtaining Public IP: Set an APN====
#'''Enable''' the interface
+
----
#Select baud rate ('''9600''')
+
In this example we are using Public IPs, it also works with Private IPs if routers are in same LAN
#Serial type ('''Over IP''')
+
 
#Mode '''Server'''
+
'''Note:''' If you have a Public IP address already, you can skip this step.
#Select port ('''8000''')
+
 
 +
To set the APN, while in the router's WebUI, navigate to the '''Network → Mobile → General → Interface mob1s1a1 APN configuration''':
 +
 
 +
[[File:Set APN PF.png|border|class=tlt-border]]
 +
 
 +
Once in the '''Interface mob1s1a1 APN configuration''' window, edit your mobile interface, find the '''APN''' field and enter you Internet Service Provider's APN:
 +
# '''Disable the Auto APN option'''
 +
# Choose the correct '''APN''', which gives out a public IP address (for more information about that contact your Internet Service Provider)
 +
 
 +
[[File:Set APN PF APN selected.png|border|class=tlt-border]]
 +
 
 +
Additional notes on APN:
 +
* '''NOTE 1''': don't use the exact APN value as seen in the example above as it will not work with your SIM card. APN depends on your Internet Service Provider (ISP), therefore, your ISP should provide you with their APN or, in many case, you can find your ISP's APN with an online search.
 +
* '''NOTE 2''': furthermore, it should be noted that not all SIM cards support this functionality. Static or Dynamic Public IP addresses (obtained through APN) are a paid service and setting any APN value for a SIM card that doesn't support this service will most likely result in losing your data connection. If this is the case, it can be fixed by simply deleting the APN, but it also means that remote access through mobile WAN IP will most likely not work on your SIM card.
 +
* '''NOTE 3''': in some cases the SIM card doesn't require an APN in order to obtain a Public IP address. If that is the case for you, simply check what your router's mobile WAN IP address is - if it's already a Public IP address, then you don't need to set an APN. The easiest way to find what your mobile WAN IP address is to log in to the router's WebUI and check the '''MOB1S1A1''' widget in the '''Overview''' page:
 +
 
 +
[[File:Where public IP.png|border|class=tlt-border]]
 +
 
 +
 
 +
===Over IP Server RS232 configuration===
 +
----
 +
Navigate to the Over IP tab by going to '''Services → Serial Utilities → Over IP''' . Insert desired name and select RS232. Make sure to '''enable the instance''' '''(1)''' and '''configure Serial port in accordance''' '''(2)''' to connected device, these should match on both routers to avoid miscommunication.
 +
 
 +
[[File:OverIP Sever serial config.png|border|class=tlt-border]]
 +
 
 +
 
 +
===Over IP Server configuration===
 +
----
 +
After applying RS232 configuration scroll down and configure Over IP Server:
 +
 
 +
# Mode '''Server'''- the device waits for incoming connections.
 +
# Select a desired protocol, '''TCP or UDP'''.
 +
# '''TCP/UDP port''' - specify desired port.
 +
 
 +
[[File:OverIP TCP server configuration port.png|border|class=tlt-border]]
 +
 
 +
 
 +
===IP Filter===
 +
----
 +
 
 +
Once finished the above configuration, add interfaces through which routers will be communicating, You can add IP address that will be allowed to connect or enter 0.0.0.0 to allow all connections coming through correct port.
 +
 
 +
[[File:OverIP TPC Server IP filter.png|border|class=tlt-border]]
 +
 
 +
==OverIP Client==
 +
 
 +
===OverIP Server RS232 configuration===
 +
----
 +
Navigate to the OverIP tab by going to '''Services → Serial Utilities → OverIP''' . Insert desired name and select RS232. Make sure to '''enable the instance''' '''(1)''' and '''configure Serial port in accordance''' '''(2)''' to connected device, these should match on both routers to avoid miscommunication.
 +
 
 +
[[File:OverIP Client serial config.png|border|class=tlt-border]]
 +
 
 +
 
 +
===OverIP Client configuration===
 +
----
 +
After applying RS232 configuration scroll down and configure Over IP Server:
 +
 
 +
# Mode '''Client''' – the device initiates the connection.
 +
# Select a desired protocol, '''TCP or UDP'''.
 +
# '''Address''' is the Over IP Sever Public IP address.  '''Port''' is the port we have configured on the Over IP Server device.
 +
 
 +
[[File:OverIP TCP Client configuration IP port.png|border|class=tlt-border]]
 +
 
 +
==Testing configuration==
  
Now, you should let specific IP through, or just use 0.0.0.0/0 for the whole internet to be allowed in.
 
[[File:Serial overip2.png|border|class=tlt-border|1100x700px]]
 
#Select through which interface serial packets will come in
 
#Add it
 
#Type, which IPs will be allowed in
 
#Save
 
==OverIP client==
 
[[File:Serial overip3.png|border|class=tlt-border|1100x700px]]
 
#'''Enable''' the interface
 
#Select baud rate ('''9600''')
 
#Serial type ('''Over IP''')
 
#Mode '''Client'''
 
#Type in the server's public IP or RMS VPN's IP
 
## You can check your RMS VPN's IP by navigating to '''RMS VPN->VPN Hubs''' and selecting the hub where your serial devices are connected.
 
##Now you can check your OverIP server's IP<br>[[File:Serial overip4.png|border|class=tlt-border|700x450px]]
 
#Select port ('''8000''')
 
=Testing=
 
 
After configuration has been complete, we'll need to test it. Launch Hercules on both PCs and connect using serial protocol to connect to TRB142/5 and RUT955/6.
 
After configuration has been complete, we'll need to test it. Launch Hercules on both PCs and connect using serial protocol to connect to TRB142/5 and RUT955/6.
[[File:Serial overip5.png|border|class=tlt-border]]
+
 
 
#Select serial protocol
 
#Select serial protocol
#Select the COM port to which your device is connected (On PC you can use Device Manager (Windows) to check this)
+
#Select the COM port to which your device is connected (On PC you can use Device Manager (Windows) to check this) and match the baud rate to which you've configured in the device
#Match the baud rate to which you've configured in the device
 
 
#Open the connection
 
#Open the connection
[[File:Serial overip6.png|border|class=tlt-border]]
+
#Send the desired text
#Now try sending any message from the client to the server and vice versa.
+
 
#You should see the message you've sent appearing on the other side of the serial device.
+
[[File:OverIP hercules config.png|border|class=tlt-border]]
 +
 
 +
Now try sending any message from the client to the server. You should see the message you've sent appearing on the other side of the serial device.
 +
 
 +
[[File:Over IP Client Server hercules test.png|border|class=tlt-border|1004px]]
 +
 
 +
[[Category:RS232/485]]

Latest revision as of 22:04, 13 October 2024

Main Page > General Information > Configuration Examples > RS232/485 > Serial OverIP communication between Server and Client

The information on this page is updated in accordance with the 00.07.09 firmware version .

Introduction

This article provides a configuration example to enable communication from a serial device connected to the TRB142/5 to another serial device (e.g. RUT955/6) using OverIP via public IP or RMS VPN.

Configuration Overview and Prerequisites

TRB142/5 and RUT955/6 have serial communication ports, that combined with Serial-Over-IP functionality on server enabled to gather of all information from clients, and simultaneously send to all clients in remote sites.

Prerequisites

  • 2 devices with serial port (e.g. TRB142/5, RUT955/6, TRB245/55)
  • 2 end devices capable of serial communication (we're going to use a PC and Hercules app)
  • Serial cables to connect to the end device ( 2 x RS232-USB will be used)
  • Public IP or RMS VPN configured.

Topology

Serial overip86.png

Configuration

Over IP Server

Obtaining Public IP: Set an APN


In this example we are using Public IPs, it also works with Private IPs if routers are in same LAN

Note: If you have a Public IP address already, you can skip this step.

To set the APN, while in the router's WebUI, navigate to the Network → Mobile → General → Interface mob1s1a1 APN configuration:

Set APN PF.png

Once in the Interface mob1s1a1 APN configuration window, edit your mobile interface, find the APN field and enter you Internet Service Provider's APN:

  1. Disable the Auto APN option
  2. Choose the correct APN, which gives out a public IP address (for more information about that contact your Internet Service Provider)

Set APN PF APN selected.png

Additional notes on APN:

  • NOTE 1: don't use the exact APN value as seen in the example above as it will not work with your SIM card. APN depends on your Internet Service Provider (ISP), therefore, your ISP should provide you with their APN or, in many case, you can find your ISP's APN with an online search.
  • NOTE 2: furthermore, it should be noted that not all SIM cards support this functionality. Static or Dynamic Public IP addresses (obtained through APN) are a paid service and setting any APN value for a SIM card that doesn't support this service will most likely result in losing your data connection. If this is the case, it can be fixed by simply deleting the APN, but it also means that remote access through mobile WAN IP will most likely not work on your SIM card.
  • NOTE 3: in some cases the SIM card doesn't require an APN in order to obtain a Public IP address. If that is the case for you, simply check what your router's mobile WAN IP address is - if it's already a Public IP address, then you don't need to set an APN. The easiest way to find what your mobile WAN IP address is to log in to the router's WebUI and check the MOB1S1A1 widget in the Overview page:

Where public IP.png


Over IP Server RS232 configuration


Navigate to the Over IP tab by going to Services → Serial Utilities → Over IP . Insert desired name and select RS232. Make sure to enable the instance (1) and configure Serial port in accordance (2) to connected device, these should match on both routers to avoid miscommunication.

OverIP Sever serial config.png


Over IP Server configuration


After applying RS232 configuration scroll down and configure Over IP Server:

  1. Mode Server- the device waits for incoming connections.
  2. Select a desired protocol, TCP or UDP.
  3. TCP/UDP port - specify desired port.

OverIP TCP server configuration port.png


IP Filter


Once finished the above configuration, add interfaces through which routers will be communicating, You can add IP address that will be allowed to connect or enter 0.0.0.0 to allow all connections coming through correct port.

OverIP TPC Server IP filter.png

OverIP Client

OverIP Server RS232 configuration


Navigate to the OverIP tab by going to Services → Serial Utilities → OverIP . Insert desired name and select RS232. Make sure to enable the instance (1) and configure Serial port in accordance (2) to connected device, these should match on both routers to avoid miscommunication.

OverIP Client serial config.png


OverIP Client configuration


After applying RS232 configuration scroll down and configure Over IP Server:

  1. Mode Client – the device initiates the connection.
  2. Select a desired protocol, TCP or UDP.
  3. Address is the Over IP Sever Public IP address. Port is the port we have configured on the Over IP Server device.

OverIP TCP Client configuration IP port.png

Testing configuration

After configuration has been complete, we'll need to test it. Launch Hercules on both PCs and connect using serial protocol to connect to TRB142/5 and RUT955/6.

  1. Select serial protocol
  2. Select the COM port to which your device is connected (On PC you can use Device Manager (Windows) to check this) and match the baud rate to which you've configured in the device
  3. Open the connection
  4. Send the desired text

OverIP hercules config.png

Now try sending any message from the client to the server. You should see the message you've sent appearing on the other side of the serial device.

Over IP Client Server hercules test.png