Difference between revisions of "Template:Networking trb1 manual input output status"

From Teltonika Networks Wiki
 
Line 15: Line 15:
  
 
<ul>
 
<ul>
     <li><b>din1</b> is the input:
+
     <li><b>dio0</b> is configurable input / output:
        <ul>
 
            <li>"value": "<b>0</b>" means low level state.</li>
 
            <li>"value": "<b>1</b>" means high level state.</li>
 
        </ul>
 
    </li>
 
    <li><b>dout1</b> is the output:
 
 
         <ul>
 
         <ul>
 
             <li>"value": "<b>0</b>" means low level state.</li>
 
             <li>"value": "<b>0</b>" means low level state.</li>
 
             <li>"value": "<b>1</b>" means high level state.</li>
 
             <li>"value": "<b>1</b>" means high level state.</li>
 +
            <li>"direction": "<b>in</b>" means input state.</li>
 +
            <li>"direction": "<b>out</b>" means output state.</li>
 
         </ul>
 
         </ul>
 
     </li>
 
     </li>
Line 33: Line 29:
 
  ubus call ioman.gpio.dio0 update '{"value":"0"}'
 
  ubus call ioman.gpio.dio0 update '{"value":"0"}'
 
  ubus call ioman.gpio.dio0 update '{"value":"1"}'
 
  ubus call ioman.gpio.dio0 update '{"value":"1"}'
 +
ubus call ioman.gpio.dio0 update '{"direction":"in"}'
 +
ubus call ioman.gpio.dio0 update '{"direction":"out"}'

Latest revision as of 08:12, 19 August 2021

ioman.gpio.dio0
ioman.gpio.dio1

In order to read values, call command ubus call value status :

root@Teltonika-{{{name}}}:~# ubus call ioman.gpio.dio1 status
{
        "value": "0",
        "direction": "in",
        "bi_dir": false,
        "invert_input": false
}
  • dio0 is configurable input / output:
    • "value": "0" means low level state.
    • "value": "1" means high level state.
    • "direction": "in" means input state.
    • "direction": "out" means output state.

To change input settings, use the update command and specify a value:

ubus call ioman.gpio.dio0 update '{"value":"0"}'
ubus call ioman.gpio.dio0 update '{"value":"1"}'
ubus call ioman.gpio.dio0 update '{"direction":"in"}'
ubus call ioman.gpio.dio0 update '{"direction":"out"}'