WiFi Logger component
1.0
WiFi Logger component, uses wifi to output logs
|
ESP32 WiFi logger - Log messages over WiFi, using either TCP, UDP or Websockets
Example App:
protocol_examples_common (esp-idf/examples/common_components/)
Change CMakeList.txt to add the line given below:
set(EXTRA_COMPONENT_DIRS <relative_path_to_component_folder>)
component folder must contain protocol_examples_common
and wifi_logger
component
sudo apt-get install netcat
Netcat is required to receive logsnc -lu <PORT>
Receive logs when udp is used as network protocolnc -l <PORT>
Receive logs when tcp is used as network protocolwebsocat -s <IP_ADDRESS_OF_YOUR_MACHINE>:<PORT>
Receive logs when websocket is used as network protocolnc -l 1212
### How to use in ESP-IDF Projects
ESP_LOGE, ESP_LOGW, ESP_LOGI, ESP_LOGD, ESP_LOGV
, if configured so through menuconfigESP_LOGX()
wifi_log()_x
function to print logs over wifiwifi_log(TAG, "%s", "logger test");
ESP_LOGE, ESP_LOGW, ESP_LOGI, ESP_LOGD, ESP_LOGV
logs will also be sent over wifi, if configured in menuconfig.start_wifi_logger()
in void app_main()
to start the logger. Logging function wifi_log_x() (x = e,w,i,d,v)
can be called to log messages or normal ESP-IDF Logging API functions like ESP_LOGW
can be used if configured through menuconfig
.menuconfig
Example Connection Configuration
Set WiFi SSID and passwordComponent config
WiFi Logger configuration
Route logs generated by ESP_LOGX to the wifi logger
- Select if the logs written by system API are routed to be sent to the remote loggerNetwork Protocol (TCP/UDP/WEBSOCKET)
- Set network protocol to be usedUDP/TCP Network Protocol
Server IP Address
- Set the IP Address of the server which will receive log messages sent by ESP32Port
- Set the Port of the serverWEBSOCKET Network Protocol
Websocket Server URI
- Sets the URI of Websocket server, where logs are to be sentIP Address of the server can be found out by running ifconfig
on a linux machine
Example Connection Configuration
WiFi SSID
- Set WiFi SSID to connectWiFi Password
- Set WiFi PasswordComponent config
WiFi Logger configuration
Network Protocol (TCP/UDP/WEBSOCKET)
- Set network protocol to be usedRoute logs generated by ESP_LOGX to the wifi logger
- Select if the logs written by system API are routed to be sent to the remote loggerUDP/TCP Network Protocol
Server IP Address
- Set the IP Address of the server which will receive log messages sent by ESP32Port
- Set the Port of the serverWEBSOCKET Network Protocol
Websocket Server URI
- Sets the URI of Websocket server, where logs are to be sentQueue Size
- Advanced Config, change at your own risk Set the freeRTOS Queue size used to pass log messages to logger task.logger buffer size
- Advanced Config, change at your own risk Set the buffer size of char array used to generate log messages in ESP format