NexTTool manual

From ZENotes
(Difference between revisions)
Jump to: navigation, search
m (Protected "NexTTool manual" [edit=autoconfirmed:move=autoconfirmed])
 
m (1 revision)
 

Latest revision as of 20:49, 14 October 2011

NeXTTool Documentation by J.Hansen, with brief adaptation for Linux - - Anything below was tried & tested on Fedora7 on a DualCore Workstation and a Tiny Old Laptop

Contents

NeXTTool - USB & Bluetooth NXT communication utility

NexTTool by J.Hansen is a handy tool to do all sort of things on your brick; the full list may be apprehended by browsing the Help file below, you'll find the complete set of instructions that are available with NexTTool. For it to be of any use to you, you sure need your USB connectivity sorted out between your GNU/Linux machine & your Brick, and your machine connected to the brick: may I recommend you look Nxt::usb or Success Story or even better, the original NXTasy post here first if it's not yet the case? You can come back later, I am not moving from here!

Getting NexTTool:

Save it (righ-click) from here or download from here;

Extract/copy to wherever suits you best not to mess up with your file/folder architecture.

Either work from the folder you put NexTTool into, always starting with ./NexTTool, or link it to your /usr/bin executables folder with:

ln -s ./NexTTool /usr/bin/nexttool       (from the folder you copied NexTTool into, for sure)

Since NaxTTool is quite Anti-Linux in it's name, I, bluntly, renamed it to nexttool on my machine.


NeXTTool version 1.0 (1.0.3.5, built May 11 2006 17:54:00)

Copyright (c) 2006 John Hansen (supposedly, it's Mozilla Public Licence; why is there a C here then? Gotta check)

Usage: NeXTTool [options] [actions]

Options:

  /COM=port: specify port name (COMn, usb, resource string, or alias) Most likely, just type /COM=USB here or /COM=usb and it should be enough

  /BT[=name]: use bluetooth (selects the first brick found or the named brick)
  /HEX: use hexidecimal for numeric output

  /Duration=<n>: specify the tone duration for the playtone action; Durations are in MILLISECONDS so a two second sound is /Duration=2000 
  /Inbox=<n>: use inbox number n when sending or reading a message
  /Loop: loop when playing sound files
  /Relative: reset output position relative
  /Empty: empty mailbox when reading

Actions:

  -listbricks : list resource names of all found NXT bricks
  -clear : erase all items on the brick
  -battery : return the battery level
  -input=<N> : read input N (0-2, 0-3 for NXT)
  -output=<N> : read the status of output N (0-2)
  -mute : stop playing sounds
  -playtone=<frequency> : play a tone for the specified duration
  -run=<filename> : run the specified program
  -runningprogram : return the name of the currently running program
  -stop : stop the currently running program
  -playfile=<filename> : play the specified sound file
  -firmware=<filename> : download firmware
  -download=<filename> : download the specified file to the NXT
  -upload=<filename> : upload the specified file from the NXT
  -listfiles[=<pattern>] : list the files matching the pattern (or *.*)
  -listmodules[=<pattern>] : list the modules matching the pattern (or *.*)
  -delete=<filename> : delete the specified file from the NXT
  -keepalive : return the current sleep time limit
  -msg=<string> : send the specified message to the NXT
  -msgread=<box> : read the message from the specified box
  -resetoutputposition=<port> : reset the position for the specified port
  -resetinputsv=<port> : reset the input scaled value for the specified port
  -setname=<new_name> : set the name of the NXT
  -getname : return the name of the NXT
  -versions : return the NXT firmware and protocol versions
  -deviceinfo : return all NXT device information
  -freemem : return the amount of free memory
  -lsstatus=<port> : return the low speed status for the specified port
  -btnstate=<btn> : return the button state for the specified button
  -resetbtnstate=<btn> : reset the button state for the specified button
  -boot : reset the NXT into SAMBA mode (usb only)
  -btreset : reset the NXT bluetooth to factory settings (usb only)

Help:

  -help : display command line options

Real-Life Samples & notes

Samples are USB only; if you have a working BT connection then just replace the /COM=USB by the appropriate /BT string. The below samples assumes that you have renamed NexTTool to nexttool, and that it is symlinked to an executable folder that is in your user's path; there is no need to do all this as root if you followed appropriately the Nxt::usb instructions. If you did not moved/linked NexTTool somewhere more practical, then just start the commands with ./ from the folder where NexTTool resides. And if you choose not to rename it to nexttool, well, may your wrists and hands ligaments Rest In Peace.

All the Below Commands where TRIED AS I TYPED THEM on my Fedora7 workstation

nexttool /COM=usb -stop
nexttool /COM=usb -battery
nexttool /COM=usb /Duration=2000 -playtone=440

Well, that should be enough for you to grab the logic of NexTTool commands; There is sure quite a few things that are really non-Linux, the abusive use of Block Letters first comes to mind, and the way of issuing commands, passing arguments that does not follow the -[brief, abreviated Command] or --[full name of command] useage we are familiar with, followed by a space " " and then the parameter; (like, for instance, rm -Rf /somefolder would do). A slightly annoying detail is that NexTTool exits without any output if there's nothing to say OR if there's a problem somewhere. That's bad.

So, beware of the trap: commands are all literal (no short versions) preceded by an unique -, and parameter is linked to the command name with an = sign.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox