Template:Networking rutx manual input output: Difference between revisions

From Teltonika Networks Wiki
No edit summary
 
(13 intermediate revisions by the same user not shown)
Line 20: Line 20:
         <ul>
         <ul>
             <li>logic low: 0 - 5 V</li>
             <li>logic low: 0 - 5 V</li>
             <li>logic high: 8 - 40 V></li>
             <li>logic high: 8 - 40 V</li>
         </ul>
         </ul>
     </li>
     </li>
Line 28: Line 28:
==Status==
==Status==


The <b>Status</b> page displays the current states of the input and the output:
The <b>Status</b> page displays the current states of the router's input and output:


[[File:{{{file_status}}}]]
[[File:{{{file_status}}}]]
Line 107: Line 107:
         <td>Trigger</td>
         <td>Trigger</td>
         <td>Input open | Input shorted | Both; default: <b>Input open</b></td>
         <td>Input open | Input shorted | Both; default: <b>Input open</b></td>
         <td>Selects which input state triggers the rule.</td>
         <td>Selects which input state will trigger the rule.</td>
     </tr>
     </tr>
     <tr>
     <tr>
         <td>Action</td>
         <td>Action</td>
         <td>Send SMS | Change profile | Reboot | Activate output; default: <b>Send SMS</b></td>
         <td>{{#ifeq:{{{modem}}}|1|Send SMS {{!}} |}} Change profile | Reboot | Activate output; default: <b>Send SMS</b></td>
         <td>The action that will be taken when the rule is triggered:
         <td>The action that will be taken when the rule is triggered.
             <ul>
             <ul>
                <li><b>Send SMS</b> - sends an SMS message with user specified text to the specified recipient(s).</li>
{{#ifeq:{{{modem}}}|1|{{Template:Networking_rutx_manual_input_output_input_input_rules_modem}}|}}
                 <li><b>Change profile</b> - switches to another configuration profile. At least one configuration profile has to be created before this can be used. You can create configuration profiles from the <b>System → [[{{{name}}} Profiles|Profiles]]</b> page.</li>
                 <li><b>Change profile</b> - switches to another configuration profile. At least one configuration profile has to be created before this can be used. You can create configuration profiles from the <b>System → [[{{{name}}} Profiles|Profiles]]</b> page.</li>
                 <li><b>Reboot</b> - reboots the device when a specified amount of time passes after the trigger.</li>
                 <li><b>Reboot</b> - reboots the device when a specified amount of time passes after the trigger.</li>
Line 133: Line 133:
===On/Off===
===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.
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}}}]]
[[File:{{{file_output_on_off}}}]]
Line 139: Line 139:
===Post/Get configuration===
===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.
Enabling <b>Post/Get</b> will allow you to send HTTP POST/GET requests to the router that control the state of the output. The figure below is an example of the Post/Get configuration section an the table below provides information on the fields contained in that section:


[[File:{{{file_output_post_get}}}]]
[[File:{{{file_output_post_get}}}]]
Line 170: Line 170:
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.
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:  
Below is a table containing syntax examples of this usage:  


<table class="nd-othertables_2">
<table class="nd-othertables_2">
     <tr>
     <tr>
         <th style="width: 500px">ACTION</th>
         <th style="width: 500px">Action</th>
       <th style="width: 900px">POST/GET URL EXAMPLE</th>
       <th style="width: 900px">POST/GET URL</th>
     </tr>
     </tr>
     <tr>
     <tr>
Line 236: Line 236:
       <td>Output</td>
       <td>Output</td>
       <td>Digital output (pin2); default: <b>Digital output (pin2)</b></td>
       <td>Digital output (pin2); default: <b>Digital output (pin2)</b></td>
       <td>Output that will be affected by the rule.</td>
       <td>The output pin that will be be effected by the rule.</td>
     </tr>
     </tr>
     <tr>
     <tr>
