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:

  name: esp32-s2
  friendly_name: ESP32-s2

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

# Enable logging
  #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
  #  WiFiGeneric.cpp: NONE

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

  ssid: !secret wifi_ssid
  password: !secret wifi_password


  - 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

  - platform: sntp
      - seconds: /5
         - 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:, 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:

  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.

  level: DEBUG
    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

But I have now… And no luck :frowning_face: