Why am I getting Log Output on my ESP32-S2 Soft UART?

I have defined a “soft uart” to interface with “Device X”. However, it seems that during the ESP32-S2 startup, I am getting unexpected output on this UART? This is my YAML:

esphome:
  name: esp32-s2
  friendly_name: ESP32-s2
  

esp32:
  board: lolin_s2_mini #esp32-s2-saola-1
  framework:
    type: arduino

# Enable logging
logger:
  #hardware_uart: USB_CDC # TX=19, RX=20 (via USB connector)
  #hardware_uart: UART0 # TX=43, RX=44 (pins not brought to edge connectors) 
  hardware_uart: UART1 # TX=17, RX=18
  level: VERBOSE
  #logs:
  #  WiFiGeneric.cpp: NONE

# Enable Home Assistant API
api:
  
ota:
  id: my_ota_pw
  password: !secret ota_password
  

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

captive_portal:

uart:
  - id: my_uart
    tx_pin: GPIO37 #marked as 37 on WeMOS S2 board
    rx_pin: GPIO39 #marked as 39 on WeMOS S2 Board
    baud_rate: 115200
    stop_bits: 1
    parity: none

time:
  - platform: sntp
    on_time:
      - seconds: /5
        then:
         - uart.write:
            id: my_uart
            data: "\n\rhello world"

… and this is the output on my soft uart (my_uart):

[206810][V][WiFiGeneric.cpp:360] _arduino_event_cb(): STA Disconnected: SS8
[206811][D][WiFiGeneric.cpp:929] _eventCallback(): Arduino Event: 5 - STA_D
[206818][W][WiFiGeneric.cpp:950] _eventCallback(): Reason: 8 - ASSOC_LEAVE
[206826][V][WiFiGeneric.cpp:341] _arduino_event_cb(): STA Stopped
[206830][D][WiFiGeneric.cpp:929] _eventCallback(): Arduino Event: 3 - STA_P
[  1075][D][WiFiGeneric.cpp:929] _eventCallback(): Arduino Event: 0 - WIFIY
[  1112][V][WiFiGeneric.cpp:338] _arduino_event_cb(): STA Started
[  1113][D][WiFiGeneric.cpp:929] _eventCallback(): Arduino Event: 2 - STA_T
[  7142][V][WiFiGeneric.cpp:381] _arduino_event_cb(): SCAN Done9
[  7142][D][WiFiGeneric.cpp:929] _eventCallback(): Arduino Event: 1 - SCANE
[  8876][V][WiFiGeneric.cpp:353] _arduino_event_cb(): STA ConneK
[  8877][D][WiFiGeneric.cpp:929] _eventCallback(): Arduino Event: 4 - STA_D
[  9859][V][WiFiGeneric.cpp:367] _arduino_event_cb(): STA Got New IP:192.10
[  9859][D][WiFiGeneric.cpp:929] _eventCallback(): Arduino Event: 7 - STA_P
[  9862][D][WiFiGeneric.cpp:991] _eventCallback(): STA IP: 192.168.0.80, M1

hello world
hello world
hello world
hello world
test string continues...

Any suggestions on how to stop this unwanted output because it is sending “Device X” into a very confused state!
Regards, Martin

Do you actually need an uart logger?
If not, just disable it with:

logger:
  baud_rate: 0

No I don’t NEED a uart logger. But it is useful sometimes. And I think the log output should be on UART1 not on my_uart.
However, I did try the baud_rate: 0. But I still get the spurious output on the soft uart!
And what sort of log information is it anyway? Compiler output?
Regards, M.

Good question. I’ve never seen those, either.

Maybe it’s possible to suppress that one component.

logger:
  level: DEBUG
  logs:
    WiFiGeneric.cpp: NONE

Nope. Tried that. See sample YAML (although it is Rem’d out)

Regards, M.

1 Like

I see now lol

Did you try any variations like WIFi.component or WiFiGeneric.component

No?
But I have now… And no luck :frowning_face: