Difference between revisions of "CLI Reference Guide AIO"

From OpenMotics
Jump to navigation Jump to search
(Created page with "The Gateway has 2 computer systems built-in: A Master Controller (Microchip 18F67J11 based) and a Gateway Controller (Linux Based Beagle Bone Black). The Master controller is...")
 
Line 1: Line 1:
The Gateway has 2 computer systems built-in: A Master Controller (Microchip 18F67J11 based) and a Gateway Controller (Linux Based Beagle Bone Black). 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.
+
The Gateway has 2 computer systems built-in: A Master Controller (Microchip DSPIC33) and a Gateway Controller (Linux Based Beagle Bone Black). 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 (the necessary jumpers needs to be removed to work properly see [[RS232]])   
 
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 (the necessary jumpers needs to be removed to work properly see [[RS232]])   

Revision as of 15:52, 6 December 2017

The Gateway has 2 computer systems built-in: A Master Controller (Microchip DSPIC33) and a Gateway Controller (Linux Based Beagle Bone Black). 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 (the necessary jumpers needs to be removed to work properly see RS232)

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 (“echo on” or “echo off”). 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 section.
  6. An instruction will only be executed if the Master has responded with “OK”
  7. To go from CLI to API mode type exit. To go from API to CLI mode type STRCM (capitals), followed by random characters until “ERROR 17” or “OK” appears.

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 Gateway Module CLI interface.

Gateway Module FW version
3.140

Instruction Set

Action instructions

action read [action] [bank]

Gets the values stored for a simple action.


[action]
Number of the action, a maximum of 204 (0 - 203) simple actions can be defined
[bank]
Always use 0


Returns
[config byte] [selected output or validation bit nr] [timer] [dimmer]


Example:

action read 5 0 will read simple action 5 of bank 0
output: 10 35 8000 40
In this example, simple action 5 will toggle (config byte=10) output 35 with timer value 8000 (if toggled on) and dimmer value 40 (if toggled on)

Notes:

  1. For description of the config byte, please see Config Types page
  2. Only bank 0 works in the current firmware version. Writing and reading in all banks is possible, however, activating these simple actions (except for bank 0) are not possible
  3. Only use simple actions when no basic actions exist to execute the requested function. Before using simple actions, first look at the Action Types document for existing Basic Actions



action write [action] [bank] [config byte] [output or validation bit number] [timer] [dimmer]

Sets a simple action in the eeprom.


[action]
Number of the action, a maximum of 204 (0 - 203) simple actions can be defined per bank.
[bank]
Always use 0
[config byte]
The action byte of the instruction.
[output / validation]
The output or validation bit number to which the instruction is written.
[timer]
Dimmer level, ranging from 0 to 63.
[dimmer]
Timer value in seconds, ranging from 0 to 65500.

Example:

action write 6 0 9 12 10000 45 will write simple action 6 in bank 0: put output 12 on with specific timer value (config byte=9) of 10000 seconds and with a light intensity of 45 (max 63).

Notes:

  1. For description of the config byte, please see Config Types document
  2. Only bank 0 works in the current firmware version. Writing and reading in all banks is possible, however, activating these simple actions (except for bank 0) are not possible
  3. Only use simple actions when no basic actions exist to execute the requested function. Before using simple actions, first look at the Action Types document for existing Basic Actions



action activate [action] [bank]

Activates a simple action. Always use this function to test a created simple action.


[action]
Number of the action, a maximum of 204 (0 - 203) simple actions can be defined per bank.
[bank]
Number of the bank, there are 4 (0 - 3) banks available.

Example:

action activate 6 0 will run action 6 of bank 0.
API equivalent: STRIFA6 0

Note:

  1. Only bank 0 works in the current firmware version. Writing and reading in all banks is possible, however, activating these simple actions (except for bank 0) are not possible