Tunnel – Periodic monitoring by 2G/3G/4G of 0-10V sensor. Activating the sensor supply through a digital output connected to an external relay. Send to web server through HTTP

¿Buscas alguna otra cosa?

Scenario details:

  • We want to monitor a 0-10V sensor with a 2G/3G/4G modem
  • The modem and the sensor will be powered by solar panels, so the 0-10V sensor that will be connected to the modem should only be activated 5 seconds before the measurement (to activate an external relay that supplies the sensor and this is stabilized) and after reading, the digital output must be deactivated in order to turn off the sensor and save energy consumption
  • Every 6h (at 00:00, 06:00, 12:00 and 18:00) the MTX modem must activate the digital output (which will activate an external relay) to feed the 0-10V sensor to be measured, wait 5 seconds to stabilize the signal of the sensor, and then proceed to read it. Once the sensor is read, the data will be stored in the modem flash memory (datalogger) and sent to a web server via HTTP GET as soon as there is 2G/3G/4G coverage
  • After the 0-10V sensor reading process, the modem must deactivate its digital output (and therefore the external relay) to remove power to the 0-10V sensor and save consumption

Solution: MTX-Tunnel firmware + MTX-Java-IoT

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

Configuration Observations
GPRS_apn: movistar.es
GPRS_login: MOVISTAR
GPRS_password: MOVISTAR
GPRS_timeout: 0
MTX_pin: 0000
MTX_model: 199802407
MTX_TPProtocol: ntp
MTX_TPServer: ntp.roa.es
MTX_TPServer2: es.pool.ntp.org
MTX_mode: none
FIREWALL_enabled: off
SMS_allPhones: on
SMS_sendIP: on
SMS_ATEnabled: on
SMS_ATResponse: on
LOGGER_enabled: on
LOGGER_server: www.metering.es/json/set.asp?data=
LOGGER_password: 12345678
LOGGER_numRegistersFlash: 1500
LOGGER_registerSize: 300
LOGGER_numRegistersRam: 0
LOGGER_httpMode: getjson
TELNET_enabled: on
TELNET_login: user
TELNET_password: 1234
TELNET_port: 20023
APN GPRS provided by the GSM operator
GPRS Login
GPRS Password
Modem is always GPRS connected
SIM doesn’t have PIN
MTX model
We need a time server for the time. NTP protocol
Main NTP server
Backup NTP server
We don’t use gateways
We don’t use authorized IP addresses
Se can send SMS with commands from any phone
Modem responds with IP to missed call or SMS
We can send commands to the MTX by SMS
MTX responds with SMS to the command SMS
LOGGER activated to store readings
URL to send data
“P” field from JSON
Number of registries (readings) in flash
Size of registry in flash
We don’t store any reading in RAM
Data sending mode to server
Telnet enabled
Telnet login
Telnet password
TCP port for telnet

Details:

  • The frame sent to the server has the following JSON format:
    24/06/2019 19:00:26 — {“IMEI”:354033090132906,”TS”:”24/06/19 17:00:15”,”TYPE”:”IO S”,”P”:”12345678”,”IO1”:0,”IO2”:0,”IO3”:0,“IO4”:1,”IO5”:1,”IO6”:0,”IO7”:0,”IO8”:0,”IO9”:0, ”IO10”:0,”AD1”:469,“AD2”:1469,”CO1”:”0”,”CO2”:”0”,”CO3”:”0”}

Where:

TYPE
IMEI
P
TS
IO1
IO2
IO3
IO4
IO5
IO6
IO7
IO8
IO9
IO10
AD1
AD2
CO1
CO2
CO3
IOS frame type
internal identifier of MTX
P: user field specified in the LOGGER_password parameter
TimeStamp from when the data was collected
the value of digital input/output 1 of the modem (if available)
the value of digital input/output 2 of the modem (if available)
the value of digital input/output 3 of the modem (if available)
the value of digital input/output 4 of the modem (if available)
the value of digital input/output 5 of the modem (if available)
the value of digital input/output 6 of the modem (if available)
the value of digital input/output 7 of the modem (if available)
the value of digital input/output 8 of the modem (if available)
the value of the digital input/output 9 of the modem (if available)
the value of digital input/output 10 of the modem (if available)
the value of the analog input 1 of the modem (reading sensor 0-10V in millivolts, from 0 to 50000)
the value of the analog input 2 of the modem (if available)
the value of the pulse counter input 1 (if available)
the value of the pulse counter input 2 (if available)
the value of the pulse counter 3 input (if available)

  • This example uses the files “iologger_start.txt” and “iologger_end.txt”. These text files allow you to enter commands that will be executed automatically BEFORE the reading process of the modem I/O data and AFTER the reading. Both files must be placed in the/atscripts folder.
    The content of “iologger_start.txt” for this example is as follows:
    EXECUTE AT^MTXTUNNEL=SETIO,3,1
    PAUSE 5
    Basically, it executes an AT command that activates a digital output of the modem and waits 5 seconds.
    The content of “iologger_end.txt” for this example is the following:
    EXECUTE AT^MTXTUNNEL=SETIO,3,0
    Where the digital output is simply disabled after reading the sensor.
  • This example uses the file “schedule.txt”, whose documentation you will find in this manual, which allows you to enter the execution times of certain AT commands. The contents of the “schedule.txt” file for this application is as follows:
    1:-1;0;0;AT^MTXTUNNEL=IOEVENT
    2:-1;6;0;AT^MTXTUNNEL=IOEVENT
    3:-1;12;0;AT^MTXTUNNEL=IOEVENT
    4:-1;18;0;AT^MTXTUNNEL=IOEVENT
    In this file 4 schedules are entered. Every day of the week, at 00:00, 06:00, 12:00 and 18:00, the command AT ^ MTXTUNNEL = IOEVENT will be executed. Said AT command will launch the process of reading the modem I/O, storage in the modem datalogger and sending it to the web server.