News

Reading and remote control, sms alarm

SMS example 1. Sending an SMS alarm following a change in digital inputs

Details of the example scenario:

  • The scenario is very simple: you only need to send an SMS when a digital signal from an external circuit changes from “0” to “1”.
  • The SMS alarm must be sent for security reasons to five telephone numbers (677777771, 677777772, 677777773, 677777774, 677777775). The text must be “ALARM DETECTED”.
  • Once the alarm is produced, the digital signal can change continuously and therefore the number of SMS messages that can be sent must be limited to one per hour.

Proposed solution: MTX-65i and MTX-Tunnel. alarm-sms

Configuration files for the MTX-65i and MTX-Tunnel for the proposed solution:

This configuration is what must be inputted in the configuration file of the modem to be able to carry out the implementation described in the scenario.

 

 

 MTX_model: MTX65i The chosen MTX model is MTX65i
 MTX_mode: none A Serial GPRS Tunnel is not necessary
 MTX_urc: off We do not need the URC information messages
 ALARM_gpioEnabled: on We activate the SMS alarm service due to digital input changes
 ALARM_gpioValue: 1 The alarm will be sent when the digital input changes from “0” to “1”
 ALARM_gpioMessage1: ALARM DETECTED Text to be sent via SMS.
 ALARM_gpioPause: 3600 Stops more than one alarm being sent in an hour
 ALARM_smsNumber1: 677777771 Telephone 1 where the SMS alarm is to be sent
 ALARM_smsNumber2: 677777772 Telephone 2 where the SMS alarm is to be sent
 ALARM_smsNumber3: 677777773 Telephone 3 where the SMS alarm is to be sent
 ALARM_smsNumber4: 677777774 Telephone 4 where the SMS alarm is to be sent
 ALARM_smsNumber5: 677777775 Telephone 5 where the SMS alarm is to be sent

 

Advanced example 1. GPRS-RS232 gateway (TCP server mode) with IP sending to a private server

The following example shows how to configure MTX-Tunnel to create a transparent Serial GPRS tunnel (RS232 or RS485) that is permanently connected to GPRS. The particularity of this example is that SIM cards with a dynamic IP address will be used. MTX-Tunnel therefore must send its new IP address every time it changes to a server located in our offices. This makes it possible to always know the modem’s IP address and therefore we can connect to it to create a Serial GPRS gateway whenever required.

Details of the example scenario:

  • 100 devices (black boxes) with RS232 ports (115200, 8, N, 1 and hardware flow control) are to be monitored from a central control point via GPRS. MTX-Tunnel will be used 100 times so that the devices act as a transparent Serial GPRS tunnel.
  • Access to the RS232 devices must be available at any times, so the modem that is connected to the device’s serial port must be permanently connected to GPRS, waiting for a connection. Access to the modems must only be authorized for the control PC’s IP address (200.200.200.200) and for an IP address of the back-up ADSL connection at the central offices (200.200.200.201).
  • In order to save costs, SIM cards with a dynamic IP address will be used. Since there are a high number of modems, there is no possibility of DynDNS being used. Therefore, the MTX-Tunnel must send the IP addresses at each moment (assigned by the GSM operator) to the private DNS server at the control center. Every time MTX-Tunnel changes its IP address, it must send the new address to the control center (with IP address 200.201.202.203 and TCP port 20000) to inform it of the change. In this way, the current IP address of the modem can be known from the PC at the control center.

Proposed solution: MTX-65i and MTX-Tunnel.

Configuration files for the MTX-65i and MTX-Tunnel for the proposed solution:

This configuration is what must be inputted in the configuration file of the modem to be able to carry out the implementation described in the scenario.

Los parámetros a destacar del ejemplo anterior son los encabezados por el prefijo “DNS_”.  Estos parámetros son los encargados de hacer que cada vez que el MTXTunnel cambie de dirección IP se envíe la dirección IP a un servidor. Para ello esablecemos el parámetro “DNS_enabled” a “on”.   La trama con la dirección IP se enviará mediante un socket TCP/IP a una IP (DNS_server) y puerto TCP (DNS_port), de ahí que el parámetro “DNS_mode” valga “socket”.  Podría usarse un servidor WEB para ello con “http”, pero eso sería otro ejemplo.

Remote reading

Example 1. Sending, via GPRS, periodic telemetry (analog and digital inputs) to WebServer via HTTP GET

Details of the example scenario:

  • The intention is to monitor the water level in a tank. For this, an analog input from a GPRS modem will be used. The modem is permanently connected to GPRS and using a SIM card with a dynamic IP address.
  • The modem must take a measurement every 5 minutes and send it to a Web server by GPRS via HTTP GET so that a LOG file is created with the daily usage statistics.
  • Likewise, access to the modem’s internal WebServer must be available to check, in real time, the status of the device. From the internal WebServer, there must be access to a relay that allows for the flow of water into the tank. This access will not use Firewall (any IP address can be used), but it will be protected using a username and password.

