Difference between revisions of "Scripts (Edge)"
From Zenitel Wiki
(Created page with "{{E}} Script (Virtual I/O) is a feature for activating scripts on station events. The supported script languages are Lua and bash. A station can be triggered, e.g. by DTMF or...") |
|||
(One intermediate revision by the same user not shown) | |||
Line 24: | Line 24: | ||
<br> | <br> | ||
− | |||
=== Script Configuration === | === Script Configuration === | ||
* Select '''Edge Configuration''' > '''Script''' | * Select '''Edge Configuration''' > '''Script''' | ||
Line 49: | Line 48: | ||
<br> | <br> | ||
− | |||
=== Script Events === | === Script Events === | ||
*Select '''Edge Configuration''' > '''Script Events''' | *Select '''Edge Configuration''' > '''Script Events''' | ||
Line 68: | Line 66: | ||
* [[Virtual IO - Examples]] | * [[Virtual IO - Examples]] | ||
− | [[Category: | + | [[Category: IC-EDGE Configuration]] |
Latest revision as of 09:54, 8 January 2020
Script (Virtual I/O) is a feature for activating scripts on station events. The supported script languages are Lua and bash. A station can be triggered, e.g. by DTMF or an input to execute scripts towards other systems, e.g. access control systems. These scripts can be uploaded and configured via the menu options:
- Script Upload
- Script
- Script Events
Requirements
- Turbine station operating in Edge mode.
- Advanced configuration mode needs to be enabled on the station.
INCA stations do not support Virtual I/O. |
|
Script Upload
To start with, a script should be uploaded to the station. It is possible to download scripts from the station by clicking its Name. Scripts are kept during a software upgrade process.
- Select Edge Configuration > Script Upload
- Upload Script: Click Browse to upload the desired script
Script Configuration
- Select Edge Configuration > Script
After uploading a script the user must configure a script slot (Slot 1 - Slot 10). First, assign a logical name to the script in the Assign a Label field. Then, enter the script to activate and add parameters in the text field under Enter script in selected slot (note that shell scripts don’t need to be uploaded as it is possible to write the script direclty in the text field). Lua scripts have the followings syntax:
lua <scriptname> <parameter1> <parameter2> <parameter3> ....
Shell scripts follow the same syntax, but starts with sh:
sh <scriptname> <parameter1> <parameter2> <parameter3> ...
The uploaded scripts should clearly state which parameters are needed in the beginning of the file.
The example shown in the screenshot above has 4 parameters: username, password, the IP address of turbine station, and Virtual I/O (gpio1 - gpio6) to activate. The parameter values in the example are:
- Username = admin
- Password = alphaadmin
- IP address = 10.9.7.10
- Output = 1
To be able to use Output, the pin connector needs to be changed to output. This can be done in Edge Configuration > I/O, and change the selected I/O Pin to Output |
Script Events
- Select Edge Configuration > Script Events
After a script slot has been created, you need to configure which Event that should Execute the script.
In the example below, the script "Activate Output" will be executed when the station receives DTMF digit #3 from the remote station:
If there is a need to delay the execution of the script, one can choose a time in seconds in the field "after a duration of".