Tunnel – Regular reading of 3 Modbus temperature sensors and then sending to a webserver(Model MTX-Temp-RS485-IP65 of MTX accesories)

¿Buscas alguna otra cosa?

Scenario details:

  • We have 3 temperature sensors MTX-Temp-RS485-IP65, which can be found in the MTX accessories catalogue of Matrix Electronica
  • The MTX-Tunnel must periodically poll, every 10 minutes, the three temperature sensors, which use ModBus protocol. The modbus temperature record is 1. The ModBus addresses for the sensors have been previously set as 1, 2 and 3
  • The MTX-Tunnel must send, after every reading, the value of the records to a web server via HTTP GET using a JSON object, but must be able, in case of 2G/3G/4G communication failure, to store up to 100 records in its flash memory, which will be sent when communications are restored. For each meter it will send a trauma JSON, where the meter that is read is specified by an identifier (the modbus address)

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

Settings (file config.txt) for such scenario:

Configuration Observations
COMM2_baudrate: 9600
COMM2_bitsperchar: 8
COMM2_autorts: off
COMM2_autocts: off
COMM2_stopbits: 1
COMM2_parity: none
GPRS_apn: movistar.es
GPRS_login: MOVISTAR
GPRS_password: MOVISTAR
GPRS_timeout: 0
MTX_PIN: 0000
MTX_mode: none
MTX_model: MTX-4G-JAVA-IOT-STD-N
MTX_portAux: modbusmaster
MTX_TPProtocol: ntp
MTX_TPServer: ntp.roa.es
MTX_TPServer2: es.pool.ntp.org
MTX_ping: 35
MTX_pingIP: 8.8.8.8
SMS_allPhones: on
SMS_sendIP: on
SMS_ATEnabled: on
SMS_ATResponse: on
FIREWALL_enabled: off
TELNET_enabled: on
TELNET_login: user
TELNET_password: 1234
TELNET_port: 20023
LOGGER_enabled: on
LOGGER_password: ID00001
LOGGER_server: www.miservidorWeb.com/json.asp?data=
LOGGER_registerSize: 120
LOGGER_numRegistersFlash: 100
LOGGER_httpMode: getjson
MODBUS_address: 1;2;3
MODBUS_start: 1;1;1
MODBUS_numwords: 1;1;1
MODBUS_period: 600
MODBUS_readCommand: 4;4;4
MODBUS_regType: 2;2;2
Serial port baud rate
Number of bits
No flow control
No flow control
1 stop bit
No parity
APN GPRS provided by the GSM operator
GPRS Login
GPRS Password
Modem is always GPRS connected
SIM Card PIN
MTX-Tunnel mode
MTX modem model
AUXILIAR COM port used as master modbus
Time synch. protocol
Time server
Backup time server
Ping every 35 minutes without comms
IP address to ping
All phone numbers are authorized
IP sent to phone which called or “on” SM
Remote AT commands by SMS enabled
Modem response to AT command with SMS
Any IP will be able to connect to the modem
Telnet is activated
Telnet login
Telnet password
Port 20023 for Telnet
We enable the MTX Logger, to store the records
Password field can be used as ID device
Server URL, will receive JSON data
Register size
Maximum number of records in MTX
HTTP GET (JSON) mode
ModBus addresses of sensors to be read
Initial addresses of each meter
Number of records read from each meter
Frequency of readings in seconds
Sensors read with modbus command0x04
2 byte registries

Details:

  • The JSON object format that the MTX-Tunnel will send to the web server, will be similar to the following string, for sensor 1 (23.0º):
{“IMEI”:353234028103206,”P”:”ID00001”,”A”:1,”TS”:”20/04/13 08:31:44”,”ST”:1, “V1”:230} ;
  • For sensor 2 (24.5º):
{“IMEI”:353234028103206,”P”:”ID00001”,”A”:2,”TS”:”20/04/13 08:31:44”,”ST”:1, “V1”:245};
  • And for sensor 3 (22.1º):
{“IMEI”:353234028103206,”P”:”ID00001”,”A”:2,”TS”:”20/04/13 08:31:44”,”ST”:1, “V1”:221}