Otii scripting is a Lua based scripting tool that can be run from within the Otii desktop client as well as from a command line tool. You do not need to install Lua since Lua is embedded in the application and command line tool.

Running from the desktop

You find the scripting window in the "Window/Scripting" menu item. From the scripting window you can create, open, save and run your scripts. Your script is entered in the upper pane, and the output is shown in the lower pane.

You can enter arguments to the script, separated by space.

If you prefer to edit your script in an external editor, you can check "Auto reload", and the script window will automatically be updated as soon as you save the script in your editor.

Running from the command line

When installing the Otii desktop client, a command line tool called otiicli is included in the installation directory.

  • Windows - "C:\Program Files\otiicli.exe".

  • Linux - "/usr/bin/otiicli".

  • Mac - "/Applications/otii.app/Content/MacOS/otiicli".

If you start the script without parameters a brief explanation of the command parameters will be shown. You will always need to specify a script to be run, and you can optionally add parameters that can be used in the script.

# otiicli calibrate_devices.lua

# otiicli capture_to_csv.lua captured_data.csv

By default otiicli will open the communication with all available otii hardware. If you want to restrict it to use only some devices (e.g. if you want to run several scripts in parallell) you can specify wich COM ports it will use with the -d or --device parameter. This parameter can occur several times if you want to use more than one device.

# otiicli -d ttyACM0 capture.lua

# otiicli -d ttyACM0 -d ttyACM1 capture.lua

If you want to get a verbose debug output from the client you specify the -v parameter.

# otiicli -v capture.lua

To list all available devices you specify the -l or --list-devices parameter. All ports with an otii device connected will be listed and otiicli will return 0. If no devices are connected, the text "No device" will be printed and otiicli will return 1.

# otiicli -l

To remove the version banner use the -n or --no-banner parameter.

# otiicli -n -l

Otii script folder

When running a script the folder containing the script-file becomes the root. Thus including other scriptfiles with the require statement can be done using paths relative to the main script.

generated by LDoc 1.4.6 Last updated 2021-10-13 21:46:39