Changes

m
Line 1: Line 1: −
Router monitoring via Modbus TCP Linux guide applies to RUT950 and RUT955 routers.[[File:Configuration examples modbus logo.png|right|300px]]
+
Router monitoring via Modbus TCP Linux guide applies to {{{name}}} routers.[[File:Configuration examples modbus logo.png|right|300px]]
    
==Introduction==
 
==Introduction==
Line 12: Line 12:  
Modbus enables communication among many devices connected to the same network, for example, a system that measures temperature and humidity and communicates the results to a computer. Modbus is often used to connect a supervisory computer with a remote terminal unit (RTU) in supervisory control and data acquisition (SCADA) systems. Many of the data types are named from its use in driving relays: a single-bit physical output is called a coil, and a single-bit physical input is called a discrete input or a contact.
 
Modbus enables communication among many devices connected to the same network, for example, a system that measures temperature and humidity and communicates the results to a computer. Modbus is often used to connect a supervisory computer with a remote terminal unit (RTU) in supervisory control and data acquisition (SCADA) systems. Many of the data types are named from its use in driving relays: a single-bit physical output is called a coil, and a single-bit physical input is called a discrete input or a contact.
   −
This article provides a guide on how to use Modbus TCP to monitor {{{name}}} routers with a PC using a Linux Operating System. However, the same principles apply to RUT230, RUT240 and RUT950 routers, but the holding register information will differ. You can find this information in the links below:
+
This article provides a guide on how to use Modbus TCP to monitor {{{name}}} routers with a PC using a Linux Operating System.  
 
  −
*'''[[RUT230 Monitoring via Modbus]]'''
  −
*'''[[RUT240 Monitoring via Modbus]]'''
  −
*'''[[RUT950 Monitoring via Modbus]]'''
  −
*'''[[RUT955 Monitoring via Modbus]]'''
   
==Configuring the router==
 
==Configuring the router==
   Line 39: Line 34:  
Router parameters are held within '''registers'''. Each register contains 2 bytes of information. For simplification the number of registers for storing numerical values is 2, while the number of registers for storing text information is 16. The register addresses and corresponding system values are described in the table below:
 
Router parameters are held within '''registers'''. Each register contains 2 bytes of information. For simplification the number of registers for storing numerical values is 2, while the number of registers for storing text information is 16. The register addresses and corresponding system values are described in the table below:
   −
