Template:Networking rutos manual input output: Difference between revisions

From Teltonika Networks Wiki
No edit summary
No edit summary
Line 31: Line 31:
         </ul>
         </ul>
     </li>
     </li>
     <li><b>Output/b>: digital open collector (OC) output; 30 V, 300 mA.</li>
     <li><b>Output</b>: digital open collector (OC) output; 30 V, 300 mA.</li>
</ul>
</ul>
<ul>
<ul>

Revision as of 07:34, 22 October 2020

Template:Networking rutos manual fw disclosure

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 of the user manual provides an overview of the Input/Output section for {{{name}}} devices.

If you're having trouble finding this page or some of the parameters described here on your device's WebUI, you should turn on "Advanced WebUI" mode. You can do that by clicking the "Advanced" button, located at the top of the WebUI.


Status

The Status page displays the current states of the device input and output:

File:Networking rutx manual input output status v2.png

You can invert Input pin by clicking on slider in Inversion column and switch Output pin state by clicking on slider in State column.

Status from command line


You can also obtain the status of the input or output from the command line. List of ubus possible values in {{{name}}} devices:

ioman.gpio.dio0
ioman.gpio.dio1

Call command ubus call value status :

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

Post/Get

Enabling Post/Get will allow you to send HTTP POST/GET requests to device which controls the state of the output. The figure below is an example of the Post/Get configuration section and the table below provides information on the fields contained in that section:

File:Networking rutx manual input output post get v2.png

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.
Confirm password string; default: none Repeat the new password.

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 state to high http://192.168.1.1/cgi-bin/io_state?username=user1&password=user1&pin=dout1&state=on
Turn Output state to low after 5 seconds for 3 seconds http://192.168.1.1/cgi-bin/io_state?username=user1&password=user1&pin=dout1&state=on&delay=5&time=3

Overview:

  • 192.168.1.1 - device 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.
  • state - turn Output on or off.
  • 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.


To use Post/Get via SSH instead of a browser, you may want to use the curl -X command. Simply add the same URL command in between quotes and specify the HTTP method.

Examples:

  • Switch output to High:
    curl -X GET "http://192.168.1.1/cgi-bin/io_state?username=user1&password=user1&pin=dout1&state=on"
  • Switch output to Low after delay:
    curl -X GET "http://192.168.1.1/cgi-bin/io_state?username=user1&password=user1&pin=dout1&state=off&delay=5"

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. By default everything is unset.

I/O juggler

The I/O juggler page is used create automated actions based on Input state and conditions.

General


The General section allows you to create automated Actions based on selected Inputs and their trigger state. The figure below is an example of Conditions section.


Modify Input configuration


You can find explanation about fields in the table below this illustration.

Field Value Description
Enabled off | on; default: off Changes current profile to specified one when action triggers.
Trigger interval positive integer; default: none Specifies what is the shortest amount of seconds between triggers.
Trigger Rising | Falling | Both; default: Rising Specifies on which trigger state this rule will be activated.
Add actions actions; default: none Specifies actions which have to be met for rule to be executed. Actions are optional.
Add conditions conditions; default: none Specifies conditions which have to be met for action to occur. Conditions are optional.

Actions


The Actions section lets you manage your created Actions for I/O Juggler inputs. The figure below is an example of Actions section.

Modify action


Above is an example of what action configuration window looks like. Below is a table with detailed explanations on how to configure the action and what each of the fields mean. To avoid redundancy, screenshots for the other actions will not be provided, since the structures, syntax and the overall look of the configuration windows for each action are very similar. Instead, only tables containing information on how to edit each action will be provided.

Profile

Field Value Description
Type Profile Changes current profile to specified one when action triggers.
Execution delay positive integer; default: none How many seconds will pass before the action is excecuted after it's triggered.
Profile profile; default: default Choose a profile that will be applied when the action triggers.
Add conditions conditions; default: none Specifies conditions which have to be met for action to occur. Conditions are optional.


Email