Proposed solution using MTX-65-IND and MTX-Tunnel. telemetrias-gprs-http

Configuration files for the MTX-65IND and MTX-Tunnel for the proposed solution:

This configuration is what must be inputted in the configuration file of the modem to be able to carry out the implementation described in the scenario.

 

 GPRS_apn: movistar.es APN GPRS provided by the GSM operator
 GPRS_login: MOVISTAR Login GPRS provided by the GSM operator
 GPRS_password: MOVISTAR GPRS password provided by the GSM operator
 GPRS_timeout: 0 The modem will be permanently connected
 
MTX_PIN: 0000 If the SIM card does not have a PIN number, use 0000
 MTX_model: MTX65IND The chosen MTX model is MTX65IND
 MTX_mode: none No configuration is used (we do not use a Serial GPRS gateway)
 MTX_urc: off We do not need the URC information messages
 
TCP_port:20010  TCP port to establish the Serial GPRS Gateway
 Firewall_enabled: off Firewall deactivated
 
WAKEUP_gpioEnabled: on GPRS activated by a digital input
 WAKEUP_value: 0 It will be activated when the digital entry is “0”
 
 DNS_enabled: on Activated IP sending to DNS
 DNS_mode: http It will use HTTP GET to send the data
 DNS_password: 12345678 Password for more security
 DNS_server: www.miweb-com:8080/datosIP.asp URL of the server to which the modem’s IP and telemetry will be sent
 DNS_extended: on We want the MTX-Tunnel to send the status of the GPIOs and ADCs
 DNS_period: 300 We want to send the values every 300 seconds (5 minutes)

 

Example 2. Sending periodic telemetry (analog and digital inputs) via JSON object to a WebServer.

Details of the example scenario:

  • Six digital inputs and two analog inputs must be sent to a WebServer via a JSON object.
  • MTX will collect the analog and digital data every 10 minutes, sending them to a WebServer via a JSON object. If there is no GPRS coverage, or the WebServer is unavailable, MTX must store the data in memory (up to 1000 records).
  • Also, it must be possible to activate a GPRS-RS232 gateway alongside the telemetry so that a device can be read remotely. A SIM card with fixed IP address is provided for ease.

Proposed solution using MTX-65IND and MTX-Tunnel.

 

telemetry-gprs-json

Configuration files for the MTX-65IND and MTX-Tunnel for the proposed solution:

This configuration is what must be inputted in the configuration file of the modem to be able to carry out the implementation described in the scenario.

Details:

  1. The JSON object that is sent via GPRS to the server will have the following format:

{“IMEI”:353234028103206,“P”:“ID00001″,“TS”:“11/11/12 08:31:44″,
“IO1″:1,“IO2″:0,“IO3″:1,“IO4″:1,“IO5”:0,“IO6”:0,“IO7”:1,“IO8”:0,“IO9”:1,“IO10”:0, “AD1”:1250, “AD2”:1700}

 

 COMM_baudrate: 9600 Speed of the serial communication port with the PLC
 COMM_bitsperchar: 8 Number of data bits
 COMM_autocts: on CTS hardware control flow activated
 COMM_autorts: on RTS hardware control flow activated
 COMM_stopbits: 1 Configure 1 stop bit
 COMM_parity: none No parity bit
 
 GPRS_apn: movistar.es APN GPRS provided by the GSM operator
 GPRS_login: MOVISTAR Login GPRS provided by the GSM operator
 GPRS_password: MOVISTAR GPRS password provided by the GSM operator
 GPRS_timeout: 0 The modem will be permanently connected
 
MTX_PIN: 0000 If the SIM card does not have a PIN number, use 0000
 MTX_model: MTX65IND The chosen MTX model is MTX65IND
 MTX_mode: none No configuration is used (we do not use a Serial GPRS gateway)
 MTX_urc: off We do not need the URC information messages
 
TCP_port:20010  TCP port to establish the Serial GPRS Gateway
 Firewall_enabled: off Firewall deactivated
 
 LOGGER_enabled: on We activate the MTX Logger to store the readings
 LOGGER_password: ID00001 Field that allows us to know the origins.
 LOGGER_server: www.miservidorWeb.com/json.asp?data= URL where the JSON object with the data will be sent to
 LOGGER_registerSize: 300 The size of MTX’s internal register
 LOGGER_numRegistersFlash: 1000 The maximum number of records allowed in the MTX
 LOGGER_ioPeriod: 600 Every 10 minutes the modem’s analog and digital inputs will be read and sent.