Tunnel – DATALOGGER. Telemetry (digital and analog inputs) sent periodically to broker MQTT (via JSON object) + transparent IP-RS232 gateway for remote access to 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 the digital and analog data every 10 minutes, sending it to an MQTT broker 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 MQTT broker

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

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

Configuración Observaciones

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
MQTT_server: tcp://broker.mqttdashboard.com:1883
MQTT_id: [IMEI]
MQTT_login:
MQTT_password:
MQTT_attopic1: [IMEI]/AT
MQTT_atrtopic: [IMEI]/ATR
MQTT_qos: 1
MQTT_keepalive: 60
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_registerSize: 300
LOGGER_numRegistersFlash: 1000
LOGGER_mode: mqtt
LOGGER_mqttTopic: /LOGGER
LOGGER_ioPeriod: 600
DNS_enabled: on
DNS_mode: mqtt
DNS_exdended: on
DNS_period: 600
DNS_mqttTopic: /DNS

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
MQTT service
MQTT broker, format protocol://url:port
Device ID in broker
Username
Password
MTX topic to recieve AT commands
Topic where MTX sends responses to AT commands
QoS established
Keepalive
GPIO0 configured as input for dry contact sensor
GPIO0 normal
GPIO1 configured as input for dry contact sensor
GPIO1 normal
GPIO2 configured as input for dry contact sensor
GPIO2 normal
ADC0 configured to read voltage
ADC0 normal
ADC1 configured to read voltage
ADC1 normal
TCP port to receive IP connections
Firewall status
Logger status to store readings
Size of internal MTX registry
Max. number of registries
Logger sending mode
Topic to send modem data
Period to read send digital/analog inputs
DNS to send status
Sending mode
Also sending GPIOs and ADCs
Period of sending, also when data changes
Topic to send status data

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 MQTT sending that the MTX modem will carry out the topic configu
    {“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)