138
9.16
Modbus TCP interface
Modbus TCP interface allows the user to set or get some parameters from the router (the parameters, which can
be set or get will be described later), like module temperature or signal strength. In other words, Modbus TCP is another
manner to control router behavior. To use Modbus TCP capabilities it must be turned on by navigating to Services-
Modbus. After “Save” button is pressed, the Modbus daemon will be launched on selected port of the system. Modbus
daemon performs as slave, that means, it accepts connection from the master (client) and sends out a response or sets
some system related parameter. By the default Modbus will only accept connections through LAN interface. In order to
accept connections through WAN interface also, Allow Remote Access must be checked.
To obtain some parameter from the system, the read holding registers command is used. The register number
and corresponding system values are described below. Each register contains 2 bytes. For simplification the number of
registers for storing numbers is 2, while for storing text information the number of registers is 16.
Required value
Representation
Register number
Number of registers
System uptime
32 bit unsigned integer
1
2
GSM signal strength (dBm)
32 bit integer
2
2
System temperature in 0.1 degrees
Celcium
32 bit integer
3
2
System hostname
Text
4
16
GSM operator name
Text
5
16
Router serial number
Text
6
16
Router MAC address
Text
7
16
Router name
Text
8
16
Current SIM card
Text
9
16
Network registration
Text
10
16
Network type
Text
11
16
Digital input 1
32 bit integer
12
2
Digital input 2
32 bit integer
13
2
Current WAN IP address
32 bit unsigned integer
14
2
Analog input
32 bit integer
15
2
The Modbus daemon also supports setting of some system parameters. For this task write holding register
command is used. System related parameters and how to use them are described below. The register number refers to
the register number where to start write required values. All commands, except “Change APN” accepts only one input
parameter. For the APN the number of input registers may vary. The very first byte of APN command denotes a number