Monitor printing unreadable output

ecktello
Posts: 8
Joined: Fri May 05, 2023 11:01 pm

Monitor printing unreadable output

Postby ecktello » Sun May 07, 2023 8:46 pm

Hello all,

My first time posting here so hope this is the right forum.

I am running an ESP32 from COM4 on Windows 10 64 bit in VSCode using the ESP-IDF extension with Python 3.11 and ESP IDF Framework 5.0.1-2. I followed the tutorial here https://esp32tutorials.com/install-esp3 ... e-vs-code/, and everything seemed to work - building, flashing, etc. However when I open the monitor using the VSCode shortcut, instead of seeing English text I see random text, in the attached photo. I have tried looking through the forum, but perhaps used the wrong keywords as I find no others with the same issue. Any advice or recommendations would be appreciated, thank you in advance.
Attachments
esp-output.JPG
esp-output.JPG (99.21 KiB) Viewed 5174 times

ESP_Sprite
Posts: 9708
Joined: Thu Nov 26, 2015 4:08 am

Re: Monitor printing unreadable output

Postby ESP_Sprite » Mon May 08, 2023 7:43 am

Seems your serial port gets opened at 460800 baud; by default the ESP32 outputs data at 115200. (Note that flashing can be faster than that.) Maybe a setting somewhere?

rusiradd
Posts: 2
Joined: Mon May 08, 2023 8:38 am

Re: Monitor printing unreadable output

Postby rusiradd » Mon May 08, 2023 8:53 am

I am getting the same issue. didn't do any changes and the code was working properly few days ago

ecktello
Posts: 8
Joined: Fri May 05, 2023 11:01 pm

Re: Monitor printing unreadable output

Postby ecktello » Mon May 08, 2023 11:28 am

ESP_Sprite wrote:
Mon May 08, 2023 7:43 am
Seems your serial port gets opened at 460800 baud; by default the ESP32 outputs data at 115200. (Note that flashing can be faster than that.) Maybe a setting somewhere?
Hello Sprite,

I tried your suggestion and it still handled the same way, but thanks for the advice.
What's interesting is instead of flashing the project from within the VSCode extension, I used the ESP5.0 powershell prompt and ran "idf.py flash monitor" and the output appeared as expected. Does this mean there is a configuration setting I am missing within the VSCode extension that should be executing a script to load an ESP terminal/powershell console, or is it potentially a bug in the extension? Do you have any advice where to look to verify/correct this?

User avatar
corz.org
Posts: 80
Joined: Fri Feb 03, 2023 10:44 pm
Location: Aberdeen
Contact:

Re: Monitor printing unreadable output

Postby corz.org » Mon May 08, 2023 10:16 pm

It tells you right there in the console, where it says 460800.
It should say 115200.

I use Arduino, so it will be a different setup, but I upload at 921600 and monitor at 115200.
Check your prefs/config file; there should be two different settings.

bidrohini
Posts: 202
Joined: Thu Oct 27, 2022 12:55 pm

Re: Monitor printing unreadable output

Postby bidrohini » Tue May 09, 2023 8:14 am

This type of garbage value usually appears due to baud rate mismatch.

username
Posts: 527
Joined: Thu May 03, 2018 1:18 pm

Re: Monitor printing unreadable output

Postby username » Tue May 09, 2023 1:37 pm

Just created a new project today, and had the same issue (which I never had before).
Somethings changed, and I don't know why new projects are now defaulting to 460800 for the terminal baud rate.
Here is how to fix it back to 115200.

In your project, under the .vscode folder open settings,json file.
add "idf.monitorBaudRate": "115200",

I also added "idf.flashBaudRate": "1152000",
NOTE: some boards cannot handle 1152000, so be aware.

Here is what my file looks like for clarity, so you know where to stick them.

Code: Select all

{
    "C_Cpp.intelliSenseEngine": "Tag Parser",
    "idf.adapterTargetName": "esp32s3",
    "idf.customExtraPaths": "J:\\ESP_5.0.1\\.espressif\\tools\\xtensa-esp-elf-gdb\\11.2_20220823\\xtensa-esp-elf-gdb\\bin;J:\\ESP_5.0.1\\.espressif\\tools\\riscv32-esp-elf-gdb\\11.2_20220823\\riscv32-esp-elf-gdb\\bin;J:\\ESP_5.0.1\\.espressif\\tools\\xtensa-esp32-elf\\esp-2022r1-11.2.0\\xtensa-esp32-elf\\bin;J:\\ESP_5.0.1\\.espressif\\tools\\xtensa-esp32s2-elf\\esp-2022r1-11.2.0\\xtensa-esp32s2-elf\\bin;J:\\ESP_5.0.1\\.espressif\\tools\\xtensa-esp32s3-elf\\esp-2022r1-11.2.0\\xtensa-esp32s3-elf\\bin;J:\\ESP_5.0.1\\.espressif\\tools\\riscv32-esp-elf\\esp-2022r1-11.2.0\\riscv32-esp-elf\\bin;J:\\ESP_5.0.1\\.espressif\\tools\\esp32ulp-elf\\2.35_20220830\\esp32ulp-elf\\bin;J:\\ESP_5.0.1\\.espressif\\tools\\cmake\\3.24.0\\bin;J:\\ESP_5.0.1\\.espressif\\tools\\openocd-esp32\\v0.11.0-esp32-20221026\\openocd-esp32\\bin;J:\\ESP_5.0.1\\.espressif\\tools\\ninja\\1.10.2;J:\\ESP_5.0.1\\.espressif\\tools\\idf-exe\\1.0.3;J:\\ESP_5.0.1\\.espressif\\tools\\ccache\\4.6.2\\ccache-4.6.2-windows-x86_64;J:\\ESP_5.0.1\\.espressif\\tools\\dfu-util\\0.9\\dfu-util-0.9-win64;J:\\ESP_5.0.1\\.espressif\\tools\\esp-rom-elfs\\20220823",
    "idf.customExtraVars": {
        "OPENOCD_SCRIPTS": "J:\\ESP_5.0.1\\.espressif\\tools\\openocd-esp32\\v0.11.0-esp32-20221026/openocd-esp32/share/openocd/scripts",
        "IDF_CCACHE_ENABLE": "1",
        "ESP_ROM_ELF_DIR": "J:\\ESP_5.0.1\\.espressif\\tools\\esp-rom-elfs\\20220823/"
    },
    "idf.espIdfPathWin": "J:\\ESP_5.0.1\\esp\\esp-idf",
    "idf.openOcdConfigs": [
        "board/esp32s3-builtin.cfg"
    ],
    "idf.pythonBinPathWin": "J:\\ESP_5.0.1\\.espressif\\python_env\\idf5.0_py3.8_env\\Scripts\\python.exe",
    "idf.toolsPathWin": "J:\\ESP_5.0.1\\.espressif",
    "idf.portWin": "COM9",
    "idf.flashType": "UART",
    "idf.monitorBaudRate": "115200",
    "idf.flashBaudRate": "1152000"
}

ecktello
Posts: 8
Joined: Fri May 05, 2023 11:01 pm

Re: Monitor printing unreadable output

Postby ecktello » Fri Jun 02, 2023 9:10 pm

Sorry for getting back to this so late, but it happens if you install any ESP command line tools after you install the ESP IDF VS Code extension. It may also occur if you use the direct command terminal rather than using than using the ESP-IDF terminal.

Who is online

Users browsing this forum: Baidu [Spider] and 85 guests