Tunnel – Serial 4G-UDP Tunnel. MTX configured as Client/Server UDP connected permanently to 4G and using a SIM card with a fixed IP address

¿Buscas alguna otra cosa?

Scenario details:

  • We have 3 devices with an RS232 port (configured as 115200, 8, N, 1 and HW flow control) and they need to be monitored from a PC which is located in a Central Control station with Internet access
  • It is important to have access to the RS232 devices at all times; therefore the modem is connected to the serial port device and must remain connected to 4G at all times
  • The used protocol is not going to be orientated to the (TCP) connection because we want to use UDP for communications. The MTX Tunnel will be waiting for data packets on the UDP 20010 port sent from the Central Control PC. Every time a packet is received, it will be retransmitted by the serial port. Similarly the data packets received by MTX through the RS232 serial port will be retransmitted to the Control PC via UDP using the UDP 20011 port
  • SIM cards with fixed IP addressing will be used. The Control PC IP is fixed but in anticipation of possible future changes, the DNS “oficina.domino.com” will be used instead of their IP address. Then the MTX Tunnel must resolve the DNS

Solution: MTX-Tunnel firmware + MTX-Java-IoT/MTX-Java-T/MTX-Java-T2

Config.txt configuration file:

Configuration Observations
COMM_baudrate: 115200
COMM_bitsperchar: 8
COMM_autocts: on
COMM_autorts: on
COMM_stopbits: 1
COMM_parity: none
GPRS_apn: internetestatico.movistar.es
GPRS_login: MOVISTAR
GPRS_password: MOVISTAR
GPRS_DNS: 8.8.8.8
GPRS_timeout: 0
MTX_PIN: 0000
MTX_model: MTX-4G-Java-T
MTX_mode: udp
MTX_urc: off
UDP_IP: oficina.dominio.com
UDP_localPort: 20010
UDP_remotePort: 20011
FIREWALL_enabled: off
Serial port baud rate
8 bit data
CTS hardware control enabled
RTS hardware control enabled
1 stop bit
No parity
GPRS APN from your network operator
GPRS Login
GPRS Password
DNS server IP address
MTX-Tunnel is always GPRS connected
If SIM card has no PIN security, use 0000 value
MTX-Terminal modem model used
UDP mode
URC messages will not be sent
Public IP address form central server
Local port waiting for incoming connections
UDP server port waiting for incoming connections
Any incoming connection form any IP is allowed

Details:

  • Remember that it is necessary to configure the router in the PC server location to use NAT with the UDP port, NOT the TCP port