Granted all possible issues with SSH, especially in the remote and/or
proxied labs, and possible issues with the board being present but
failing to power up, it is useful to have a banner message once CDBA was
started. This gives user a clear picture that the connection is fine and
the server is trying to power up the board.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
We use the CDBA_USER value as a way to pass info from cdba-shell to
cdba-server. However if it is not provide (e.g. because the cdba-server
is started directly by shell) add a fallback to the system's USER
variable. And if that's also not set, provide a safe default of
'nobody'.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Introduce description of the status fifo, the status command, and the
data format for these in the README.
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
Leaving USB connected might cause hickups on the USB bus, and causes
power measurements to report incorrect data. Turn it off once the image
has been downloaded.
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
While the CDB Assist and QcomLT Debugboard is measuring voltage and
current on the DC jack directly in the backend, other backends and
further measurements can be performed using custom tooling.
Introduce support for invoking an external "status-cmd" to produce such
status updates.
The status command should on its stdout produce json-formatted status
updates following the same format as the cdba-server:
{"ts":%d.%03d, "name": {["mv"|"ma"]: %u}(, "name2": {["mv"|"ma"]: %u})*}
with the ts aquired using clock_gettime(CLOCK_MONOTONIC) and provided in
seconds and milliseconds since the first measurement.
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
The QcomLT DebugBoard has a voltage and current sensor on the 12V DC
line, which the firmware will measure upon request.
Add a periodic request for this information, parse out the responses and
report using the status helper functions.
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
The updated format and behavior of the status messages is not useful for
human consumption in the console stream, but rather for programatical
consumption by 3rd party tools.
Switch the status message stream to an optional fifo, which can be
consumed separately from the console - by humans or by tools.
The fifo is created and opened and status messages requested, if the
'-s <file>' option is specified.
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
The MSG_STATUS_UPDATE message when sent from the client to the server,
has until now indicated a request for a single status update. This was
suitable when the update was for human consumption on occasional basis.
But with the transition to producing status messages for programatical
consumption it makes more sense to just keep the stream on, without the
client having to poll the server for updates. This can in particular
keep the external "status command" mechanism simpler.
Just enabling the stream of status updates would spam the console with
status updates for those users that hasn't updated their clients, so the
client needs to opt-in to the status stream.
Repurpose the status update message (sent from the client) to indicate
that the streaming of status updates should be enabled.
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
The current format of the cdb_assist backend status messages was never
intended to be parsed by a non-human, and the format doesn't extend well
to other backends.
Extend the format to be formatted as a json string, with a timestamp,
implemented in a separate status module.
The button status is skipped from the new status message, as it reflect
the output-values as set by cdba itself, rather than any measured state.
The timestamp is offset to the first measurement, to avoid disclosing
the uptime of the machine cdba-server is running on.
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
I plan to package CDBA in alpine, as it uses musl libc it is a lot
easier for things to break there. Add alpine latest edge and stable
build tests to catch these.
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Enabling -Werror by default sucks for everyone who isn't maintaining
CDBA. By all means we should enable it in CI, but not for users and
not for folks packaging it in distros.
Remove it from the flags in meson.build, and use mesons built in option
to enable it only in CI.
See:
https://embeddedartistry.com/blog/2017/05/22/werror-is-not-your-friend/
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Now local_gpio has landed, also accept a more verbose
and cleaner yaml config syntax for ftdi_gpio.
For now keep support for the current configuration string.
Closes: #42
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>