Suchen Sie etwas anderes?
In the previous section about DynDNS we explained how and why we use it when we have a few remote modem SIMs that have dynamic IP addresses. If you plan to use and control a large number of devices, this is not practical. Also, DynDNS requires you to have an external server, which means that any possible drops on the server are harder to control.
The following parameters are useful for when you are required to use your own server to collect the changes detected by MTX-Tunnel in the IP addresses.
In other words, these parameters will make sure MTX-Tunnel informs your server of any changes in its IP address, giving you complete control of the system at all times.
Table of Contents
DNS_enabled
Description: enable the DNS service using your own server. Every time the modem starts a data connection or changes the IP address, it is sent to your configured server.
Possible values:
- on, off
- Default value: off
Additional notes:
- Only use the DNS feature when your SIM is dynamic IP provisioned. It makes no sense to use a dynamic IP provisioned SIM if your network operator has fixed IP addressing
- DNS must be used in incoming connection requests with MTX-Tunnel services using socket servers like:
• GPRS-Serial RS232 server mode tunnel
• WebServer
• Telnet
• If you are going to use MTX-Tunnel client connection services, meaning that the MTXTunnel starts with a connection from a well known IP address, the DNS service is not needed and must be disabled (value “off”)
DNS_mode
Description: The MTXTunnel mode, in which MTX-Tunnel sends the change in IP address to a server. We can use a TCP socket or HTTP protocol for web server.
Possible values:
- socket, socketjson, http, mqtt
- Default value: socket
Additional notes:
- If you are going to write your own code/application, use the “socket” option
- If you already have a web server and the code is written in ASP or PHP, we recommend that you use the “http” option
- If you are going to send data from sensors to a MQTT broker, it will be easier to use the “mqtt” method. From the MTX-Tunnel 9.25 on it is possible to configure the “mqtt” mode. If you select this method don’t forget to configure the MQTT parameters and the DNS_mqttTopic parameter
DNS_password
Description: You can secure this service by setting up a password. MTX-Tunnel will send the DNS_password in any new GPRS connection or if there are any IP address changes and your server will have to check the password.
Possible values:
- A text string of up to 64 characters
- Default value: none
Additional notes:
- DNS_password is sent using either “socket” or “http” transmission mode
DNS_server
Description:
- Socket mode: (DNS_mode: socket) The value is the DNS or IP server address where the new IP address is to be sent..
- HTTP mode: (DNS_mode: http) The value is the URL (domain + web page) of the WebServer to which you will pass on information about the new IP address.
Possible values:
- Text string of less than 255 characters
- Default value: none
Additional notes:
- In HTTP mode “DNS_mode: http”, DNS_server URL does not include “http://” string. DNS example URL: www.mtxtunnel.com/dns.asp
- In Socket mode, MTX-Tunnel sends the following string to the server:
#IMEI#DNS_password#IPPublica#
- In HTTP mode, MTX-Tunnel sends the following string to server:
URL?IMEI=<suIMEI>&PASS=<DNS_password>&IP=<IP Public>
- If you program web pages in ASP, you can collect the information using this method as an example:
<% IMEI=Request.QueryString(“IMEI”) Password=Request.QueryString(“PASS”) IP=Request.QueryString(“IP”) %>
DNS_port
Description: TCP DNS server port being used in DNS socket mode (DNS_mode: socket).
Possible values:
- 1… 65535
- Default value: 20011
Additional notes:
- Only use this parameter if “socket”mode is used. If you use “http” mode, the standard port is 80. However if you use another one, you need to include it in the DNS_server parameter
- E.g. if you are going to use port 20011, DNS_server value parameter is: www.mtxtunnel.com:20011/dns.asp
DNS_extended
Description: if enabled, and only if the DNS service is enabled too (DNS_enabled: on), MTX-Tunnel will send the password and IP address information together with the IMEI and more information like the GPIO status. This is useful in telemetry applications. To send additional information, DNS_extended must be configured to “on”.
Possible values:
- on, off
- Default value: off
Additional notes:
- DNS_extended “on”, DNS_mode set as “socket”, the information sent to the server is:
#IMEI#DNS_password#IPPublica#gpio1#gpio2#gpio3#gpio4#gpio5 #gpio6#gpio7#gpio8#gpio9#gpio10#ADC1#ADC2#<gpsLocation>#
The additional extended information is shown.
gpioX is input/output X value (0 -1)
ADCX is analog to digital converter X value.
In the MTX terminal modems with GPS receiver, the GPS location information is also added.
- DNS_extended “on”, DNS_mode set as “http”, the information sent to the server is:
URL?IMEI=<suIMEI>&PASS=<DNS_password>&IP=<IP Public> &GPIO1=X &GPIO2=X &GPIO3=X &GPIO4=X &GPIO5=X &GPIO6=X &GPIO7=X &GPIO8=X &GPIO9=X &GPIO10=X &ADC1=X&ADC2=X&GPS=<gpsLocation>
The additional extended information is shown.
gpioX is input/output X value (0 -1)
ADCX is analog to digital converter X value.
In the MTX terminal modems with GPS receiver, the GPS location information is also added.
DNS_gpios
Description: When this parameter is enabled it can send DNS information (which can include GPIO and ADC values if DNS_extended = “on”) when there is a change in a digital input.
Possible values:
- on, off
- Default value: off
Additional notes:
- MTX-Tunnel sends just one data DNS information string if there has been one or several changes in digital inputs
- Parameter available from version MTX-Tunnel v5.3
DNS_adc1, DNS_adc2
Description: This parameter, if enabled, can send DNS information (which can include GPIO and ADC values if DNS_extended = “on”) only when the analog input is above or below trigger value.
Possible values:
- Possible values: 0, 250 … 47750
- Default value: 0
Additional notes:
- 0 value disables this feature and a DNS string will be not sent
- DNS_adcX >=250 sets the trigger analog value above or below +-250mV, if it exceeds this value a DNS frame string will be sent
- DNS_adc1: 1200 means that when DNS_adc1 > 1200mV + 250mV, the DNS text string will be sent, as well as when DNS_adc2 < 1200mV – 250mV
- Parameter available from MTX-Tunnel v5.3
DNS_period
Description: A data string with the DNS information is sent whenever the MTX-Tunnel IP address changes, but you can also define it to send the IP address periodically. This is useful for a more secure indication of IP address changes and it establishes timing periods by sending telemetric data if the DNS_extended parameter is enabled (value “on”).
- 0, 30… 2592000
- Default value: 0
Additional notes:
- Value=0 means DNS information is not sent periodically
- Value of time is in seconds
DNS_httpMode
Description: This parameter allows you to choose the type of communication that will be used when DNS_mode is set to “http” mode. You can choose between “get” and “json”
Possible values:
- get, getjson, postjson
- Default value: get
Additional notes:
- The parameter is available from MTX-Tunnel version 8.10 onwards. Before this version the only possible option was “get”. It is strongly recommended not to use the option “get”, and
use the option ‘’getjson” or “postjson”. - EXAMPLE of data transmission in “get” mode where DNS_extended parameter has the value “off”:
http://www.mydomain.com?TYPE=DNS&IMEI=357973041110401&PASS=ID000001&IP=95.126.113.202&CSQ=24&VER=9.12&AUX=0&MOD=201 - EXAMPLE of data transmission in “getjson” mode where DNS_extended parameter has the value “off”:
{“TYPE”,”DNS”,”IMEI”: 357973041110401,“P”:”ID001”,”IP”:”95.126.113.202”, ”CSQ”:24,”VER”:”9.12”, “AUX”:”0”,”MOD”:201}
Where:
TYPE: DNS frame type
IMEI: IMEI of the modem (unique device identification)
P: user’s field in DNS_password parameter
IP: MTX-Tunnel IP
CSQ: GSM coverage of MTX (0… 31)
VER: MTX-Tunnel firmware version
AUX: Reserved for configuration version control
MOD: MTX terminal model - EXAMPLE of data transmission in “getjson” mode where DNS_extended parameter has the value “on”:
{“TYPE”,”DNS”,”IMEI”: 357973041110401, “P”:”ID001”,”IP”:”95.126.113.202”, ”CSQ”:24,”VER”:”9.12”, “AUX”:”0”,”MOD”:201,”IO1”:0,”IO2”:0,”IO3”:0,”IO4”:0,”IO5”:0, ”IO6”:0,“IO7”:0,”IO8”:0,”IO9”:0,”IO10”:0,”AD1”:100,”AD2”:2000,”CO1”:”0”,”CO2”:”0”, ”CID”:”214;07;0322;4E8F”}”}
Where:
TYPE: DNS frame type
IMEI: IMEI of the modem (unique device identification)
P: user’s field in DNS_password parameter
IP: MTX-Tunnel IP
CSQ: GSM coverage of MTX (0 … 31)
VER: MTX-Tunnel firmware version
AUX: Reserved for configuration version control
MOD: MTX terminal model
IO1: Value of digital input/output 1 of the modem (if it is available)
IO2: Value of digital input/output 2 of the modem (if it is available)
IO3: Value of digital input/output 3 of the modem (if it is available)
IO4: Value of digital input/output 4 of the modem (if it is available)
IO5: Value of digital input/output 5 of the modem (if it is available)
IO6: Value of digital input/output 6 of the modem (if it is available)
IO7: Value of digital input/output 7 of the modem (if it is available)
IO8: Value of digital input/output 8 of the modem (if it is available)
IO9: Value of digital input/output 9 of the modem (if it is available)
IO10: Value of digital input/output 10 of the modem (if it is available)
AD1: Value of analog input 1 of the modem (if it is available)
AD2: Value of analog input 2 of the modem (if it is available)
CO1: Value of pulse counter input 1 (if it is available)
CO2: Value of pulse counter input 2 (if it is available)
CID: GSM cell information (for GSM localization) - EXAMPLE of data transfer in “postjson” mode where DNS_extended parameter has the value “off”. When using “postjson” mode data is sent to JSON as follows:
{“IMEI”:”357042060366409”,”TYPE”:”DNS”,“P”:”ID-12345678”, ”IP”:”95.126.113.202”,”CSQ”:24,”VER”:”9.12”,“AUX”:”4”,”MOD”:”201”,VCC:12100}
Where:
TYPE: DNS frame type
IMEI: MTX internal indentification
P: user’s field in DNS_password parameter
IP: MTX-Tunnel IP
CSQ: GSM coverage of MTX (0 … 31)
VER: MTX-Tunnel firmware version
AUX: Reserved for configuration version control
MOD: MTX terminal model
VCC: MTX supply voltage (in millivolts) - EXAMPLE of data transmission in “postjson” mode where DNS_extended parameter has the value “on”. When using “postjson” mode data is sent to JSON as follows:
{“IMEI”:”357042060366409”,”TYPE”:”DNS”,“P”:”ID-12345678”, ”IP”:”95.126.113.202”,”CSQ”:24,”VER”:”9.12”,“AUX”:”4”,”MOD”:”201”,VCC:12100,”IO1”:0,”IO2”:0, ”IO3”:0,”IO4”:0,”IO5”:0,”IO6”:0,”IO7”:0,“IO8”:0,”IO9”:0,”IO10”:0,”AD1”:0,”AD2”:0, ”CO1”:”0”,”CO2”:”0”,”CID”:”214;07;0322;4E8F”}
Where:
TYPE: DNS frame type
IMEI: MTX internal indentification
P: user’s field in DNS_password parameter
IP: MTX-Tunnel IP
CSQ: GSM coverage of MTX (0 … 31)
VER: MTX-Tunnel firmware version
AUX: Reserved for configuration version control
MOD: MTX terminal model
VCC: MTX supply voltage (in millivolts)
IO1: Value of digital input/output 1 of the modem (if it is available)
IO2: Value of digital input/output 2 of the modem (if it is available)
IO3: Value of digital input/output 3 of the modem (if it is available)
IO4: Value of digital input/output 4 of the modem (if it is available)
IO5: Value of digital input/output 5 of the modem (if it is available)
IO6: Value of digital input/output 6 of the modem (if it is available)
IO7: Value of digital input/output 7 of the modem (if it is available)
IO8: Value of digital input/output 8 of the modem (if it is available)
IO9: Value of digital input/output 9 of the modem (if it is available)
IO10: Value of digital input/output 10 of the modem (if it is available)
AD1: Value of analog input 1 of the modem (if it is available)
AD2: Value of analog input 2 of the modem (if it is available)
CO1: Value of pulse counter input 1 (if it is available)
CO2: Value of pulse counter input 2 (if it is available)
CID: GSM cell information (for GSM localization)
DNS_serverLogin
Description: This parameter allows you to establish a login (username) that must be used by MTX-Tunnel to send data to a Web server containing a Login/Password authentication system.
Possible values:
- Text string of up to 64 characters
- Default value: none
Additional notes:
- If your web server does not use a simple authentication system consisting of a Login and Password, this parameter is not necessary. It is necessary, however, in those web servers that
use authentication systems. - This parameter is available in versions of MTX-Tunnel from v8.10.
DNS_serverPassword
Description: This parameter allows you to establish a password that must be used by MTX-Tunnel to send data to a Web server containing a Login/Password authentication system.
Possible values:
- Text string of up to 64 characters
- Default value: none
Additional notes:
- If your web server does not use a simple authentication system consisting of a Login and Password, this parameter is not necessary. It is necessary, however, in those web servers that use authentication systems.
DNS_https
Description: Allows to state whether information is sent via http or via https in encrypted format.
Possible values:
- on, off
- Default value: off
Additional notes:
- Keep in mind that if you want to activate this option, you will need a web server with SSL support
DNS_header1, DNS_header2, DNS_header3
Description: Allows to use personalized HTTP headers.Very useful for communication between MTX-Tunnel and thirdparty web platforms (like THINGWORKS).
Possible values:
- ASCII string up to 64 charaters
- Default value: none
Additional notes:
- The headers have the following format: nameHeader;valueHeader . That is to say, fields are separated by ; (semicolon)
- You will find them necessary if you want your MTX-Tunnel to communicate with some generic platforms. For example, to communicate with Thingworks platform you will have to specify something similar to:
DNS_header1: Content-Type;application/json
DNS _header2: Accept;application/json
DNS _header3: appKey;194f5476-7346-4638-ac30-bbca28595be1
DNS_mqttTopic
Description: Configure the topic that MTX-Tunnel will use to publish all data in the DNS_ service.
Possible values:
- ASCII string up to 64 charaters
- Default value: none
Additional notes:
- In the same way as the MQTT_attopicX parameters, you can use the [IMEI] tag in the parameter and the MTX-Tunnel will internally replace that tag with the appropriate value. For example, if your modem has the IMEI 354740050182909 you could specify in the config.txt configuration file the value:
DNS_mqttTopic: [IMEI]/DNS
And the MTX-Tunnel would send the DNS service data using the topic:
354740050182909/DNS - Data are sent to the MQTT topic in JSON format. Check the parameter DNS_httpMode to find information about sent JSON