Changes

2,004 bytes added ,  11:30, 12 December 2017
Line 225: Line 225:  
==Setting router values==
 
==Setting router values==
   −
The Modbus daemon also supports the setting of some system parameters. To accomplish this task the '''modbus write''' command is used. System related parameters and how to use them are described below. The register number specifies from which register to start writing the 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 the number of SIM card for which to set the APN. This byte should be set to 1 (in order to change APN for SIM card number 1) or to 2 (in order to change APN for SIM card number 2).  
+
The Modbus daemon also supports the setting of some system parameters. To accomplish this task the '''modbus write''' command is used. System related parameters and how to use them are described below. The register number specifies from which register to start writing the required values. All commands, except “Change APN”, accepts only one input parameter (more on changing APN can be found below).
    
{| class="wikitable"
 
{| class="wikitable"
Line 270: Line 270:  
|-
 
|-
 
|}
 
|}
 +
 +
As you can see most of the values are '''0''' and '''1''', 0 meaning OFF and 1 meaning ON. For example, if you want to turn '''Wi-Fi OFF''', this command should be used:
 +
 +
$ modbus write -w -p 12345 192.168.1.1 %MW210 0
 +
 +
If you want to turn '''Wi-Fi ON''', use this command instead:
 +
 +
$ modbus write -w -p 12345 192.168.1.1 %MW210 1
 +
 +
As you can see, the only difference is the digit at the end - '''0 for OFF''', '''1 for ON'''. The same is true for all other parameters that accept only two input values.
 +
 +
In the case of '''SIM switch''' there are three values - '''0''', '''1''' and '''2'''. 1 makes the first SIM card slot in use, 2 makes the second SIM card slot in use and 0 initiates a switc from the SIM card in use to the opposite SIM card. For example, to initiate a switch to the second SIM card the command should look like this:
 +
 +
$ modbus write -w -p 12345 192.168.1.1 %MW212 2
 +
 +
The '''reboot''' function only takes one value - '''1'''. It simply reboots the router. To initiate a reboot, use this command:
 +
 +
$ modbus write -w -p 12345 192.168.1.1 %MW220 1
 +
 +
===APN===
 +
 +
APN is the only parameter that can accept more than one input value. For the APN parameter the number of input registers may vary. The very first byte of an APN command denotes the number of SIM card for which to set the APN. This byte should be set to 1 (in order to change APN for SIM card number 1) or to 2 (in order to change APN for SIM card number 2). The rest of the string should be entered one symbol at a time. Each symbol should be converted from ASCII (text) to decimal.
 +
 +
As an example lets try to change the router's first SIM card's APN to '''gprs.fix-ip.omnitel1.net''':
 +
 +
$ modbus write -w -D -p 12345 192.168.1.1 %MW213 <span style="color:blue">'''1'''</span> <span style="color:green">'''103 112 114 115 46 102 105 120 45 105 112 46 111 109 110 105 116 101 108 49 46 110 101 116'''</span>
 +
 +
The value of the first byte is highlighted in <span style="color:blue">'''blue'''</span> and, in this case, denotes that the APN value should be changed for the first SIM card. The value of APN is highlighted in<span style="color:green">'''green'''</span>. Use an ASCII to Decimal online converter to convert individual letters to Decimal code.