Field Value Description
Type Email Sends email when action triggers.
Subject string; default: none Subject of email.
Text message string; default: none Text message to be sent in email. Below this field you can find device information and their codes, which can be included in messages to send device information.
Execution delay positive integer; default: none How many seconds will pass before the action is excecuted after it's triggered.
Email user email user; default: none Configured email user.
Recipient's email address string; default: none Email receiver(s).
Add conditions conditions; default: none Specifies conditions which have to be met for action to occur. Conditions are optional.
SMS

Field Value Description
Type SMS Sends sms when action triggers.
Text message string; default: none Text message to be sent in sms. Below this field you can find device information and their codes, which can be included in messages to send device information.
Execution delay positive integer; default: none How many seconds will pass before the action is excecuted after it's triggered.
Recipients Single number | Group; default: Single number How many recipients will get the message.
Single number: Recipient's phone number number; default: none SMS receiver.
Group: Phone group phone group; default: none SMS receivers.
Add conditions conditions; default: none Specifies conditions which have to be met for action to occur. Conditions are optional.

Note: this table has coloring scheme to indicate which fields can be seen with different configuration.

Output

Field Value Description
Type Output Changes Output state when action triggers.
Execution delay positive integer; default: none How many seconds will pass before the action is excecuted after it's triggered.
Control output; default: Output(4) Specifies the output of which the state will be changed.
Revert integer; default: 0 After how many seconds the state will revert. If left 0 or empty the state will not revert.
Maintain off | on; default: on Maintain this IO state after reboot.
Invert off | on; default: off On action inverts pin state.
State copying off | on; default: off Copies the state from selected input to selected output.
State High | Low; default: High Specifies what state the output pin will be set to.
Add conditions conditions; default: none Specifies conditions which have to be met for action to occur. Conditions are optional.


HTTP

Field Value Description
Type HTTP Sends HTTP request when action triggers.
Execution delay positive integer; default: none How many seconds will pass before the action is excecuted after it's triggered.
Method Get | Post; default: Get Specifies the output of which the state will be changed.
URL string; default: none URL to send request to.
Verify off | on; default: off Verifies the validity of certificates, only works for https.
Parameters string; default: none Parameters and their value from device for usage in Post or Get requests. Possible values: Time stamp, UNIX time, WAN MAC, Wired WAN IP, Network info, Product code, LAN MAC address, LAN IP address, Serial number, Current FW version, Monitoring status, Input Name, Input state change trigger, RSCP, ECIO, SIM slot in use, CELLID, RSRQ, SINR, RSRP, SIM State, SIM pin state, Modem model, IMSI, Modem serial number , Network State, Data connection state, Connection type, Mobile IP, Operator name, Signal strenght, IMEI, ICCID, Neighbour cells, Network serving.
Add conditions conditions; default: none Specifies conditions which have to be met for action to occur. Conditions are optional.


Script

Field Value Description
Type Script Runs script when action triggers.
Execution delay positive integer; default: none How many seconds will pass before the action is excecuted after it's triggered.
Specify path Upload a script | Specify path; default: Upload a script Selection to upload a script or specify its absolute path in device.
Upload a script: Custom script -(interactive button) Shows file upload window on click.
Specify path: Script file string; default: none Absolute path to script file in device.
Arguments string; default: none Optional arguments which can be provided for the script. You can include device information with values given below this input field.
Add conditions conditions; default: none Specifies conditions which have to be met for action to occur. Conditions are optional.

Note: this table has coloring scheme to indicate which fields can be seen with different configuration.

Reboot

Field Value Description
Type Reboot Reboots device when action triggers.
Execution delay positive integer; default: none How many seconds will pass before the action is excecuted after it's triggered.
Add conditions conditions; default: none Specifies conditions which have to be met for action to occur. Conditions are optional.
Change sim

Field Value Description
Type Change sim Changes active sim card when action triggers.
Execution delay positive integer; default: none How many seconds will pass before the action is excecuted after it's triggered.
Flip off | on; default: off Switches to a different sim card.
Off: Target Sim1 | Sim2; default: Sim1 Switches to a selected sim card.
Add conditions conditions; default: none Specifies conditions which have to be met for action to occur. Conditions are optional.

