Waveshare ESP32 S3 Zero - much issues

  1. board constantly swapping the port /dev/ttyACM0-1 (2 while second board presence)
  2. can’t flash firmware without pressing the buttons (boot+rst)
  3. can’t flash LED on pin 21 ( pinout image )

platformio.ini

[env:lolin_s3_mini]

platform = espressif32

board = lolin_s3_mini

framework = arduino


monitor_port = /dev/ttyACM0
monitor_speed = 115200

upload_port = /dev/ttyACM0
upload_speed = 921000

build_flags =
  -DARDUINO_USB_MODE=1
  -DARDUINO_USB_CDC_ON_BOOT=1

lib_deps =
	adafruit/Adafruit GFX Library
	adafruit/Adafruit SSD1306

main.ino

#include <WiFi.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64

#define OLED_RESET -1
#define SSD1306_I2C_ADDRESS 0x3C
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
#define I2C_SDA_PIN 13
#define I2C_SCL_PIN 12

void setup()
{
  Serial.begin(115200);

  Wire.begin(I2C_SDA_PIN, I2C_SCL_PIN);

  if (!display.begin(SSD1306_SWITCHCAPVCC, SSD1306_I2C_ADDRESS))
  {
    Serial.println(F("SSD1306 allocation failed"));
    for (;;)
      ;
  }

  display.display();
  display.clearDisplay();

  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0, 0);

  Serial.println();
  Serial.print("ESP Board MAC Address:  ");
  Serial.println(WiFi.macAddress());

  display.println();
  display.println("ESP Board MAC Address:  ");
  display.println(WiFi.macAddress());
  display.display();
}

void loop()
{
  //
}

Does this also happen with a simple “Hello World” sketch (without all those libraries and display?). Sounds like your sketch is in a boot loop.

Maybe due to a possible bootloop as mentioned above

Your sketch does not have any code to flash the LED !?

yeah, after reflash more simple example it’s flashing as it should, but serial monitor still not working

What exactly does not work?
Please describe in more details!

how to describe silence in serial monitor?

How does your setup look exactly?
Do you have multiple esp32 connected?
What about the switching ports? (never heard of this).
Which port is selected in the bottom bar?
What sketch is running?

“Does not work” is too general.

So many details nobody knows, except for you.

i thought platformio.ini overwrite bottom bar

anyway i tried everything, in most isolated and controlled way

i guess this is due to the wrong board choice (but i’m not sure)

Hover over the Serial object.

I guess you’ll see “HardwareSerial Serial”.
That means that the output is routed to the UART port.
But the waveshare board does not have UART to USB Chip / Port.

In this case you’ll have to use USBSerial.begin(...) and USBSerial.print("...");

You can use USB_CDC by setting

build_flags =
  -DARDUINO_USB_CDC_ON_BOOT=1

in the platformio.ini (as you did in your first post)
Please take a look at ESP32-S3 native USB interface and Serial Monitor missing first messages - #10 by sivar2311

In this case, Serial is an instance of HWCDC instead of HardwareSerial.

Note that the builtin USB port has 2 different interfaces: CDC (which is the serial port) + JTAG!

Also note that there is a bug in Arduino Core (pre 2.0.17). You might need to press the reset button after uploading!

1 Like

it works!

i tried it before, but boot-loop prevents me from seeing the correct result

but LED still not blinking :sweat_smile:

Please show your led-blink code.

#include <Arduino.h>

#define LED_PIN 21

void setup()
{
  Serial.begin(115200);
  pinMode(LED_PIN, OUTPUT);
}

void loop()
{
  digitalWrite(LED_PIN, HIGH);
  Serial.println("ON");
  delay(1000);
  digitalWrite(LED_PIN, LOW);
  Serial.println("OFF");
  delay(1000);
}

Erm … that’s an RGB LED.
Try neopixelWrite(gpio, red, green, blue);

digitalWrite won’t work for you because your variant does not match your actual board.

1 Like

just speechless… :exploding_head:

#include <Adafruit_NeoPixel.h>

#define LED_PIN 21  // Pin where the NeoPixel is connected
#define NUMPIXELS 1 // Number of pixels in the strip (or individual NeoPixel)

Adafruit_NeoPixel pixels(NUMPIXELS, LED_PIN, NEO_GRB + NEO_KHZ800);

void setup()
{
  Serial.begin(115200);
  pixels.begin(); // Initialize the NeoPixel library.
  pixels.show();  // Initialize all pixels to 'off'
}

void loop()
{
  neopixelWrite(LED_PIN, 255, 0, 0); // Set NeoPixel to red
  Serial.println("RED");
  delay(1000);

  neopixelWrite(LED_PIN, 0, 255, 0); // Set NeoPixel to green
  Serial.println("GREEN");
  delay(1000);

  neopixelWrite(LED_PIN, 0, 0, 255); // Set NeoPixel to blue
  Serial.println("BLUE");
  delay(1000);
}

void neopixelWrite(int gpio, int red, int green, int blue)
{
  pixels.setPixelColor(0, pixels.Color(red, green, blue)); // Set the color of pixel 0
  pixels.show();                                           // Update the NeoPixel strip with the new color
}

works like a charm

but still won’t enter in boot mode by themself :upside_down_face:

Auto-detected: /dev/ttyACM0
Uploading .pio/build/lolin_s3_mini/firmware.bin
esptool.py v4.5.1
Serial port /dev/ttyACM0
Connecting...
Chip is ESP32-S3 (revision v0.1)
Features: WiFi, BLE
Crystal is 40MHz
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800

A fatal error occurred: No serial data received.
*** [upload] Error 2

maybe this is the problem?

Warning! Your /lib/udev/rules.d/99-platformio-udev.rules are outdated. Please update or reinstall them.
More details: 99-platformio-udev.rules — PlatformIO latest documentation

i use arch btw, everything is bleeding edge :person_shrugging:

Erm… neopixelWrite is a builtin function! No need for external adafruit library!

Due to a bug inside Arduino, you have to restart the ESP manually after flashing. This is fixed in Arduino 2.0.17 (which is not yet available on PlatformIO).

1 Like

Waveshare is Modbus RTU ie you must to have an dabtor serial to RS485.
Regards