<table class="nd-othertables">
+
{{#ifeq:{{{series}}}| RUT9XX|
    <tr>
+
{{Template:Networking_{{lc:{{{name}}}}}_manual_modbus_modbus_tcp_get_parameters_table}}
        <th width="546">required value</th>
  −
      <th width="200">register address</th>
  −
        <th width="200">register number</th>
  −
      <th width="200">number of registers</th>
  −
      <th width="200">representation</th>
  −
    </tr>
  −
    <tr>
  −
      <td>System uptime</td>
  −
      <td>1</td>
  −
        <td>2</td>
  −
      <td>2</td>
  −
        <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Mobile signal strength ([[RSSI]] in dBm)</td>
  −
      <td>3</td>
  −
        <td>4</td> 
  −
      <td>2</td>
  −
        <td>32 bit integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td>System temperature (in 0.1 °C)</td>
  −
      <td>5</td>
  −
        <td>6</td>
  −
      <td>2</td>
  −
        <td>32 bit integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td>System hostname</td>
  −
      <td>7</td>
  −
        <td>8</td>
  −
      <td>16</td>
  −
        <td>Text</td>
  −
    </tr>
  −
    <tr>
  −
      <td>GSM operator name</td>
  −
      <td>23</td>
  −
        <td>24</td>
  −
      <td>16</td>
  −
        <td>Text</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Router serial number</td>
  −
      <td>39</td>
  −
        <td>40</td>
  −
      <td>16</td>
  −
        <td>Text</td>
  −
    </tr>
  −
    <tr>
  −
      <td>LAN MAC address</td>
  −
      <td>55</td>
  −
        <td>56</td>
  −
      <td>16</td>
  −
        <td>Text</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Router name</td>
  −
      <td>71</td>
  −
        <td>72</td>
  −
      <td>16</td>
  −
        <td>Text</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Currently active SIM card slot</td>
  −
      <td>87</td>
  −
        <td>88</td>
  −
      <td>16</td>
  −
        <td>Text</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Network registration info</td>
  −
      <td>103</td>
  −
        <td>104</td>
  −
      <td>16</td>
  −
        <td>Text</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Network type</td>
  −
      <td>119</td>
  −
        <td>120</td>
  −
      <td>16</td>
  −
        <td>Text</td>
  −
    </tr>
  −
{{#ifeq:{{{name}}}| RUT955|
  −
    <tr>
  −
      <td>Digital input (DIN1) state</td>
  −
      <td>135</td>
  −
        <td>136</td>
  −
      <td>2</td>
  −
        <td>32 bit integer</td>
  −
    </tr>
  −
 
  −
    <tr>
  −
      <td>Digital galvanically isolated input (DIN2) state</td>
  −
      <td>137</td>
  −
        <td>138</td>
  −
      <td>2</td>
  −
        <td>32 bit integer</td>
  −
    </tr>
  −
}}
  −
{{#ifeq:{{{series}}}| RUT2XX|
  −
    <tr>
  −
      <td>Mobile data received today (SIM1)</td>
  −
      <td>135</td>
  −
        <td>136</td>
  −
      <td>2</td>
  −
        <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Mobile data sent today (SIM1)</td>
  −
      <td>136</td>
  −
        <td>137</td>
  −
      <td>2</td>
  −
        <td>32 bit unsigned integer</td>
  −
    </tr>
   
|
 
|
 
+
{{Template:Networking_rut2xx_manual_modbus_modbus_tcp_get_parameters_table}}
 
}}
 
}}
    <tr>
  −
      <td>Current WAN IP address</td>
  −
      <td>139</td>
  −
        <td>140</td>
  −
      <td>2</td>
  −
        <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    </tr>
  −
{{#ifeq:{{{name}}}| RUT955|
  −
    <tr>
  −
      <td>Analog input value</td>
  −
      <td>141</td>
  −
        <td>142</td> 
  −
      <td>2</td>
  −
        <td>32 bit integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td>GPS latitude coordinate</td>
  −
      <td>143</td>
  −
        <td>144</td>
  −
      <td>2</td>
  −
        <td>32 bit float</td>
  −
    </tr>
  −
    <tr>
  −
      <td>GPS longitude coordinate</td>
  −
      <td>145</td>
  −
        <td>146</td>
  −
      <td>2</td>
  −
        <td>32 bit float</td>
  −
    </tr>
  −
    <tr>
  −
      <td>GPS fix time</td>
  −
      <td>147</td>
  −
        <td>148</td>
  −
      <td>16</td>
  −
        <td>Text (Unix timestamp×1000)</td>
  −
    </tr>
  −
    <tr>
  −
      <td>GPS date and time</td>
  −
      <td>163</td>
  −
        <td>164</td>
  −
      <td>16</td>
  −
        <td>Text (DDMMYYhhmmss)</td>
  −
    </tr>
  −
    <tr>
  −
      <td>GPS speed</td>
  −
      <td>179</td>
  −
        <td>180</td>
  −
      <td>2</td>
  −
        <td>32 bit integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td>GPS satellite count</td>
  −
      <td>181</td>
  −
        <td>182</td>
  −
      <td>2</td>
  −
        <td>32 bit integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td>GPS accuracy</td>
  −
      <td>183</td>
  −
        <td>184</td>
  −
      <td>2</td>
  −
        <td>32 bit float</td>
  −
    </tr>
  −
}}
  −
{{#ifeq:{{{series}}}| RUT2XX|
  −
    <tr>
  −
      <td>Mobile data received this week</td>
  −
      <td>141</td>
  −
        <td>142</td>
  −
      <td>2</td>
  −
        <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Mobile data sent this week</td>
  −
      <td>142</td>
  −
        <td>143</td>
  −
      <td>2</td>
  −
        <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Mobile data received this month</td>
  −
      <td>145</td>
  −
        <td>146</td>
  −
      <td>2</td>
  −
        <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Mobile data sent this month</td>
  −
      <td>147</td>
  −
        <td>148</td>
  −
      <td>2</td>
  −
        <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Mobile data received last 24h</td>
  −
      <td>149</td>
  −
        <td>150</td>
  −
      <td>2</td>
  −
        <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Mobile data sent last 24h</td>
  −
      <td>151</td>
  −
        <td>152</td>
  −
      <td>2</td>
  −
        <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Mobile data received last week</td>
  −
      <td>153</td>
  −
        <td>154</td>
  −
      <td>2</td>
  −
        <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Mobile data sent last week</td>
  −
      <td>154</td>
  −
        <td>155</td>
  −
      <td>2</td>
  −
        <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Mobile data received last month</td>
  −
      <td>157</td>
  −
        <td>158</td>
  −
      <td>2</td>
  −
        <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Mobile data sent last month</td>
  −
      <td>159</td>
  −
        <td>160</td>
  −
      <td>2</td>
  −
        <td>32 bit unsigned integer</td>
  −
    </tr>
  −
|
  −
<tr>
  −
      <td>Mobile data received today (SIM1)</td>
  −
      <td>185</td>
  −
      <td>186</td>
  −
      <td>2</td>
  −
      <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Mobile data sent today (SIM1)</td>
  −
      <td>187</td>
  −
      <td>188</td>
  −
      <td>2</td>
  −
      <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Mobile data received this week  (SIM1)</td>
  −
      <td>189</td>
  −
      <td>190</td>
  −
      <td>2</td>
  −
      <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Mobile data sent this week  (SIM1)</td>
  −
      <td>191</td>
  −
      <td>192</td>
  −
      <td>2</td>
  −
      <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Mobile data received this month  (SIM1)</td>
  −
      <td>193</td>
  −
      <td>194</td>
  −
      <td>2</td>
  −
      <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Mobile data sent this month  (SIM1)</td>
  −
      <td>195</td>
  −
      <td>196</td>
  −
      <td>2</td>
  −
      <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
        <td>Mobile data received last 24h  (SIM1)</td>
  −
        <td>197</td>
  −
        <td>198</td>
  −
        <td>2</td>
  −
        <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
        <td>Mobile data sent last 24h  (SIM1)</td>
  −
        <td>199</td>
  −
        <td>200</td>
  −
        <td>2</td>
  −
        <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    </tr>
  −
}}
  −
   
  −
{{#ifeq:{{{name}}}| RUT955|
  −
    <tr>
  −
        <td>Galvanically isolated open collector output status</td>
  −
        <td>201</td>
  −
        <td>202</td>
  −
        <td>1</td>
  −
        <td>32 bit unsigned integer</td>
  −
      </tr>
  −
      <tr>
  −
        <td>Relay output status</td>
  −
        <td>202</td>
  −
        <td>203</td>
  −
        <td>1</td>
  −
        <td>32 bit unsigned integer</td>
  −
      </tr>
  −
}}
  −
      <tr>
  −
        <td>Active SIM card</td>
  −
        <td>205</td>
  −
        <td>206</td>
  −
        <td>1</td>
  −
        <td>32 bit unsigned integer</td>
  −
      </tr>
  −
      <tr>
  −
        <td>Mobile data received last week (SIM1)</td>
  −
        <td>292</td>
  −
        <td>293</td>
  −
        <td>2</td>
  −
        <td>32 bit unsigned integer</td>
  −
      </tr>
  −
      <tr>
  −
        <td>Mobile data sent last week (SIM1)</td>
  −
        <td>294</td>
  −
        <td>295</td>
  −
        <td>2</td>
  −
        <td>32 bit unsigned integer</td>
  −
      </tr>
  −
      <tr>
  −
        <td>Mobile data received last month (SIM1)</td>
  −
        <td>296</td>
  −
        <td>297</td>
  −
        <td>2</td>
  −
        <td>32 bit unsigned integer</td>
  −
      </tr>
  −
      <tr>
  −
        <td>Mobile data sent last month (SIM1)</td>
  −
        <td>298</td>
  −
        <td>299</td>
  −
        <td>2</td>
  −
        <td>32 bit unsigned integer</td>
  −
      </tr>
  −
{{#ifeq:{{{series}}}| RUT9XX|
  −
      <tr>
  −
          <td>Mobile data received today (SIM2)</td>
  −
          <td>300</td>
  −
          <td>301</td>
  −
          <td>2</td>
  −
          <td>32 bit unsigned integer</td>
  −
      </tr>
  −
      <tr>
  −
        <td>Mobile data sent today (SIM2)</td>
  −
        <td>302</td>
  −
        <td>303</td>
  −
        <td>2</td>
  −
        <td>32 bit unsigned integer</td>
  −
      </tr>
  −
      <tr>
  −
        <td>Mobile data received  this week  (SIM2)</td>
  −
        <td>304</td>
  −
        <td>305</td>
  −
        <td>2</td>
  −
        <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
        <td>Mobile data sent  this week  (SIM2)</td>
  −
        <td>306</td>
  −
        <td>307</td>
  −
        <td>2</td>
  −
        <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
        <td>Mobile data received  this month  (SIM2)</td>
  −
        <td>308</td>
  −
        <td>309</td>
  −
        <td>2</td>
  −
        <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
        <td>Mobile data sent  this month  (SIM2)</td>
  −
        <td>310</td>
  −
        <td>311</td>
  −
        <td>2</td>
  −
        <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Mobile data received last 24h (SIM2)</td>
  −
      <td>312</td>
  −
      <td>313</td>
  −
      <td>2</td>
  −
      <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
        <td>Mobile data sent last 24h (SIM2)</td>
  −
        <td>314</td>
  −
        <td>315</td>
  −
        <td>2</td>
  −
        <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Mobile data received last week (SIM2)</td>
  −
      <td>316</td>
  −
      <td>317</td>
  −
      <td>2</td>
  −
      <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Mobile data sent last week (SIM2)</td>
  −
      <td>318</td>
  −
      <td>319</td>
  −
      <td>2</td>
  −
      <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Mobile data received last month(SIM2)</td>
  −
      <td>320</td>
  −
      <td>321</td>
  −
      <td>2</td>
  −
      <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Mobile data sent last month (SIM2)</td>
  −
      <td>322</td>
  −
      <td>323</td>
  −
      <td>2</td>
  −
      <td>32 bit unsigned integer</td>
  −
    </tr>
  −
}}
  −
    <tr>
  −
      <td>Digital non-isolated input (4 PIN connector)</td>
  −
      <td>324</td>
  −
      <td>325</td>
  −
      <td>1</td>
  −
      <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Digital open collector output (4 PIN connector)</td>
  −
      <td>325</td>
  −
      <td>326</td>
  −
      <td>1</td>
  −
      <td>32 bit unsigned integer</td>
  −
    </tr>
  −
    <tr>
  −
      <td> IMSI </td>
  −
      <td>348</td>
  −
      <td>349</td>
  −
      <td>16</td>
  −
      <td>Text</td>
  −
  </tr>
  −
