Template:Networking rut2xx manual input output cli: Difference between revisions

From Teltonika Networks Wiki
(Created page with "You can control and monitor input and output values via a command line interface (CLI) with the <i>gpio.sh</i> command. You can execute this comman...")
 
No edit summary
 
Line 13: Line 13:


<ul>
<ul>
     <li><b>DIN1''' - Digital input</li>
     <li><b>DIN1</b> - Digital input</li>
     <li><b>DOUT1''' - Digital output</li>
     <li><b>DOUT1</b> - Digital output</li>
</ul>
</ul>
----
----

Latest revision as of 13:02, 29 July 2019

You can control and monitor input and output values via a command line interface (CLI) with the gpio.sh command. You can execute this command without any additional options to get usage syntax examples:

root@Teltonika:~# gpio.sh
GPIO control aplication
        Usage: /sbin/gpio.sh <ACTION> <NAME>
        ACTION - set, clear, get, export, invert, dirout, dirin
        NAME - SIM      MON     MRST    SDCS    CASE    DIN1    DOUT1

Where:

  • DIN1 - Digital input
  • DOUT1 - Digital output

For example, to get the status of the digital output use the following command:

root@Teltonika:~# gpio.sh get DOUT1
0

The return value 0 means that the output is in Inactive (Low level), i.e., OFF. You can turn it ON (Active (High level)) by setting its value to 1:

root@Teltonika:~# gpio.sh invert DOUT1
root@Teltonika:~# gpio.sh get DOUT1
1

As seen in the example above, you can change the value of an output by using the invert command, which simply turns the current value of the specified output and turns it into its opposite state.