ESP32 3S Nano vs Control surface

Hello everyone,
I'm playing a little bit the ESP32 3S Nano board from Waveshare.

I'm trying to control some potentiometers and encoders with the mighty control surface library.
I say "I'm trying" because I'm unable to make it work.

I followed the instructions found on the Waveshare website for uploading the sketch, which actually doesn't work because they don't mention that the ESP32 needs to go on BOOT mode by shorten pin B1 with GND and pressing RST button.

Anyway, I included in the sketch a simple blinking line in the loop, just to make sure that the program runs.
After uploading the sketch and resetting the unit, the internal LED blinks but the module doesn't get recognised as a control surface by MIDI Monitor.


#include <Control_Surface.h>


USBMIDI_Interface midi;


//POTS-----------------------
PBPotentiometer vol7{
  14,         // Analog pin connected to potentiometer 14
  CHANNEL_3,  // MIDI Channel
};

PBPotentiometer vol8{
  13,         // Analog pin connected to potentiometer 13
  CHANNEL_4,  // MIDI Channel
};

PBPotentiometer vol9{
  12,         // Analog pin connected to potentiometer 12
  CHANNEL_5,  // MIDI Channel
};

PBPotentiometer vol10{
  11,         // Analog pin connected to potentiometer 11
  CHANNEL_6,  // MIDI Channel
};

PBPotentiometer vol11{
  4,          // Analog pin connected to potentiometer. 4
  CHANNEL_7,  // MIDI Channel
};

PBPotentiometer vol12{
  3,          // Analog pin connected to potentiometer 3
  CHANNEL_8,  // MIDI Channel
};



// CCRotaryEncoders----------------------
CCRotaryEncoder enc7 = {
  { 44, 43 },    // pins
  MCU::V_POT_3,  // MIDI address (CC number + optional channel)
  1,             // optional multiplier if the control isn't fast enough
};

CCRotaryEncoder enc8 = {
  { 38, 47 },    // pins
  MCU::V_POT_4,  // MIDI address (CC number + optional channel)
  1,             // optional multiplier if the control isn't fast enough
};

CCRotaryEncoder enc9 = {
  { 18, 21 },    // pins
  MCU::V_POT_5,  // MIDI address (CC number + optional channel)
  1,             // optional multiplier if the control isn't fast enough
};

CCRotaryEncoder enc10 = {
  { 10, 17 },    // pins
  MCU::V_POT_6,  // MIDI address (CC number + optional channel)
  1,             // optional multiplier if the control isn't fast enough
};

CCRotaryEncoder enc11 = {
  { 8, 9 },      // pins
  MCU::V_POT_7,  // MIDI address (CC number + optional channel)
  1,             // optional multiplier if the control isn't fast enough
};

CCRotaryEncoder enc12 = {
  { 6, 7 },      // pins
  MCU::V_POT_8,  // MIDI address (CC number + optional channel)
  1,             // optional multiplier if the control isn't fast enough
};


void setup() {

  Control_Surface.begin();

  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {

  Control_Surface.loop();

  digitalWrite(LED_BUILTIN, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(1000);                      // wait for a second
  digitalWrite(LED_BUILTIN, LOW);   // turn the LED off by making the voltage LOW
  delay(1000);
}

I tried to change the basic options on IDE - Tools (see screenshot):

FAT and SPIFFS partitions don't seem to make any change

Screenshot 2025-02-07 at 14.44.16

GPIO or Arduino pin numbering could make the difference I guess, but if I set it to Arduino the program doesn't get compiled.

I'm puzzled, can anybody help me?
Much obliged

Are you using espressif/arduino-esp32 version 3.0.0 or later? Older versions (including Arduino's fork of the Core) do not support MIDI over USB.

Currently using esp32 Espressif version 3.1.1

So far, the only way to get the control surface sketch running is by selecting the ESP32-S3 Dev Module board with the settings attached below. However, it is very temperamental: it runs for a few minutes and then freezes, after which it no longer works—even if I unplug and reconnect the USB cable, press the reset button, or plug it into another computer. Sometimes, changing the USB cable may temporarily resolve the issue.

As mentioned in your other thread, this could be caused by the long delays you have in your loop. Some software does not handle the situation well where the outgoing MIDI buffer fills up (which is what inevitably happens if you sleep for two seconds for every trip around the loop).

Hello @PieterP,
thanks for helping out again with this issue. I tried without the delay part but the module still acts in a temperamental way: sometimes it shows up, other times it doesn't, unexpectedly. I wonder if it is the quality of the serial-to-USB onboard microchip.

I was double-checking the compatibility chart.

It seems that the board ESP32 3S NANO has not been tested yet.

The Arduino ESP32 is on the list.
The ESP32 3S is on the list too.

However, the ESP32 3S Nano (from Waveshare) is NOT on the list.
Waveshare claims that the ESP32 3S Nano is compatible with the Arduino Nano ESP32, but there are some differences.
The Arduino Nano ESP32 uses the same 3S microchip but for example pins B0 and B1 are wired in a different way).

Also, IDE's tools menu for the Arduino Nano is very basic and intuitive. On the contrary the ESP32 menu looks extremely complex, probably for expert users or developers (which is not my case).

Am I saying gibberish or probably the difference of cost would justify (again) the reliability of a module?

Arduino ESP32 Nano: £18
Waveshare ESP 3S Nano: £8

Thank you guys