</table>
  −
  −
   
===Modbus read===
 
===Modbus read===
 
----
 
----
Line 622: Line 144:     
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 address 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).   
 
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 address 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).   
 
+
{{#ifeq:{{{series}}}|RUT9XX|
<table class="nd-othertables">
+
{{Template:Networking_{{lc:{{{name}}}}}_manual_modbus_modbus_tcp_set_parameters_table}}
    <tr>
+
|
        <th width="350">value to set</th>
+
{{Template:Networking_rut2xx_manual_modbus_modbus_tcp_set_parameters_table}}
      <th width="180">register address</th>
  −
      <th width="150">register value</th>
  −
      <th width="466">description</th>
  −
    </tr>
  −
{{#ifeq:{{{name}}}|RUT955|
  −
    <tr>
  −
      <td>Galvanically isolated open collector output (ON/OFF<span class="asterisk">*</span>)</td>
  −
      <td>201</td>
  −
      <td>1 {{!}} 0</td>
  −
        <td>Changes the state of the open collector (OC) output</td>
  −
    </tr>
  −
    <tr>
  −
      <td> Relay output (ON/OFF<span class="asterisk">*</span>)</td>
  −
      <td>202</td>
  −
      <td>1 {{!}} 0</td>
  −
        <td>Changes the state of the relay output</td>
  −
    </tr>
   
}}
 
}}
    <tr>
  −
      <td>Switch WiFi (ON/OFF<span class="asterisk">*</span>)</td>
  −
      <td>203</td>
  −
      <td>1 | 0</td>
  −
        <td>Turns WiFi ON or OFF</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Switch mobile data connection (ON/OFF<span class="asterisk">*</span>)</td>
  −
      <td>204</td>
  −
      <td>1 | 0</td>
  −
        <td>Turns mobile data connection ON or OFF</td>
  −
    </tr>
  −
    <tr>
  −
      <td>Switch SIM card</td>
  −
      <td>205</td>
  −
      <td>1 | 2 | 0</td>
  −
        <td>Changes the active SIM card slot
  −
            <ul>
  −
                <li>1 - switch to SIM1</li>
  −
                <li>2 - switch to SIM2</li>
  −
    <li>0 - switch from the the SIM card opposite of the one currently in use (SIM1 → SIM2 or SIM2 → SIM1</li>
  −
            </ul>
  −
</td>
  −
    </tr>
  −
    <tr>
  −
    <td>Reboot</td>
  −
        <td>206</td>
  −
        <td>1</td>
  −
        <td>Reboots the router</td>
  −
    </tr>
  −
    <tr>
  −
    <td>Change APN</td>
  −
        <td>207</td>
  −
        <td>APN code</td>
  −
        <td>Changes APN. <br> The number of input registers may vary depending on the length of the APN, but the very first byte of the set APN command denotes the number of the SIM card for which to set the APN. This byte should be set to:
  −
            <ul>
  −
                <li>1 - to set APN for SIM1</li>
  −
                <li>2 - to set APN for SIM2</li>
  −
    </ul>
  −
        </td>
  −
    </tr>
  −
    <tr>
  −
      <td> Switch PIN 4 state </td>
  −
      <td>325</td>
  −
      <td>1{{!}}0</td>
  −
      <td>Toggles PIN 4 ON or OFF, when output is selected</td>
  −
  </tr>
  −
</table>
  −
  −
   
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 '''WiFi OFF''', this command should be used:
 
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 '''WiFi OFF''', this command should be used:
   Line 727: Line 182:  
**http://www.unit-conversion.info/
 
**http://www.unit-conversion.info/
 
**http://www.binaryhexconverter.com/
 
**http://www.binaryhexconverter.com/
 +
[[Category:{{{name}}} Configuration Examples]]

Navigation menu