Skip to content

armando1996/esp32-wifi-cli

 
 

Repository files navigation

PlatformIO ViewCount

esp32-wifi-cli

Basic and extendible Wifi CLI manager via serial command line for ESP32

Demo

ESP32 Wifi CLI Demo

Features

  • interactive serial terminal, prompt and backspace support
  • extendible: custom user commands and also the help menu
  • Wifi multi AP and single AP modes
  • preferences persist in flash ROM
  • two parsers: Argument into quotes or two parameters without quotes
  • debug messages mode off (new silent mode)
  • disable auto connect in the boot
  • extend the CLI events callbacks (see examples)
  • esp8266 support
  • esp32c3, esp32s3 support
  • launch terminal in setup (example)
  • improve VT100 compatibility (some minor issues on some terminals)

Basic implementation

#include <Arduino.h>
#include <ESP32WifiCLI.hpp>

void setup() {
  Serial.begin(115200);  // set here the Serial baudrate or in
  wcli.begin();          // the begin method like a parameter
  delay(100);
}

void loop() {
  wcli.loop();
}

Output

SerialTerm v1.1.2
(C) 2022, MikO - Hpsaturn
  available commands:
        help            show detail usage information
        setSSID         set the Wifi SSID
        setPASW         set the WiFi password
        connect         save and connect to WiFi network
        list            list saved WiFi networks
        select          select the default AP (default: last)
        mode            set the default operation single/multi AP (slow)
        scan            scan WiFi networks
        status          WiFi status information
        disconnect      WiFi disconnect
        delete          remove saved WiFi network by SSID

st>

Custom parameters

You can extend the available commands adding new ones in the setup, like these:

wcli.begin();
wcli.term->add("blink", &blink, "\tLED blink x times each x millis");
wcli.term->add("echo", &echo, "\tEcho the input message");
wcli.term->add("reboot", &reboot, "\tperform a ESP32 reboot");

For more details, please review the M5Atom and Advanced examples.

ESP32 Wifi CLI Blink demo

PlatformIO install

You able to install this library with pio pkg command:

pio pkg install --library "hpsaturn/ESP32 Wifi CLI@^0.1.0"

Or add it in your ini file. Also you can compile here the examples with a simple pio run over root of this repo.

Arduino IDE requirements

This ESP32 CLI is based on the old SerialTerminal of @miko007. Please first download and use my fork that has some improvements: SerialTerminal Library

After that install ESP32 Wifi CLI library from this repo. Download it on releases.

Projects

The next projects are using esp32-wifi-cli library:

Crypto panel

Crypto panel

GPS via Virtual UART port

screenshot20221102_231819

Basic T-Display S3 clock

screenshot20221104_123225

CanAirIO - Air quality network

CanAirIO Community

Credits

Extended from SerialTerminal by @miko007

About

Basic CLI for WiFi setup over ESP32

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 81.9%
  • Shell 18.1%