Page 1 of 1

WiFi Logger for esp32

Posted: Wed Apr 15, 2020 8:17 am
by VeWare
Image

ESP32 WiFi logger - Log messages over WiFi, using either TCP, UDP or Websockets
  • Generates log messages with same format as ESP-IDF Logging API.
  • Can route logs generated by ESP_LOGX(), provides a custom function to log messages over wifi.
  • Follows ESP-IDF log color pattern for different log levels.
  • Using UDP as network protocol provides lowest latency.
  • Minimal test condition - minimum free heap = 220388 bytes.
  • TCP performance is mid-way:
  • Minimal test condition - minimum free heap = 216537 bytes.
  • Using Websockets provides the worst latency:
  • Minimal test condition - minimum free heap = 205416 bytes.
Github Link: https://github.com/VedantParanjape/esp-wifi-logger
Example Link: https://github.com/VedantParanjape/esp- ... ample/main

Example: https://github.com/VedantParanjape/esp- ... er_example
  1. #include <stdio.h>
  2. #include "freertos/FreeRTOS.h"
  3. #include "freertos/task.h"
  4. #include "wifi_logger.h"
  5.  
  6.  
  7. void app_main(void)
  8. {
  9.     start_wifi_logger(); // start wifi logger process
  10.    
  11.     while(1)
  12.     {
  13.         ESP_LOGI("main", "%s", "test sys log");
  14.         wifi_log_e("test", "%s %d %f", "hello world: ERROR", 23, 56.23); // write log over wifi with log level -> ERROR
  15.         wifi_log_w("test", "%s %d %f", "hello world: WARN", 24, 90.341223242); // write log over wifi with log level -> WARN
  16.         wifi_log_i("test", "%s %d %f", "hello world: INFO", 25, 12.763242); // write log over wifi with log level -> INFO
  17.         wifi_log_d("test", "%s %d %f", "hello world: DEBUG", 26, 80.3242); // write log over wifi with log level -> DEBUG
  18.         wifi_log_v("test", "%s %d %f", "hello world: VERBOSE", 27, 76.5242); // write log over wifi with log level -> VERBOSE
  19.    
  20.         vTaskDelay(100); // wait for 100 ms
  21.     }
  22. }