02 General: Using Droid and Remote Software - bjoerngiesler/BBDroids GitHub Wiki

Console

A Console (term taken from Unix lingo) is a command line tool providing access to the inner workings of a software system. LibBB droids all offer at least a Serial Console, which is available using the USB port on the microcontroller and can be accessed with Arduino's Serial Monitor, PlatformIO's Terminal window or other serial terminals.

Most LibBB droids also offer a console accessible via Wifi and a Telnet application or similar. You can access this console by connecting to the access point the droid offers, and telnet'ing to the port specified. Default access point SSID and password as well as telnet ports can be taken from the config.h source file.

Opening the console: Visual Studio Code

In Visual Studio Code, the Serial Monitor hides behind the small "connector" item that can be found in the top right of the each window, nestled between the build selector and the split pane icon, and also at the very bottom of the window next to a host of practical build icons. Look for something that resembles a two-prong power plug with the prongs sticking up and the cable coming down. You can also get to the console with the hotkey combination Ctrl-Alt-S.

The VS Code console is a "proper" terminal emulator, where you type commands inline with the connected system's output.

Opening the console: Arduino IDE

In the Arduino IDE, the Serial Monitor can be found in the "Tools" menu, or using Alt-Shift-S. This serial monitor has two separate "send" and "receive" windows, you type your commands into the "send" part and get replies in the "receive" part.

Command line editing

There are two ways serial terminal applications customarily interact with their counterpart: Line mode (used by Arduino's Serial Monitor) or character mode (used by PlatformIO's Terminal or others). In line mode, you can enter and edit a line of text (e.g. a command) on the terminal application and then push a button or return to send the complete line to the droid. In character mode, each character gets sent individually and immediately, so line editing has to be done by intercepting the backspace and cursor keys. For convenience in "proper" terminal apps, LibBB's console at the moment only supports character mode, which means if you use line mode you will see some weird output ("> h> he> hel> help" when you send a line of "help") as the console interprets each character individually. This is cosmetic and not a problem, the line is interpreted exactly the same at the end.

Top-level commands

Enter these on the command line after the > prompt, followed by Return.

  • help: Prints a help text.
  • status: Shows all the registered subsystems and their status.
  • start: Start all non-started subsystems.
  • stop: Stop all started subsystems.
  • store: Store all settings to flash.
  • reset: Reset all stored settings to their hardcoded defaults. Note not implemented yet on the droids, only on the remotes

Subsystem commands

Enter these in the form SUBSYS COMMAND PARAMETERS..., i.e. the subsystem name must be the first word on a line. Example: wifi help.

  • SUBSYS help: Prints a help text, including the individual commands that a subsystem understands. Ususally this also prints all the parameters a subsystem offers for setting, including their values.
  • SUBSYS status: Prints the status of the subsystem, i.e. if it is started or not, and often a brief status of its inner workings.
  • SUBSYS start: Starts the subsystem.
  • SUBSYS stop: Stops the subsystem.
  • SUBSYS set PARAMETER VALUE: Sets a parameter the subsystem offers to the given value. Please refer to SUBSYS help for the list of parameters and their ranges.

There may be other commands each subsystem understands, depending on the subsystem in question. SUBSYS help will give a summary of those commands.