Using the console clients¶
Kanzi Monitor ships two command-line clients for its consoles. Use them to send any Kanzi Monitor command to a running application by hand, or from a script.
The RemoteConsoleClient connects to the remote console over TCP. The remote console is on by default (
RemoteConsoleEnabled = 1) and listens on port56000.The SerialConsoleClient connects to the serial console over a serial port (UART), for targets without a network connection. The serial console is off by default; turn it on with
SerialConsoleEnabled = 1.
Each client works interactively, as a command prompt, or sends a single command with -c, prints the response and exits, for scripting and CI automation. Both are standalone applications with no Kanzi dependency.
All platform packages include prebuilt clients for Windows (-win64.exe) and Linux (-linux-x86_64), under tools/RemoteConsoleClient/bin/ and tools/SerialConsoleClient/bin/, and their source code under tools/.
The consoles themselves, their configuration and the protocol they speak are described in Using the Command Processor service.
Using the RemoteConsoleClient¶
The RemoteConsoleClient is a standalone console application for Windows and Linux for connecting to the remote console. Prebuilt executables are included in all platform packages under tools/RemoteConsoleClient/bin/.
RemoteConsoleClient-win64.exe [options] [serverAddress] [port]
The default server address is 127.0.0.1 and the default port is 56000.
Options:
-c,--command <cmd>– Send a single command and exit (non-interactive mode).-h,--help– Show usage information.
Interactive mode (default) – The client connects and enters an interactive session:
Disconnected state – The client shows the prompt RemoteConsole> and accepts these local commands:
connect– Attempt to connect to the server.exit– Quit the client.help– Show usage help.
Connected state – The client shows the prompt Enter Command > and sends all input to the server. Two local commands are handled by the client:
disconnect– Close the connection and return to disconnected state.exit– Quit the client.
The client automatically attempts to connect on startup. If the connection fails, it enters the disconnected state where you can retry with the connect command.
To connect to an application in the Android Emulator, forward the port first. See Connecting to Android Emulator.
Single-command mode – When invoked with -c, the client connects, sends the command, prints the response to stdout, and exits. Before the response, stdout carries a Connecting to <host>:<port> line. The exit code is 1 when the client cannot connect, or when sending the command or reading the response fails, and 0 otherwise: a command that the server refuses or does not know still exits with 0, so check the response for the result. This is useful for scripting and CI automation.
# Send a single command and exit
RemoteConsoleClient-win64.exe -c "overwatch.status"
# Single command to a remote host
RemoteConsoleClient-win64.exe 192.168.1.100 56000 -c "kzinfo"
Using the SerialConsoleClient¶
The SerialConsoleClient is a standalone console application for Windows and Linux for connecting to the serial console. Prebuilt executables are included in all platform packages under tools/SerialConsoleClient/bin/.
SerialConsoleClient-win64.exe [options] [portName] [baudRate]
The default port is COM3 on Windows and /dev/ttyUSB0 on Linux. The default baud rate is 115200.
Options:
-c,--command <cmd>– Send a single command and exit (non-interactive mode).-h,--help– Show usage information.
The client uses the same command protocol and user interface as the RemoteConsoleClient, including support for single-command mode:
Disconnected state – The client shows the prompt SerialConsole> and accepts these local commands:
connect– Open the serial port.exit– Quit the client.help– Show usage help.
Connected state – The client shows the prompt Enter Command > and sends all input over the serial port. Two local commands are handled by the client:
disconnect– Close the serial port and return to disconnected state.exit– Quit the client.
Single-command mode – When invoked with -c, the client opens the serial port, sends the command, prints the response to stdout, and exits. The exit code is 1 when the client cannot open the port, or when sending the command or reading the response fails, and 0 otherwise: a command that the server refuses or does not know still exits with 0, so check the response for the result.
SerialConsoleClient-win64.exe COM5 115200 -c "overwatch.status"
Building the console clients from source¶
The RemoteConsoleClient and SerialConsoleClient source code and CMake projects are included under tools/.
To build both console clients from source on Windows:
scripts\build_tools.bat vs2022 Release
To build both console clients from source on Linux:
scripts/build_tools.sh Release
The built executables are placed in tools/bin/.