Template:Networking rutx manual input output: Difference between revisions
(→Input) |
No edit summary |
||
Line 123: | Line 123: | ||
==Output== | ==Output== | ||
===On/Off=== | |||
---- | |||
The ON/OFF section is used to turn the output on or off, but it doesn't save the state permanently, meaning that after a reboot the state will revert back to its default value. | |||
[[File:{{{file_output_on_off}}}]] | |||
===Post/Get configuration=== | |||
---- | |||
Enabling <b>Post/Get</b> will allow you to send HTTP POST/GET requests to the router that control the state of the output. | |||
[[File:{{{file_output_post_get}}}]] | |||
<table class="nd-mantable"> | |||
<tr> | |||
<th>Field</th> | |||
<th>Value</th> | |||
<th>Description</th> | |||
</tr> | |||
<tr> | |||
<td>Enable</td> | |||
<td>off | on; default: <b>off</b></td> | |||
<td>Turns Post/Get on or off.</td> | |||
</tr> | |||
<tr> | |||
<td>Username</td> | |||
<td>string; default: <b>none</b></td> | |||
<td>Username used for authentication in POST/GET queries.</td> | |||
</tr> | |||
<tr> | |||
<td>Password</td> | |||
<td>string; default: <b>none</b></td> | |||
<td>Password used for authentication in POST/GET queries.</td> | |||
</tr> | |||
</table> | |||
====Post/Get examples==== | |||
---- | |||
It is possible to turn the output on and off by using a valid HTTP POST/GET syntax. Use a web browser or any other compatible software to submit HTTP POST/GET strings to the device. | |||
Below is table containing syntax examples of this usage: | |||
<table class="nd-othertables_2"> | |||
<tr> | |||
<th style="width: 500px">ACTION</th> | |||
<th style="width: 900px">POST/GET URL EXAMPLE</th> | |||
</tr> | |||
<tr> | |||
<td>Turn output on</td> | |||
<td><nowiki>http://192.168.1.1/cgi-bin/output?username=user1&password=user1&</nowiki><span style="color: #0054a6;><b>action=on</b></span><nowiki>&pin=pin2</nowiki></td> | |||
</tr> | |||
<tr> | |||
<td>Turn output off</td> | |||
<td><nowiki>http://192.168.1.1/cgi-bin/output?username=user1&password=user1&</nowiki><span style="color: #0054a6;><b>action=off</b></span><nowiki>&pin=pin2</nowiki></td> | |||
</tr> | |||
<tr> | |||
<td>Turn output on after a 10 second delay</td> | |||
<td><nowiki>http://192.168.1.1/cgi-bin/output?username=user1&password=user1&action=on&pin=pin2&</nowiki><span style="color: #0054a6;><b>delay=10</b></span></td> | |||
</tr> | |||
<tr> | |||
<td>Turn output on for 5 seconds</td> | |||
<td><nowiki>http://192.168.1.1/cgi-bin/output?username=user1&password=user1&action=on&pin=pin2&</nowiki><span style="color: #0054a6;><b>time=5</b></span></td> | |||
</tr> | |||
<tr> | |||
<td>Turn output on for 5 seconds after a 10 second delay</td> | |||
<td><nowiki>http://192.168.1.1/cgi-bin/output?username=user1&password=user1&action=on&pin=pin2&</nowiki><span style="color: #0054a6;><b>delay=10&time=5</b></span></td> | |||
</tr> | |||
</table> | |||
[[Category:{{{name}}} WebUI]] |
Revision as of 09:34, 14 June 2019
Summary
Inputs and outputs are used for monitoring and controlling a connected device or receiving signals from that device in order to trigger certain events. This chapter is an overview of the Input/Output section for {{{name}}} routers.
The information in this page is updated in accordance with the [[Media:{{{fw_version}}}_single.bin|{{{fw_version}}}]] firmware version.
Characteristics
The router's input/output pins can be found inside the power socket:
[[File:{{{file_status_pinout}}}]]
The electric characteristics for the input and output pins are as follows:
- Digital non-isolated input: Logic low: 0 - 5 V; Logic high 8 - 40 V
- Digital open collector output: 30 V, 300 mA
Status
The Status page displays the current states of the input and the output:
[[File:{{{file_status}}}]]
If you click the the button that looks like a pencil next to an input/output entry, you will be able to create a custom label for the pin.
You can change how the names of the pin and its states are displayed for the device's input:
[[File:{{{file_status_input}}}]]
You can change how the names of the pin and its states are displayed for the device's output. You can also change which state is considered to be active (high level/low level):
[[File:{{{file_status_output}}}]]
Status from command line
You can also obtain the status of the input or output from the command line using the ubus call ioman get command:
root@Teltonika-{{{name}}}:~# ubus call ioman get '{"pin":"pin2"}' { "ioctl_inverted": 0, "response": 0 }
- pin1 is the input:
- "response": 0 means open state.
- "response": 1 means shorted state.
- pin2 is the output:
- "response": 0 means closed state.
- "response": 1 means open state.
You can change the state of the output by using the ubus call ioman change command:
root@Teltonika-{{{name}}}:~# ubus call ioman change '{"pin":"pin2","value":1}' { "ioctl_inverted": 0, "response": 1 }
Set the number following after "value": to indicate the new state of the output (possible values are 0 and 1).
Input
The Input section displays existing input rules. However, by default the list is empty:
[[File:{{{file_input_rules}}}]]
To add a new input rule, click the "Add" button. After this you will be redirected to the rule's configuration page:
[[File:{{{file_input_configuration}}}]]
Field | Value | Description |
---|---|---|
Enable | off | on; default: off | Turns the rule on or off. |
Input pin | Digital input (pin1); default: Digital input (pin1) | Selects to which input pin the rule will apply. |
Trigger | Input open | Input shorted | Both; default: Input open | Selects which input state triggers the rule. |
Action | Send SMS | Change profile | Reboot | Activate output; default: Send SMS | The action that will be taken when the rule is triggered:
|
Output
On/Off
The ON/OFF section is used to turn the output on or off, but it doesn't save the state permanently, meaning that after a reboot the state will revert back to its default value.
[[File:{{{file_output_on_off}}}]]
Post/Get configuration
Enabling Post/Get will allow you to send HTTP POST/GET requests to the router that control the state of the output.
[[File:{{{file_output_post_get}}}]]
Field | Value | Description |
---|---|---|
Enable | off | on; default: off | Turns Post/Get on or off. |
Username | string; default: none | Username used for authentication in POST/GET queries. |
Password | string; default: none | Password used for authentication in POST/GET queries. |
Post/Get examples
It is possible to turn the output on and off by using a valid HTTP POST/GET syntax. Use a web browser or any other compatible software to submit HTTP POST/GET strings to the device.
Below is table containing syntax examples of this usage:
ACTION | POST/GET URL EXAMPLE |
---|---|
Turn output on | http://192.168.1.1/cgi-bin/output?username=user1&password=user1&action=on&pin=pin2 |
Turn output off | http://192.168.1.1/cgi-bin/output?username=user1&password=user1&action=off&pin=pin2 |
Turn output on after a 10 second delay | http://192.168.1.1/cgi-bin/output?username=user1&password=user1&action=on&pin=pin2&delay=10 |
Turn output on for 5 seconds | http://192.168.1.1/cgi-bin/output?username=user1&password=user1&action=on&pin=pin2&time=5 |
Turn output on for 5 seconds after a 10 second delay | http://192.168.1.1/cgi-bin/output?username=user1&password=user1&action=on&pin=pin2&delay=10&time=5 |
[[Category:{{{name}}} WebUI]]