Line 251: Line 251:
     <td>Mode</td>
     <td>Mode</td>
         <td>Fixed | Interval; default: <b>Fixed</b></td>
         <td>Fixed | Interval; default: <b>Fixed</b></td>
         <td>
         <td>When the rule will be triggered.
             <ul>
             <ul>
                 <li><b>Fixed</b> - triggers the specified action on the specified day(s), hour and minute. For example, every Sunday at 8:30 AM.</li>
                 <li><b>Fixed</b> - triggers the specified action on the specified day(s), hour and minute. For example, every Sunday at 8:30 AM.</li>
                 <li><b>Interval</b> - performs the action periodically. For example, every 1 hour.</li>
                 <li><b>Interval</b> - performs the action at an interval. For example, every 1 hour during Mondays.</li>
             </ul>
             </ul>
         </td>
         </td>
Line 262: Line 262:
===Scheduler===
===Scheduler===
----
----
With the help of the output <b>Scheduler</b> you can configure a timetable of when the output should be enabled or disabled, based on date and time.
With the help of the output <b>Scheduler</b> you can configure a timetable of when the output should be enabled or disabled based on date and time.


[[File:{{{file_output_scheduler}}}]]
[[File:{{{file_output_scheduler}}}]]


[[Category:{{{name}}} WebUI]]
[[Category:{{{name}}} Services section]]

Latest revision as of 13:44, 16 April 2020

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 router's input and 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. By default, the input rules 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 will trigger the rule.
Action Change profile | Reboot | Activate output; default: Send SMS The action that will be taken when the rule is triggered.
  • Change profile - switches to another configuration profile. At least one configuration profile has to be created before this can be used. You can create configuration profiles from the System → [[{{{name}}} Profiles|Profiles]] page.
  • Reboot - reboots the device when a specified amount of time passes after the trigger.
  • Activate output - activates the output. This can be done in three ways:
    • Seconds - activates the output for a specified amount of time.
    • While exists - activates the output while the specified trigger still exists.
    • Delayed action - activates the output when a specified amount of time passes after the trigger; deactivates the output when the trigger stops and a specified amount of time passes.

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. The figure below is an example of the Post/Get configuration section an the table below provides information on the fields contained in that section:

[[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 a table containing syntax examples of this usage:

Action POST/GET URL
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

Overview:

  • 192.168.1.1 - router's default LAN IP address; replace it in accordance with your own configuration.
  • username - login name from Post/Get configuration.
  • password- password from Post/Get configuration.
  • action- the action that will be performed on the output (can be on or off).
  • pin - specifies the output (use pin2).
  • delay - defines a delay (in seconds) after which the specified action will be performed.
  • time - defines a window of time during which the action will take place. For instance, if you post an on action while specifying time=5, the output will turn on and stay on for 5 seconds before turning off.

Delay and time parameters can be used together. For example, if delay is 10, time is 5, action is on, then 10 seconds after the execution of the command, the output will switch to on (or stay in on state if it was already that way), then after 5 more seconds it will switch to off state. In this case the overall command execution time is 15 seconds.

Periodic control


The Periodic control section allows you to set up automatic output control rules that trigger output state changes at the specified period or interval. By default, the control rules list is empty:

[[File:{{{file_output_periodic_control}}}]]


To add a new control rule, click the "Add" button. After this you will be redirected to the rule's configuration page:

[[File:{{{file_output_periodic_control_configuration}}}]]

Field Value Description
Enable off | on; default: off Turns the rule on or off.
Output Digital output (pin2); default: Digital output (pin2) The output pin that will be be effected by the rule.
Action on | off; default: on The action that will be performed on the output.
Action timeout off | on; default: off Action timeout specifies whether an action should end after some time. For example, if action is set to on and timeout is set to 10, when the trigger occurs the output will turn on for 10 seconds before turning off.
Mode Fixed | Interval; default: Fixed When the rule will be triggered.
  • Fixed - triggers the specified action on the specified day(s), hour and minute. For example, every Sunday at 8:30 AM.
  • Interval - performs the action at an interval. For example, every 1 hour during Mondays.

Scheduler


With the help of the output Scheduler you can configure a timetable of when the output should be enabled or disabled based on date and time.

[[File:{{{file_output_scheduler}}}]]

[[Category:{{{name}}} Services section]]