Tunnel – DATALOGGER. Telemetry (digital and analog inputs) sent periodically to the web server via HTTP (via JSON object) + transparent IP-RS232 gateway for remote access to the RS232 device.

¿Buscas alguna otra cosa?

Scenario details:

  • 3 digital inputs and 2 analog inputs must be sent to a web server via HTTP request using a JSON object
  • The MTX will collect digital and analog data every 10 minutes, sending it to the web server via HTTP request using a JSON object. If there is no 4G/3G/2G coverage or the web server is not available, no readings should be lost and the MTX modem must store the read records (a maximum of 1000 records) in its flash memory to try to send it when there is coverage
  • Likewise, it is necessary to be able to activate a transparent IP-RS232 gateway in parallel to the telemetries for the remote reading of a device with RS232 serial port at 9600.8, N, 1. For convenience there is a SIM with a fixed IP address in the MTX modem
  • The modem must also send its status (coverage, IP, etc.) periodically (every 10 minutes) to the web server via HTTP request

Solution: MTX-Tunnel firmware + MTX-IOT-S [4-N]

Configuration example (config.txt file) for the indicated scenario:

Configuration Observations
COMM_baudrate: 9600
COMM_bitsperchar: 8
COMM_autorts: off
COMM_autocts: off
COMM_stopbits: 1
COMM_parity: none
GPRS_apn: movistar.es
GPRS_login: MOVISTAR
GPRS_password: MOVISTAR
GPRS_timeout: 0
MTX_pin: 0000
MTX_model: 199802407
MTX_mode: server
MTX_urc: off
MTX_TPProtocol: ntp
MTX_TPServer: ntp.roa.es
MTX_TPServer2: es.pool.ntp.org
MTX_TPFormat: unix
MTX_ping: 35
MTX_pingIP: 8.8.8.8
GPIO_mode0: input
GPIO_config0: normal
GPIO_mode1: input
GPIO_config1: normal
GPIO_mode2: input
GPIO_config2: normal
ADC_mode0: voltage
ADC_config0: normal
ADC_mode1: voltage
ADC_config1: normal
TCP_port: 20010
FIREWALL_enabled: off
LOGGER_enabled: on
LOGGER_password: ID00001
LOGGER_server: www.miservidorWeb.com/json.asp?data=
LOGGER_registerSize: 300
LOGGER_numRegistersFlash: 1000
LOGGER_ioPeriod: 600
LOGGER_httpMode: getjson
DNS_enabled: on
DNS_server: www.miservidorWeb.com/json.asp?data=
DNS_password: ID00001
DNS_mode: http
DNS_httpMode: getjson
DNS_exdended: on
DNS_period: 600
Data rate of communication of serial port
Number of bits
CTS Hardware flow control deactivated
RTS Hardware flow control deactivated
1 stop bit
No parity
GPRS APN provided by GSM operator
GPRS Login
GPRS Password
Modem is permanently connected to GPRS
PIN if it has one
Device model
Gateways used Every 30 minutes
PING check
Time synch protocol
Time server
Time server backup
Unix time format
Time server backup
Unix time format
GPIO0 configured as an input for sensor, dry
GPIO0 configured as a normal output
GPIO1 configured as an output
GPIO1 MQTT configuration
GPIO2 configured as an output
GPIO2 MQTT configuration
ADC0 configured to read voltage
ADC0 configured as normal
ADC1 configured to read voltage
ADC1 configured as normal
MTX TCP port for incoming connections from any IP
Firewall
Logger status
Logger password
URL where JSON data will be sent
Size of MTX internal registry
Max. number of registries in MTX
Digital and analog inputs of the modem read, sent
Logger mode
To send status
URL to send status data
DNS password
HTTP data sending mode
HTTP GET (JSON) data sending mode
Also sending GPIOs and ADCs
Period of sending, also when data changes

Details:

  • Remember that you have the I / O descriptions of the MTX model in ANNEX 10 of this manual. Be sure to configure the microswitches appropriately to read voltage or current on the AD0 and AD1 inputs of the MTX modem

  • The MTX modem will send the value of its digital and analog inputs, the Logger data, every 600 seconds (10 minutes). In the HTTP request that the MTX modem will make to the Web server every 10 minutes, a JSON is included with the following format shown through an example
    {“IMEI”:354033091487838,”TYPE”:”IOS”,”TS”:”2020-02-08T15:35:07Z”,”P”:”ID00001”,”IO0”:1,”IO1”:0,”IO2”:0,”IO3”:0,”IO4”:0,”IO5”:0,”IO6”:0,”IO7”:0,”IO8”:1,”AD0”:1200,”AD1”:4850}
    Where:
    IMEI: indicates the IMEI of the modem
    TS: timestamp of when the data was read in the modem
    TYPE: frame type. In this case it is “IOS”
    Q: the field indicated in LOGGER_password
    IOx: digital input/output x. see Annex 10 for more information. x = 0… 8
    ADx: analog input 1 and 2 (values ​​from 0 to 50,000 mV)

    In the same way, the modem status data, DNS frames, sent every DNS_period seconds to the web server via HTTP, will have the following format:
    {“IMEI”:”354033091487838”,”TYPE”:”DNS”,”TS”:”2020-02-08T10:23:13Z”,”P”:”ID00001”,”IP”:”95.124.213.236”,”CSQ”:18,”TECH”:”4G”,”VER”:”11.00”,”AUX”:””,”MOD”:”MTX-IOT-4G-S”,”VCC”:12000}
    Where:
    IMEI: indicates the IMEI of the modem
    TS: timestamp with modem time
    TYPE: frame type. In this case it is “DNS”
    Q: the field indicated in DNS_password
    IP: current IP of the modem
    CSQ: RSSI (0… 31)
    TECH: technology (2G, 3G, 4G)
    SEE: FW MTX-Tunnel version
    AUX: auxiliary field defined in DNS_aux
    MOD: model of the modem (MTX_model field)
    VCC: MTX supply voltage (in millivolts)