breezy_ssh
My breezybox project provided me with a terminal shell for ESP32 through a PC USB COM port complete with unix-style commands. This was a very good start but I really want remote access to ESP32 which would give me freedom to connect from various devices and wouldn't require the ESP32 device to be attached to my PC.
Breezybox has an additional component called breezy_ssh which implements an SSH server alongside breezybox to meet this requirement. Building on knowledge gained from the breezybox install breezy_ssh installation was very straightforward (it was a breeze ;)).
I downloaded an example provided by Valentin Danylchuk which included an sdkconfig and partition table. After a little tweak the build was successfully flashed to ESP32-S3 and started up. Using the serial console I could see that breezybox was working and I could use the file system as previously. In addition there was a prompt to start the ssh server.
The first action is to connect to wifi ("wifi connect") and bring up the ssh server ("sshd start"). I could then start an ssh client session on the PC😊😊.
Using breezy_ssh
The "big picture" below shows COM ports, serial console, ssh session and web access.
One downside with breezy_ssh is that I need to use the serial console to start wifi and ssh. Generously, Valentin does provide the ability to run shell scripts and a script "init.sh" is executed when you start up. Unfortunately the script didn't work for me when I put "wifi connect" in init.sh, so I have to start it manually. With further effort I could probably arrange for wifi and sshd to start within the program or diagnose how to make init.sh work.
libssh
I felt breezybox + breezy_ssh looked a bit complicated for my needs and wanted to look at alternatives.
libssh, written by David Cermak, is the ssh library for ESP32 IDF and is used within breezybox. I decided to test the example he provides (esp_ssh). Initially I tried to use IDFv6 both VSC and CLI versions. Surprisingly it wouldn't compile. I found this is due to "breaking changes" introduced between ESPv5 and ESPv6. David does provide a "Shim" to enable libssh to work with IDFv6 but I didn't have much success with it.
Instead I used IDFv5 to and the libssh example builds and flashes without problems. I can start ESP32S3, wifi and ssh server are started automatically. I can ssh in from WSL or Putty, which works better. Any text typed into SSH client is echoed on the serial console. There are only three command reset, hello (hello world message) and exit.
The example is much simpler than breezybox which is good. Naturally it has less functionality and I would need to write my own terminal shell.
Libssh is the base library used for ssh on ESP32 with IDF and therefore the simplest possible implementation. Looking at the source code I see that there is much complexity to deal with ssh authentication, creating and checking keys etc.
For my purposes I don't actually need any security as I only intend to use CLI access on the local network. This thought leads me to try telnet access in the next stage of my investigation.
















