Hello;
I am developing bluetooth application with arduino ide and esp32 ble development board in windows 7.
How how can i view esp log data?
Thanks.
Example
ESP_LOGD(LOG_TAG, "Ignoring %s, already seen it.", advertisedAddress.toString().c_str());
View Esp Log With Arduino IDE
-
- Posts: 2
- Joined: Sat Nov 24, 2018 8:01 am
Re: View Esp Log With Arduino IDE
Thanks for the advice. I changed the settings in the Arduino under Tools --> Core Debug Level to Verbose, but still no debug ouput.
Do you have any other idea?
Do you have any other idea?
Code: Select all
#include "esp32-hal-log.h"
void setup() {
Serial.begin(115200);
Serial.println("Starting"); // will be shown in the terminal
Serial.setDebugOutput(true);
esp_log_level_set("*", ESP_LOG_VERBOSE);
ESP_LOGD("EXAMPLE", "This doesn't show");
log_v("Verbose");
log_d("Debug");
log_i("Info");
log_w("Warning");
log_e("Error");
}
void loop() {
// nothing to do
}
-
- Posts: 59
- Joined: Thu Aug 17, 2017 5:40 pm
Re: View Esp Log With Arduino IDE
Hi,
If you not can it works, have a library for arduino that have debug levels and more:
https://github.com/JoaoLopesF/SerialDebug
If you not can it works, have a library for arduino that have debug levels and more:
https://github.com/JoaoLopesF/SerialDebug
Re: View Esp Log With Arduino IDE
Most of the time I use platform IO, but as my colleagues use the Arduino IDE, I had the same problem described here.
My solution was to include in the very begining of the .ino file, before the includes:
I'm not sure the last define is necessary, but anyway, is working and printing: [I][EspFile.ino:240] loop(): Read: 23;33.19;-5;-119;32.25;36, as I intended.
My solution was to include in the very begining of the .ino file, before the includes:
Code: Select all
#ifdef CORE_DEBUG_LEVEL
#undef CORE_DEBUG_LEVEL
#endif
#define CORE_DEBUG_LEVEL 3
#define LOG_LOCAL_LEVEL ESP_LOG_DEBUG
Code: Select all
ESP_LOGI(TAG, "Read: %s", message);
Re: View Esp Log With Arduino IDE
cakira wrote: ↑Thu Jan 21, 2021 6:23 pmMost of the time I use platform IO, but as my colleagues use the Arduino IDE, I had the same problem described here.
My solution was to include in the very begining of the .ino file, before the includes:I'm not sure the last define is necessary, but anyway,Code: Select all
#ifdef CORE_DEBUG_LEVEL #undef CORE_DEBUG_LEVEL #endif #define CORE_DEBUG_LEVEL 3 #define LOG_LOCAL_LEVEL ESP_LOG_DEBUG
is working and printing: [I][EspFile.ino:240] loop(): Read: 23;33.19;-5;-119;32.25;36, as I intended.Code: Select all
ESP_LOGI(TAG, "Read: %s", message);
Thank you cakira. Can confirm that the last define is needed. Might also want to undef LOG_LOCAL_LEVEL to avoid compiler warnings. Here is how I set the log level to debug (4).
Code: Select all
#if (!PLATFORMIO)
// Enable Arduino-ESP32 logging in Arduino IDE
#ifdef CORE_DEBUG_LEVEL
#undef CORE_DEBUG_LEVEL
#endif
#ifdef LOG_LOCAL_LEVEL
#undef LOG_LOCAL_LEVEL
#endif
#define CORE_DEBUG_LEVEL 4
#define LOG_LOCAL_LEVEL CORE_DEBUG_LEVEL
#endif
#include <esp32-hal-log.h>
...
void setup()
{
Serial.begin(115200);
delay(10000);
Serial.printf("LOG_LOCAL_LEVEL %d\n", LOG_LOCAL_LEVEL);
// esp32-hal-log.h esp_log.h
// level 0 = ARDUHAL_LOG_LEVEL_NONE = ESP_LOG_NONE
ESP_LOGE(TAG, "ESP_LOGE, level 1 = ARDUHAL_LOG_LEVEL_ERROR = ESP_LOG_ERROR");
ESP_LOGW(TAG, "ESP_LOGW, level 2 = ARDUHAL_LOG_LEVEL_WARN = ESP_LOG_WARN");
ESP_LOGI(TAG, "ESP_LOGI, level 3 = ARDUHAL_LOG_LEVEL_INFO = ESP_LOG_INFO");
ESP_LOGD(TAG, "ESP_LOGD, level 4 = ARDUHAL_LOG_LEVEL_DEBUG = ESP_LOG_DEBUG");
ESP_LOGV(TAG, "ESP_LOGV, level 5 = ARDUHAL_LOG_LEVEL_VERBOSE = ESP_LOG_VERBOSE");
...
If anyone is wondering, doing the same in PlatformIO requires adding an env build flag in the platformio.ini:
Code: Select all
[env:seeed_xiao_esp32c3]
board = seeed_xiao_esp32c3
framework = arduino
; Enable ArduinoESP32 logging
build_flags = -DCORE_DEBUG_LEVEL=4 ; Clean project after changing the level
...
Who is online
Users browsing this forum: Google [Bot] and 80 guests