Note: this table has coloring scheme to indicate which fields can be seen with different configuration.

Conditions


The Conditions section lets you manage your created Conditions for I/O Juggler Actions. The figure below is an example of Conditions section.

Modify condition


Above is an example of what condition configuration window looks like. Below is a table with detailed explanations on how to configure the condition and what each of the fields mean. To avoid redundancy, screenshots for the other conditions will not be provided, since the structures, syntax and the overall look of the configuration windows for each condition are very similar. Instead, only tables containing information on how to edit each condition will be provided.

Boolean group

Field Value Description
Condition type Boolean group A type of condition.
Boolean type AND | NAND | OR | NOR; default: AND Type of boolean condition.
Add conditions conditions; default: none Specifies conditions which have to be met for action to occur. Conditions are optional.


I/O

Field Value Description
Condition type I/O A type of condition.
I/O inputs/outputs; default: Output(4) Specifies the I/O to which the condition is listening to.
State High | Low; default: High Specifies in what state the pin has to be.



Minute

Field Value Description
Condition type Minute A type of condition.
Inverted function off | on; default: off Inverts the selected condition type. Makes the condition true if the time/date is outside the specified interval.
Interval off | on; default: off Switches between a specific value and a time interval.
Off: Minute integer [0..59]; default: none Specifies minute at which the action can occur.
On: Start minute integer [0..59]; default: none Specifies starting minute of the interval at which the action can occur.
On: End minute integer [0..59]; default: none Specifies ending minute of the interval at which the action can occur.

Note: this table has coloring scheme to indicate which fields can be seen with different configuration.

Hour

Field Value Description
Condition type Hour A type of condition.
Inverted function off | on; default: off Inverts the selected condition type. Makes the condition true if the time/date is outside the specified interval.
Interval off | on; default: off Switches between a specific value and a time interval.
Off: Hour integer [0..59]; default: none Specifies hour at which the action can occur.
On: Start hour integer [0..59]; default: none Specifies starting hour of the interval at which the action can occur.
On: End hour integer [0..59]; default: none Specifies ending hour of the interval at which the action can occur.

Note: this table has coloring scheme to indicate which fields can be seen with different configuration.

Weekday

Field Value Description
Condition type Weekday A type of condition.
Inverted function off | on; default: off Inverts the selected condition type. Makes the condition true if the time/date is outside the specified interval.
Interval off | on; default: off Switches between a specific value and a time interval.
Off: Weekday weekday; default: Monday Specifies weekday at which the action can occur.
On: Start weekday weekday; default: Monday Specifies starting weekday of the interval at which the action can occur.
On: End weekday weekday; default: Monday Specifies ending weekday of the interval at which the action can occur.

Note: this table has coloring scheme to indicate which fields can be seen with different configuration.

Month day

Field Value Description
Condition type Month day A type of condition.
Month override off | on; default: off If the option is selected and the specified day is not in the month then the condition uses the last day of the month.
Interval off | on; default: off Switches between a specific value and a time interval.
Off: Day of the month integer [1..31]; default: none Specifies day of the month at which the action can occur.
On: Start day of the month integer [1..31]; default: none Specifies starting day of the interval of the month at which the action can occur.
On: End day of the month integer [1..31]; default: none Specifies ending day of the interval of the month at which the action can occur.

Note: this table has coloring scheme to indicate which fields can be seen with different configuration.

Year

Field Value Description
Condition type Year A type of condition.
Inverted function off | on; default: off Inverts the selected condition type. Makes the condition true if the time/date is outside the specified interval.
Interval off | on; default: off Switches between a specific value and a time interval.
Off: Day of the year integer [1..366]; default: none Specifies day of the year at which the action can occur.
On: Start day of the year integer [1..366]; default: none Specifies starting day of the interval of the year at which the action can occur.
On: End day of the year integer [1..366]; default: none Specifies ending day of the interval of the year at which the action can occur.

Note: this table has coloring scheme to indicate which fields can be seen with different configuration.

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