CLI Reference Guide AIO

From OpenMotics
Jump to navigation Jump to search

The Gateway has 2 computer systems built-in: A Master Controller (Microchip DSPIC33) and a Gateway Controller (Linux Based Beagle Bone). The Master controller is connected with the Gateway Controller over RS232. The Master Controller has a built-in CLI interface allowing the user to configure and control the Master controller to his full extend.

This CLI can be accessed by using the Maintenance function in the OpenMotics cloud or by using a RS232 TTL cable (Baud rate 115200, 8 databits, no parity, 1 stop bit, no flow control) that is connected directly on the Gateway on the extern RS232 connector.

Possible modes of communication:

  • Advanced Mode: API (The Master controller and Gateway controller will use Advanced mode to communicate)
  • Simple Mode: CLI (Simple Mode will be used by Maintenance mode in the cloud or when a direct RS232 connection is established)

Notes

  1. In CLI mode, characters sent through RS232 can be echoed. In API mode they are never echoed.
  2. Instructions are case sensitive.
  3. As opposed to API mode, CLI mode has a variable instruction length.
  4. Every instruction must be followed by a Carriage return (<CR>, DEC 13).
  5. Every successful instruction will return the requested information (or perform requested action) followed by OK, otherwise ERROR is returned (wrong format, wrong parameters,…). All error codes are listed in the Error Codes AIO section.
  6. An instruction will only be executed if the Master has responded with “OK”

Notation

Instruction [required parameter] {optional parameter}

Instruction description.

[param]
Parameter description


Returns
[return value]

Versioning

This document describes the available CLI commands available on the All In One CLI interface. The All In One module is not yet available and not yet in production so please use CLI Reference Guide used in the current gateway.

Gateway Module FW version
NOT IN PRODUCTION V0.03

Instruction Set

Input instructions

input release [input nr]

Switch input to release state for virtual modules.
[input nr]
Indicates which input that needs to be put in release state, a maximum of 480 (0 - 479) inputs can be used.
Returns
OK

Example:

Instruction
input release 28
Returns
OK

input press [input nr]

Switch input to press state for virtual modules.
[input nr]
Indicates which input that needs to be put in press state, a maximum of 480 (0 - 479) inputs can be used.
Returns
OK

Example:

Instruction
input press 28
Returns
OK

input name write [input nr]

Write the name of an input, max 16 characters.
[input nr]
Indicates which input the name has to be written.
Returns
OK

Example:

Instruction
input name write 28 Bedroom parents
Returns
OK

input name read [input nr]

Read the name of an input
[input nr]
Indicates which input the name has to be displayed.
Returns
Input Name
OK

Example:

Instruction
input name read 28
Returns
Bedroom Parents
OK

Output instructions

output on [output nr] [dimmer value*] [timer value*]

Switch ON an output. * are optional values
[output nr]
Indicates which output that needs to be switched ON, a maximum of 480 (0 - 479) outputs can be used.
[dimmer value*]
Optional parameter to set the dimmer value (0-255)
[timer value*]
Optional parameter to set the timer value (0-65535s)
Returns
OK

Examples:

Instruction
output on 127
will switch ON output 127.
Returns
OK
Instruction
output on 127 56
will switch ON output 127 with dimmer value 56.
Returns
OK
Instruction
output on 127 56 3600
will switch ON output 127 with dimmer value 56 for 3600 seconds.
Returns
OK

output off [output nr]

Switch OFF an output.
[output nr]
Indicates which output that needs to be switched OFF, a maximum of 480 (0 - 479) outputs can be used.
Returns
OK

Example:

Instruction
output off 127 will switch OFF output 127.
Returns
OK

output name write [output nr]

Write the name of an output, max 16 characters.
[input nr]
Indicates which input the name has to be written.
Returns
OK

Example:

Instruction
output name write 24 Bedroom 4
Returns
OK

output name read [output nr]

Read the name of an output
[output nr]
Indicates which output the name has to be displayed.
Returns
output Name
OK

Example:

Instruction
output name read 24
Returns
Bedroom 4
OK