nxtrc(1)

πŸ“¦ version 2.3, in fedora 43, fedora 44

πŸ’– 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 the BTADDR Environment Variable isn't set to the address.
  • -b β€” Get Battery Level πŸ”‹
  • -d FILE β€” Delete FILE frome 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 the PATTern if present (e.g. -l*.rxe). N.B. No spaces between -l and PATT! see at the end the patterns allowed πŸ‘€
  • -m FILE β€” Play sound file FILE once πŸ”Š
  • -M FILE β€” Play sound file FILE indefinitely πŸ”
  • -n NAME β€” Set NXT name to NAME 🏷️
  • -p FILE β€” Run Program FILE on NXT ▢️
  • -r FILE β€” Read FILE frome NXT and save it in the working directory. If FILE is 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 β€” Write FILE on NXT. If FILE is already present it asks for permission to overwrite πŸ™ˆ
  • -W FILE β€” Same as -w but forcing overwrite if FILE exists 😀
  • -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