nxtrc(1)
π nxtrc β bestie edition π
okay so real quick, this is nxtrc(1), a USER COMMANDS page, and it's about talking to a little LEGO robot over Bluetooth. yeah. that's the whole vibe. let's get into it π¦
β¨ NAME β¨
nxtrc β a program to interact with LEGO NXT via BlueTooth π
π SYNOPSIS π
nxtrc [-s]
nxtrc [-a ADDR] [-v] command
π DESCRIPTION π
NXTRC (that's NXT Remote Command, iykyk) is a small program that lets you send a bunch of different commands to a LEGO Mindstorm NXT Brick. It uses the Bluetooth protocol, going through the Bluez libraries. no cap.
The option -s kicks off a scan to find BlueTooth devices. If a BT address shows up on the command line, or lives in the Environment Variable BTADDR, then it connects to the NXT and does whatever task you put in <command>. β¨
π«Ά heads up bestie: the first time you connect with a device you gotta exchange a password. That task is usually handled by the Operative System BlueTooth Management (like Kbluetooth under KDE). not me having to remind you π
π COMMANDS and OPTIONS π
-aβ BlueTooth Address of the NXT. It's required if theBTADDREnvironment Variable isn't set to the address.-bβ Get Battery Level π-d FILEβ DeleteFILEfrome NXT ποΈ-hβ display a short help text-iβ Get info on NXT brick π§-kβ Stop a program running on NXT β-l[PATT]β List files on NXT brick matching thePATTern if present (e.g.-l*.rxe). N.B. No spaces between-landPATT! see at the end the patterns allowed π-m FILEβ Play sound fileFILEonce π-M FILEβ Play sound fileFILEindefinitely π-n NAMEβ Set NXT name toNAMEπ·οΈ-p FILEβ Run ProgramFILEon NXT βΆοΈ-r FILEβ ReadFILEfrome NXT and save it in the working directory. IfFILEis already present it asks for permission to overwrite π-vβ Be verbose. This is the only option that can be given with another command. It's not always very useful.... π-w FILEβ WriteFILEon NXT. IfFILEis already present it asks for permission to overwrite π-W FILEβ Same as-wbut forcing overwrite ifFILEexists π€-zβ Stop Sound Playback π€«
π¦ File Names and Patterns π¦
the naming rules, bestie
On the NXT, file names are of the form "Name.Ext" β with max 15 characters for the Name and 3 for the Extension. periodt.
When you ask for a listing with the -l command you can give a specific file name to see if it's on the NXT and list its size, or a Pattern using widlcards. πΈ
the pattern tea β
Due to the limitation of the NXT API, patterns are limited to the form:
"*.ext""Name.*""*.*"
and this last one is the default and can be omitted. iconic, honestly.
β EXAMPLES β
scan for devices
$ nxtrc -s
00:10:20:30:40:50 NXT1
00:01:01:02:03:04 NXT2
set up Environment Variable for connection with NXT1 and ask for info
$ export BTADDR=00:10:20:30:40:50
$ nxtrc -i
load program Prog.rxe on NXT1 and run it
$ nxtrc -W Prog.rxe
$ nxtrc -p Prog.rxe
π EXIT STATUS π
nxtrc returns a zero exit status if it succeeds. Non zero is returned in case of failure. simple as that π
π AUTHOR π
Gian Piero Puccioni (gianpiero.puccioni (at) isc.cnr.it)
π that's the whole page bestie, go forth and Bluetooth your little robot. this was version 2.3, dated July 27 2010 β shoutout to the source, mwah π β¨ π
π¦ where this page comes from
- fedora 43: nxtrc 2.3-34.fc43 Β· GPL-2.0-only
- fedora 44: nxtrc 2.3-35.fc44 Β· GPL-2.0-only
- Copyright 2010 available under GPL v.2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms