Jump to: navigation, search

Command Line Interface

This page contains information that is superseded by the API provided in the kwikwai software

API design objective

The API is both human and machine readable (no binary or xml).
It reports error in reply, is easy to parse and state less.
There is no prompt to avoid messy display while receiving async stuff.
The command structure is defined to avoid dual levels.

Command structure

Kwikwai is server on serial, USB and telnet (port 9090, multiple sessions are supported).
USB and serial provide the same interface.

Client sends commands in the form:

command <param1> <param2> ... <CR>

On success, kwikwai answers with:

OK command <answer1> <answer2> ... <CR>

On failure, kwikwai answers with:

ERR command <error_id> <string> <CR>

where <string> is some text describing the error (this text can contains spaces).

Kwikwai may also send two sorts of asynchronous messages:
1) for logging messages (as controlled by the verbose command on serial/usb)

! <string>

As an example, the message provided to remember entering the password once connected through telnet :

! Password required

2) for events (as controlled by the listen command)

* command <data1> <data2>

A typical CEC message

* cec:message A 00:02:09.380 4F:82:10:00 #

A client may use the first char of the received message to determine the type of the data sent by Kwikwai.

List of available commands

enter the magic

password <password>

Enter the password (default value is "kwikwai").

password kwikwai
OK password

device information

version:get

Display the version of the firmware.

version:get
OK version:get 1.0r304

mac:get

Display the device mac address

mac:get
OK mac:get 00:50:C2:AD:80:00

bonjour

bonjour:get

Display the bonjour name (default value is "kwikwai").

bonjour:get
OK bonjour:get kwikwai

bonjour:set <bonjour_name>

Set the bonjour name. Name length is limited to 63 alphanumerical only characters.

bonjour:set mybelovedkwikwai
OK bonjour:set mybelovedkwikwai

netbios

netbios:get

Display the netbios name (default value is "KWIKWAI").

netbios:get
OK netbios:get KWIKWAI

netbios:set <netbios_name>

Set the netbios name. Name length is limited to 15 alphanumerical only characters.

netbios:set myprecious
OK netbios:set myprecious

network

ipsettings:get

Display the network settings configuration, DHCP or static, the ip address, mask, gateway and dns (the ip address, mask gateway and dns information is relevant only on static configurations).
Default value is DHCP.

ipsettings:get
OK ipsettings:get DHCP 192.168.10.200 255.255.255.0 192.168.10.1 192.168.10.1

ipsettings:set <"DHCP">|<"STATIC"> <ip> <mask> <gwy> dns>

Set the network settings configuration by defining DHCP or static, the ip address, mask, gateway and dns. It disconnects the telnet session if reconfigured.

ipsettings:set STATIC 192.168.1.100 255.255.255.0 192.168.1.1 192.168.1.1
OK ipsettings:set STATIC 192.168.1.100 255.255.255.0 192.168.1.1 192.168.1.1
Connection closed by foreign host.
unix$ 

ipconfig:get

Display the currently allocated ip address, mask, gateway and dns

ipconfig:get
OK ipconfig:get 192.168.1.61 255.255.255.0 192.168.1.1 192.168.1.1

time

time:local:get

Display the local time

 time:local:get
 OK time:local:get 15:06:50

time:local:set <HH:MM:SS>

Set the local time. This time configuration is overwritten by the sntp synchronization done once a day unless the server is disabled.

time:local:set 12:34:56
OK time:local:set 12:34:56

time:offset:get

Display the offset (in seconds) applied to the local time (default value is 0).

time:offset:get
OK time:offset:get 0

time:offset:set <offset_in_seconds>

Set the offset to change the local time by a certain number of seconds (useful when there is a difference between the time set by the SNTP server and the actual local time)

time:offset:set 3600
OK time:offset:set 3600

time:sntp:get

Display the sntp server (default value is "time.windows.com" as it seems to be the most commonly accepted server in "protected" environment).

time:sntp:get
OK time:sntp:get time.windows.com

time:sntp:set <server_name>

Set the sntp server name. The synchronization is done every 24 hours. Set an empty string to disable the sntp synchronization.
Name length is limited to 47, forbidden characters are controls, space and \ / : * ? " ; | and ".".

time:sntp:set time.apple.com
OK time:sntp:set time.apple.com

verbose

verbose:get

Display the verbose level (default value is 0).

verbose:get
OK verbose:get 0

verbose:set <0 | 1 | 2 | 3 | 4>

Set the verbose level.

verbose:set 4
OK verbose:set 4

messages

cec:listen:get

Display the listening state for CEC (default value is 0)

cec:listen:get
OK cec:listen:get 0

cec:listen:set <0 | 1 | >

Set the listening state for CEC. No parameter equals to 0.

cec:listen:set 1
OK cec:listen:set 1

cec:send [<bus_id>] <cec_string>

Send a CEC command on a bus. Currently only one bus is supported (bus_id = "A") and cec_string is byte:byte:byte...

cec:send A FF:36
OK cec:send A

ddc:read[<bus_id>] [<page_no>]

Read the DDC information on a bus. Currently only one bus is supported (bus_id = "A") and page_no is the ddc page number.

ddc:read
OK ddc:read A 0 00:ff:ff:ff:ff:ff:ff:00:4c:2d:79:05:00:00:00:00:0b:13:01:03:80:10
:09:78:0a:35:81:a6:56:48:9a:24:12:50:54:bf:ef:80:71:4f:81:40:81:80:a9:40:81:00:b3
:00:95:00:01:01:02:3a:80:18:71:38:2d:40:58:2c:45:00:a0:5a:00:00:00:1e:01:1d:00:bc
:52:d0:1e:20:b8:28:55:40:a0:5a:00:00:00:1e:00:00:00:fd:00

geek upgrade

reboot:upgrade

Reboot the device in the upgrade mode. The telnet session is disconnected and the device waits for a firmware file to be uploaded through XMODEM or the web interface.

reboot:upgrade
OK reboot:upgrade
Connection closed by foreign host.
unix$ 

goodbye cruel world

exit

Exit from the kwikwai shell.

exit
OK exit
Connection closed by foreign host.
unix$ 

Error codes

  1. Not authentified
  2. Unknown command
  3. Too many arguments (8 max.)
  4. Bad argument
  5. DDC time out