Tunnel – Use of MTX-Tunnel as 2G/3G/4G-RS232 gateway and for time synchronization of an external device connected to the modem

¿Buscas alguna otra cosa?

Scenario details:

  • A PLC system needs 2G/3G/4G-RS232 gateway to send data to a central server and to receive setting orders
  • The modem must remain in listen mode, waiting for a server connection, in the TCP 20010 port. On the other hand, the PLC can send alarm messages to the server. In the event of the modem receiving data via the serial port, an alarm must open a socket client against the server to send the data. The destination IP of the alarms will be 200.200.200.200. The connection port will be to the TCP20010
  • The PLC must also be able to use the modem to synchronize the time. The MTX-Tunnel must be set up so the time is automatically and periodically synchronized with an external server, with a command to read the modem time from the PLC
  • The PLC serial port works at 9600bps, 8 data bits, 1 stop bit and no parity

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

EXAMPLE of settings (file config.txt) for this scenario:

Configuration Observations
COMM_baudrate: 9600
COMM_bitsperchar: 8
COMM_autocts: off
COMM_autorts: off
COMM_stopbits: 1
COMM_parity: none
GPRS_apn: movistar.es
GPRS_login: MOVISTAR
GPRS_password: MOVISTAR
GPRS_timeout: 0
MTX_PIN: 0000
MTX_mode: server
MTX_model: MTX-4G-JAVA-IOT-STD-N
MTX_TPServer: es.pool.ntp.org
MTX_TPServer2: 2.europe.pool.ntp.org
MTX_TPProtocol: ntp
MTX_ping: 35
MTX_pingIP: 8.8.8.8
MTX_radioBand: europe
MTX_temporalClient: on
MTX_urc: off
MTX_rssiLevel: 10
MTX_ATMux: on
MTX_ATLimited: off
TCP_IP: 200.200.200.200
TCP_port: 20010
FIREWALL_enabled: off
Serial port baud rate
8 bit data
No flow control
No flow control
1 stop bit
No parity
GPRS APN by the GSM operator
GPRS Login
GPRS Password
Modem will be connected permanently
If SIM card does not have PIN, leave as 0000
Working mode is TCP server
MTX model
Time server (the MTX must synchronize the time)
Backup time server
NTP protocol used
Ping every 35 minutes without comms
IP address to ping
Not necessary if the MTX is installed in Europe
We enable the Temporary Client service
We do not need the information messages URC
We enable the MTX-65i coverage LED
Sends commands v. serial port (to check the time)
To execute any AT command
Server IP the Temporary Client will connect to
Minimum stop with no data to be a new frame
Firewall disabled

Details:

  • To read the time with an AT command, you should use the command AT+CCLK? In the following example PLC has a serial connection. To know the time, having configured the parameter “MTX_ATMux: on,” you will have to obtain information about the time by sending the following command:
<MTXTUNNEL>AT+CCLK?</MTXTUNNEL>