ESPShell can be configured before compilation by adjusting shell settings, which are macro definitions located at the beginning of the espshell.h file. These macros have default values, which are also the recommended settings for the average user.
#ifndef espshell_h #define espshell_h // Code version, don’t change. #define ESPSHELL_VERSION "0.99.8" // -- Compile-time ESPShell settings -- // #define AUTOSTART 1 #define STACKSIZE (5 * 1024) #define WITH_HELP 1 #define WITH_HISTORY 1 #define HIST_SIZE 20 #define WITH_ESPCAM 1 #define WITH_VAR 1 #define STARTUP_ECHO 1 #define WITH_COLOR 1 #define AUTO_COLOR 1 #define WITH_FS 1 #define MOUNTPOINTS_NUM 5 #define WITH_SPIFFS 1 #define WITH_LITTLEFS 1 #define WITH_FAT 1 #define WITH_SD 1 #define DIR_RECURSION_DEPTH 127 #define SEQUENCES_NUM 10 #if ARDUINO_USB_CDC_ON_BOOT # define SERIAL_IS_USB 1 # define STARTUP_PORT 99 #else # define SERIAL_IS_USB 0 # define STARTUP_PORT UART_NUM_0 #endif ... ...
The table below describes all ESPShell compile-time settings, along with two columns: "H" (for "Human") and "M" (for "Machine").
The "H" column lists recommended values for human users (e.g. you), while the "M" column lists recommended values for automated shell access.
By "automated access", we mean cases where another piece of software and/or hardware sends commands to ESPShell and processes the responses.
Settings | Human | Machine | Meaning |
---|---|---|---|
AUTOSTART | 1 | 1 | Set to 0 for manual shell start (by calling espshell_start()). |
STACKSIZE | 5000 | 4000 | Shell task stack size in bytes. |
WITH_HELP | 1 | 0 | Set to 0 to save program space by excluding help subsystems and context-sensitive hints. |
WITH_HISTORY | 1 | 0 | Set to 0 to disable command history. This is safe if you're using the Arduino Serial Monitor, which provides its own history via ↑ and ↓ keys. |
HIST_SIZE | 20 | 1 | Number of commands stored in the history buffer. |
WITH_ESPCAM | 1 | 1 | Set to 0 if your board does not require camera support. |
WITH_VAR | 1 | 1 | Set to 0 to disable support for sketch variables. |
STARTUP_ECHO | 1 | 0 | Echo mode at ESPShell startup (-1 = silent, 0 = no echo, 1 = echo). More details here. |
WITH_COLOR | 1 | 0 | Enable terminal color support. Set to 0 to save memory or if your terminal (e.g., Arduino Serial Monitor) doesn't support color. |
AUTO_COLOR | 1 | 0 | Let ESPShell automatically decide whether to enable color. See the "color on|off|auto" command. |
WITH_FS | 1 | 1 | Enable filesystem support (FAT/SPIFFS/LittleFS). Set to 0 if you don't need filesystems to save space. |
MOUNTPOINTS_NUM | 5 | 5 | Maximum number of simultaneously mounted filesystems. Reduce to 1 to save DRAM. |
WITH_SPIFFS | 1 | 1 | Enable support for SPIFFS filesystem. |
WITH_LITTLEFS | 1 | 1 | Enable support for LittleFS. |
WITH_FAT | 1 | 1 | Enable support for FAT (required if you enable WITH_SD). |
WITH_SD | 1 | 1 | Enable FAT filesystem on SD/TF card via SPI. |
DIR_RECURSION_DEPTH | 127 | 127 | Maximum allowed directory nesting depth. Reduce this value if you encounter crashes when working with filesystems. |
SEQUENCES_NUM | 10 | 10 | Maximum number of pulse sequences available to the "sequence" command. Reduce (minimum is 1) to save DRAM. |
STARTUP_PORT | 0 (or 99) | 0 (or 99) | UART number (0–2 or 99 for USB-CDC) where the shell will be deployed at startup. By default, ESPShell starts on either UART0 or USB-CDC. |