LABGRID-CLIENT(1)
π LABGRID-CLIENT(1) π
hi bestie π this is labgrid-client(1), straight out of the labgrid manual. It's a big one β part 1 of 2, so don't go anywhere, we are not done.
π NAME π
labgrid-client β labgrid's client interface to control boards π
okay so Labgrid is a scalable infrastructure and test architecture for embedded (linux) systems. That's the whole concept, no cap.
And this thing right here? This is the client you use to control a board's status and interface with it on remote machines. It's giving remote-control queen π
π LABGRID-CLIENT π
Here's the shape of the whole thing:
usage: labgrid-client [-x ADDRESS] [-c CONFIG] [-p PLACE] [-s STATE]
[-i INITIAL_STATE] [-d] [-v] [-P PROXY]
COMMAND ...
These are your global flags β the ones that apply before the COMMAND even shows up β¨
-x<address>,--coordinator<address> β the coordinator, asHOST[:PORT]. Default comes from the env variableLG_COORDINATOR, and if that's not set, you get127.0.0.1:20408.-c<config>,--config<config> β env config file. Default comes from the env variableLG_ENV.-p<place>,--place<place> β place name or alias. Default comes from the env variableLG_PLACE.-s<state>,--state<state> β strategy state to switch into before the command runs. Default comes from the env variableLG_STATE.-i<initial_state>,--initial-state<initial_state> β strategy state to force into before switching to the desired state.-d,--debugβ enable debug mode, aka show python tracebacks π-v,--verboseβ verbose mode.-P<proxy>,--proxy<proxy> β proxy connections via the given ssh host.
π labgrid-client acquire|lock
acquire a place π
usage: labgrid-client acquire|lock [--allow-unmatched]
--allow-unmatchedβ allow missing resources for matches when locking the place.
π·οΈ labgrid-client add-alias
add an alias to a place.
usage: labgrid-client add-alias alias
- <alias> β the alias.
β labgrid-client add-match
add one (or multiple) match pattern(s) to a place.
usage: labgrid-client add-match PATTERN [PATTERN ...]
- <pattern> β the match pattern(s).
π labgrid-client add-named-match
add one match pattern with a name to a place.
usage: labgrid-client add-named-match PATTERN NAME
- <pattern> β the match pattern.
- <name> β the name.
π«Ά labgrid-client allow
allow another user to access a place. Sharing is caring fr.
usage: labgrid-client allow user
- <user> β
<host>/<username>.
π labgrid-client audio
start an audio stream π§
usage: labgrid-client audio [--name NAME]
--name<name>,-n<name> β optional resource name.
π₯Ύ labgrid-client bootstrap
start a bootloader.
usage: labgrid-client bootstrap [-w WAIT] [--name NAME] filename ...
- <filename> β filename to boot on the target.
- <arg> β extra bootstrap arguments.
-w<wait>,--wait<wait> β wait time.--name<name>,-n<name> β optional resource name.
β labgrid-client cancel-reservation
cancel a reservation. bye reservation π
usage: labgrid-client cancel-reservation [token]
- <token> β the reservation token.
π₯οΈ labgrid-client console|con
connect to the console β¨
usage: labgrid-client console|con [-l] [-o] [--logfile FILE] [name]
- <name> β optional resource name.
-l,--loopβ keep trying to connect if the console is unavailable. Stubborn on purpose, we love her.-o,--listenonlyβ do not modify local terminal, do not send input from stdin. Just vibes, no typing.--logfile<file> β log output toFILE.
π± labgrid-client create
add a new place, with the name specified via --place or the LG_PLACE environment variable.
usage: labgrid-client create
ποΈ labgrid-client del-alias
delete an alias from a place.
usage: labgrid-client del-alias alias
- <alias> β the alias.
βοΈ labgrid-client del-match
delete one (or multiple) match pattern(s) from a place.
usage: labgrid-client del-match PATTERN [PATTERN ...]
- <pattern> β the match pattern(s).
π₯ labgrid-client delete
delete an existing place. gone, reduced to atoms.
usage: labgrid-client delete
β‘ labgrid-client dfu
communicate with a device in DFU mode.
usage: labgrid-client dfu [--wait WAIT] [--name NAME]
{download,detach,list} [altsetting] [filename]
- <action> β action.
- <altsetting> β altsetting name or number (
download,detachonly). - <filename> β file to write into device (
downloadonly). --wait<wait> β wait time.--name<name>,-n<name> β optional resource name.
π labgrid-client env
generate a labgrid environment file for a place π¦
usage: labgrid-client env
π¦ labgrid-client export
export driver information to a file (needs an environment with drivers).
usage: labgrid-client export [--format {shell,shell-export,json}] filename
- <filename> β output filename.
--format{shell,shell-export,json}β output format (default:shell-export).
π labgrid-client fastboot
run fastboot.
usage: labgrid-client fastboot [--wait WAIT] [--name NAME] ...
- <arg> β fastboot arguments.
--wait<wait> β wait time.--name<name>,-n<name> β optional resource name.
π₯ labgrid-client flashscript
Run an arbitrary script with arguments to flash the device.
usage: labgrid-client flashscript [--name NAME] script ...
- <script> β flashing script.
- <arg> β script arguments.
--name<name>,-n<name> β optional resource name.
π labgrid-client forward
forward a local port to the remote target.
usage: labgrid-client forward [--name NAME] [--local [LOCAL:]REMOTE]
[--remote REMOTE:LOCAL]
--name<name>,-n<name> β optional resource name.--local,-Lβ forward local portLOCALto remote portREMOTE. IfLOCALis unspecified, an arbitrary port will be chosen.--remote,-Rβ forward remote portREMOTEto local portLOCAL.
π labgrid-client io
change (or get) a digital IO status.
usage: labgrid-client io {high,low,get} [name]
- <action> β action.
- <name> β optional resource name.
π labgrid-client monitor
monitor events from the coordinator. Live updates, main character energy π‘
usage: labgrid-client monitor
πΈοΈ labgrid-client netns
start a network namespace with access to NetworkInterface.
usage: labgrid-client netns [--name NAME] [--address ADDRESS]
[--mac-address MAC_ADDRESS] [--nsenter [NSENTER]]
...
- <cmd> β command to execute in the namespace. If unspecified,
$SHELLis invoked. --name<name>,-n<name> β optional resource name.--address<address>,-a<address> β assign address to interface (CIDR notation).--mac-address<mac_address> β assign MAC address to interface.--nsenter<nsenter>,-e<nsenter> β create nsenter wrapper script.
π labgrid-client places|p
list available places.
usage: labgrid-client places|p [-a] [-r] [--sort-last-changed]
-a,--acquiredβ only acquired places.-r,--releasedβ only released places.--sort-last-changedβ sort by last changed date (oldest first).
β‘ labgrid-client power|pw
change (or get) a place's power status. cut the power, iconic.
usage: labgrid-client power|pw [-t DELAY] [--name NAME] {on,off,cycle,get}
- <action> β action.
-t<delay>,--delay<delay> β wait time in seconds betweenoffandonduringcycle.--name<name>,-n<name> β optional resource name.
π labgrid-client release-from
atomically release a place, but only if it's locked by a specific user.
usage: labgrid-client release-from HOST/USER
- <host/user> β user and host to match against when releasing.
ngl, important: this command returns success as long as the specified user no longer owns the place β meaning it may be acquired by another user, or not at all. So success here does not mean "you got it, bestie" π
π labgrid-client release|unlock
release a place.
usage: labgrid-client release|unlock [-k]
-k,--kickβ release a place even if it is acquired by a different user. yes, we're kicking them out π
π labgrid-client reservations
list current reservations.
usage: labgrid-client reservations
ποΈ labgrid-client reserve
create a reservation.
usage: labgrid-client reserve [--wait] [--shell] [--prio PRIO]
KEY=VALUE [KEY=VALUE ...]
- <key=value> β required tags.
--waitβ wait until the reservation is allocated.--shellβ format output as shell variables.--prio<prio> β priority relative to other reservations (default0).
π§© labgrid-client resources|r
list available resources.
usage: labgrid-client resources|r [-a] [-e EXPORTER]
[--sort-by-matched-place-change]
[match]
- <match> β the match.
-a,--acquiredβ only acquired.-e<exporter>,--exporter<exporter> β the exporter.--sort-by-matched-place-changeβ sort by matched place's changed date (oldest first) and show place and date.
π labgrid-client rsync
transfer files via rsync.
usage: labgrid-client rsync [--name NAME] src dst
- <src> β source path (use
:dir/filefor remote side). - <dst> β destination path (use
:dir/filefor remote side). --name<name>,-n<name> β optional resource name.
Additional arguments are passed to the rsync subprocess.
π€ labgrid-client scp
transfer a file via scp.
usage: labgrid-client scp [--name NAME] src dst
- <src> β source path (use
:dir/filefor remote side). - <dst> β destination path (use
:dir/filefor remote side). --name<name>,-n<name> β optional resource name.
ποΈ labgrid-client sd-mux
switch USB SD Muxer, or get the current mode.
usage: labgrid-client sd-mux [--name NAME] {dut,host,off,client,get}
- <action> β action.
--name<name>,-n<name> β optional resource name.
π¬ labgrid-client set-comment
update the place comment.
usage: labgrid-client set-comment comment [comment ...]
- <comment> β the comment.
π·οΈ labgrid-client set-tags
update the place tags.
usage: labgrid-client set-tags KEY=VALUE [KEY=VALUE ...]
- <key=value> β use an empty value for deletion.
π labgrid-client show
show a place and related resources.
usage: labgrid-client show
ποΈ labgrid-client ssh
connect via ssh (with optional arguments).
usage: labgrid-client ssh [--name NAME]
--name<name>,-n<name> β optional resource name.
Additional arguments are passed to the ssh subprocess.
ποΈ labgrid-client sshfs
mount via sshfs (blocking).
usage: labgrid-client sshfs [--name NAME] path mountpoint
- <path> β remote path on the target.
- <mountpoint> β local path.
--name<name>,-n<name> β optional resource name.
βοΈ labgrid-client telnet
connect via telnet.
usage: labgrid-client telnet
π¬ labgrid-client tmc
control a USB TMC device.
usage: labgrid-client tmc [--name NAME] SUBCOMMAND ...
--name<name>,-n<name> β optional resource name.
πΊ labgrid-client tmc channel
use a channel.
usage: labgrid-client tmc channel channel {info,values}
- <channel> β the channel.
- <action> β action.
β¨οΈ labgrid-client tmc cmd|c
execute a raw command.
usage: labgrid-client tmc cmd|c command [command ...]
- <command> β the command.
β labgrid-client tmc query|q
execute a raw query.
usage: labgrid-client tmc query|q query [query ...]
- <query> β the query.
πΈ labgrid-client tmc screen
show or save a screenshot.
usage: labgrid-client tmc screen {show,save}
- <action> β action.
π labgrid-client usb-mux
switch USB Muxer.
labgrid-client usb-mux π
okay so this one switches which side of the USB mux is connected, bestie β¨
usage: labgrid-client usb-mux [--name NAME]
{off,dut-device,host-dut,host-device,host-dut+host-device}
links π
--name<name>,-n<name> β optional resource name π
labgrid-client version π·οΈ
just tells you what version you're on, short and sweet fr fr
usage: labgrid-client version
labgrid-client video π₯
starts a video stream, main character moment for your camera ngl πΈ
usage: labgrid-client video [-q QUALITY] [-c CONTROLS] [--name NAME]
-q<quality>,--quality<quality> β pick a video quality (pass'list'to see all the options, iykyk) β¨-c<controls>,--controls<controls> β configure v4l controls, like this:'focus_auto=0,focus_absolute=40'π--name<name>,-n<name> β optional resource name π«Ά
labgrid-client wait β³
waits around (patiently, like a good bestie) for a reservation to be allocated π
usage: labgrid-client wait [token]
- token β the token you're waiting on
labgrid-client who π΅οΈββοΈ
lists which places have been acquired, by user π
usage: labgrid-client who [-e]
-e,--show-exportersβ also show the exporters each place is currently using β¨
labgrid-client write-files π
copies files onto a mass storage device, no cap πΎ
usage: labgrid-client write-files [OPTION]... -T SOURCE DEST
labgrid-client write-files [OPTION]... [-t DIRECTORY] SOURCE...
- source β source file(s) to copy π
- dest β destination file name for SOURCE
-w<wait>,--wait<wait> β storage poll timeout in seconds β°-p<0-255>,--partition<0-255> β partition number to mount, or0to mount the whole disk (default:1) ποΈ-t<directory>,--target-directory<directory> β copy all SOURCE files into DIRECTORY (default: partition root) πΈ-Tβ copy the SOURCE file and rename it to DEST β¨--name<name>,-n<name> β optional resource name π
labgrid-client write-image πΌοΈ
writes an image onto mass storage, glow-up incoming π₯
usage: labgrid-client write-image [-w WAIT] [-p PARTITION] [--skip SKIP]
[--seek SEEK] [--mode {dd,bmaptool}]
[--name NAME]
filename
- filename β filename to boot on the target π
-w<wait>,--wait<wait>-p<partition>,--partition<partition> β partition number to write to ποΈ--skip<skip> β skip n 512-sized blocks at start of input βοΈ--seek<seek> β skip n 512-sized blocks at start of output βοΈ--mode {dd,bmaptool}β choose the tool for writing images (default:dd) π οΈ--name<name>,-n<name> β optional resource name π
π CONFIGURATION FILE π
The configuration file follows the description in labgrid-device-config(5). periodt π
β¨ ENVIRONMENT VARIABLES β¨
Various labgrid-client commands use the following environment variable, bestie β lowkey important, don't skip these π«Ά
LG_PLACE
This variable can be used to specify a place without using the -p option, the -p option overrides it. π
LG_TOKEN
This variable can be used to specify a reservation for the wait command and for the + place expansion. ποΈ
LG_STATE
This variable can be used to specify a state which the device transitions into before executing a command. Requires a configuration file and a Strategy specified for the device. πΈ
LG_INITIAL_STATE
This variable can be used to specify an initial state the device is known to be in. This is useful during development. The Strategy used must implement the force() method. A desired state must be set using LG_STATE or -s/--state. π§
LG_ENV
This variable can be used to specify the configuration file to use without using the --config option, the --config option overrides it. π
LG_COORDINATOR
This variable can be used to set the default coordinator in the format HOST[:PORT] (instead of using the -x option). π°οΈ
LG_PROXY
This variable can be used to specify a SSH proxy hostname which should be used to connect to the coordinator and any resources which are normally accessed directly. π
LG_HOSTNAME
Override the hostname used when accessing a resource. Typically only useful for CI pipelines where the hostname may not be consistent between pipeline stages. π₯οΈ
LG_USERNAME
Override the username used when accessing a resource. Typically only useful for CI pipelines where the username may not be consistent between pipeline stages. πββοΈ
LG_SSH_CONNECT_TIMEOUT
Set the connection timeout when using SSH (The ConnectTimeout option). If unspecified, defaults to 30 seconds. β°
LG_AGENT_PREFIX
Add a prefix to .labgrid_agent_{agent_hash}.py allowing specification for where on the exporter it should be uploaded to. π€
π¦ MATCHES π¦
Match patterns are used to assign a resource to a specific place, fr fr. The format is: exporter/group/cls/name β exporter is the name of the exporting machine, group is a name defined within the exporter, cls is the class of the exported resource and name is its name. Wild cards in match patterns are explicitly allowed β * matches anything. β¨
π ADDING NAMED RESOURCES π
If a target contains multiple Resources of the same type, named matches need to be used to address the individual resources. In addition to the match taken by add-match, add-named-match also takes a name for the resource. The other client commands support the name as an optional parameter and will inform the user that a name is required if multiple resources are found, but no name is given. π
If one of the resources should be used by default when no resource name is explicitly specified, it can be named default. π
π EXAMPLES π
To retrieve a list of places run:
$ labgrid-client places
To access a place, it needs to be acquired first, this can be done by running the acquire command and passing the placename as a -p parameter:
$ labgrid-client -p <placename> acquire
Open a console to the acquired place:
$ labgrid-client -p <placename> console
Add all resources with the group "example-group" to the place example-place:
$ labgrid-client -p example-place add-match */example-group/*/*
π SEE ALSO π
π AUTHOR π
Jan Luebbe, Rouven Czerwinski
π COPYRIGHT π
2016-2025 Pengutronix, Jan Luebbe and Rouven Czerwinski
and that's a wrap bestie, you ate this whole page fr fr π«Ά this is the LABGRID-CLIENT(1) manual, dated 2025, and it's living its best life in the labgrid source tree β¨ go forth and slay your hardware π
π
π¦ where this page comes from
- ubuntu stonking: labgrid-client 26.0-2 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms