Changes

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..."
You can control and monitor input and output values via a [[Command line interfaces|command line interface (CLI)]] with the <i>gpio.sh</i> command. You can execute this command without any additional options to get usage syntax examples:

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

Where:

<ul>
<li><b>DOUT1</b> - Digital OC output</li>
<li><b>DOUT2</b> - Digital relay output</li>
<li><b>DIN1</b> - Digital input</li>
<li><b>DIN2</b> - Digital galvanically isolated input</li>
</ul>
----
For example, to get the status of the digital OC output use the following command:

<pre>
root@Teltonika:~# gpio.sh get DOUT1
0
</pre>

The return value <b>0</b> means that the output is in <b>Inactive</b> (<b>High level</b>), i.e., <b>OFF</b>.

You can turn it <b>ON</b> (<b>Active</b> (<b>Low level</b>)) by setting its value to <b>1</b>:

<pre>
root@Teltonika:~# gpio.sh invert DOUT1
root@Teltonika:~# gpio.sh get DOUT1
1
</pre>

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 into its opposite state.
----
To get the value of the analog input use the '''analog_calc''' command. For example:

<pre>
root@Teltonika:~# analog_calc
7.2V
</pre>