{"id":20236950,"url":"https://github.com/vedantparanjape/esp-wifi-logger","last_synced_at":"2025-08-17T00:32:05.466Z","repository":{"id":41320485,"uuid":"254947539","full_name":"VedantParanjape/esp-wifi-logger","owner":"VedantParanjape","description":"ESP32 WiFi Logger component","archived":false,"fork":false,"pushed_at":"2025-05-16T01:45:25.000Z","size":1343,"stargazers_count":91,"open_issues_count":4,"forks_count":17,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-04T13:29:20.946Z","etag":null,"topics":["c","esp-idf","esp32","freertos","hacktoberfest","logger","networking","tcp","udp","websockets","wifi"],"latest_commit_sha":null,"homepage":"https://ve0x10.in/esp-wifi-logger/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VedantParanjape.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-04-11T20:14:50.000Z","updated_at":"2025-05-25T11:12:18.000Z","dependencies_parsed_at":"2025-04-24T23:29:00.557Z","dependency_job_id":"67be370a-0b81-475f-a925-25491fe89b7c","html_url":"https://github.com/VedantParanjape/esp-wifi-logger","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/VedantParanjape/esp-wifi-logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VedantParanjape%2Fesp-wifi-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VedantParanjape%2Fesp-wifi-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VedantParanjape%2Fesp-wifi-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VedantParanjape%2Fesp-wifi-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VedantParanjape","download_url":"https://codeload.github.com/VedantParanjape/esp-wifi-logger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VedantParanjape%2Fesp-wifi-logger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270791255,"owners_count":24645781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","esp-idf","esp32","freertos","hacktoberfest","logger","networking","tcp","udp","websockets","wifi"],"created_at":"2024-11-14T08:23:59.245Z","updated_at":"2025-08-17T00:32:05.455Z","avatar_url":"https://github.com/VedantParanjape.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"WiFi Logger component\n====================\nESP32 WiFi logger - Log messages over WiFi, using either TCP, UDP or Websockets\n* Generates log messages with same format as ESP-IDF Logging API.\n* Can route logs generated by ESP_LOGX(), provides a custom function to log messages over wifi.\n* Follows ESP-IDF log color pattern for different log levels.\n* Using UDP as network protocol provides lowest latency:\n  * Minimal test condition - minimum free heap = *220388* bytes.\n* TCP performance is mid-way:\n  * Minimal test condition - minimum free heap = *216537* bytes.\n* Using Websockets provides the worst latency:\n  * Minimal test condition - minimum free heap = *205416* bytes.\n\nExample App: ![https://github.com/VedantParanjape/esp-component-examples/tree/master/esp_wifi_logger_example](https://github.com/VedantParanjape/esp-component-examples/tree/master/esp_wifi_logger_example)\n\n## Requirements\n\n* `protocol_examples_common (esp-idf/examples/common_components/)`\n\n## Installation\n\n```\ncd \u003cyour_esp_idf_project\u003e\nmkdir components\ncd components\ncp $IDF_PATH/examples/common_components/protocol_examples_common . -r\ngit clone https://github.com/VedantParanjape/esp-wifi-logger.git wifi_logger\n```\n\nChange CMakeList.txt to add the line given below:\n\n`set(EXTRA_COMPONENT_DIRS \u003crelative_path_to_component_folder\u003e)`\n\ncomponent folder must contain `protocol_examples_common` and `wifi_logger` component\n## Usage\n\n### How to receive logs\n\n* `sudo apt-get install netcat`     \n  Netcat is required to receive logs    \n* `nc -lu \u003cPORT\u003e`     \n  Receive logs when ***udp*** is used as network protocol   \n* `nc -l \u003cPORT\u003e`    \n  Receive logs when ***tcp*** is used as network protocol   \n* `websocat -s \u003cIP_ADDRESS_OF_YOUR_MACHINE\u003e:\u003cPORT\u003e`     \n  Receive logs when ***websocket*** is used as network protocol   \n* `websocat -s $(ip -o route get to 8.8.8.8 | sed -n 's/.*src \\([0-9.]\\+\\).*/\\1/p'):1234`     \n  receive logs when ***websocket*** is used as network protocol, auto fills the ip address    \n* **Example**: Assume, *port* is **1212** over TCP, command will be: `nc -l 1212`     \n\n### How to use in ESP-IDF Projects\n```\nwifi_log_e() - Generate log with log level ERROR\nwifi_log_w() - Generate log with log level WARN\nwifi_log_i() - Generate log with log level INFO\nwifi_log_d() - Generate log with log level DEBUG\nwifi_log_v() - Generate log with log level VERBOSE\n```\n* Can send logs generated by `ESP_LOGE, ESP_LOGW, ESP_LOGI, ESP_LOGD, ESP_LOGV`, if configured so through menuconfig   \n\n* Usage pattern same as, `ESP_LOGX()`\n* Use `wifi_log()_x` function to print logs over wifi\n* Example: `wifi_log(TAG, \"%s\", \"logger test\");`\n* `ESP_LOGE, ESP_LOGW, ESP_LOGI, ESP_LOGD, ESP_LOGV` logs will also be sent over wifi, if configured in menuconfig.\n* Call `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`.\n\n* Configure `menuconfig`\n  * `Example Connection Configuration` *Set WiFi SSID and password*\n  * `Component config`\n  * `WiFi Logger configuration`\n    * `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 logger\n    * `Network Protocol (TCP/UDP/WEBSOCKET)` - Set network protocol to be used \n    * `UDP/TCP Network Protocol`\n        * `Server IP Address` - Set the IP Address of the server which will receive log messages sent by ESP32\n        * `Port` - Set the Port of the server\n    * `WEBSOCKET Network Protocol`\n        * `Websocket Server URI` - Sets the URI of Websocket server, where logs are to be sent\n\n*IP Address of the server can be found out by running `ifconfig` on a linux machine*\n\n## Configuration\n\n```\nidf.py menuconfig\n```\n* `Example Connection Configuration`\n  * `WiFi SSID` -  Set WiFi SSID to connect\n  * `WiFi Password` - Set WiFi Password\n\n* `Component config`\n  * `WiFi Logger configuration`\n    * `Network Protocol (TCP/UDP/WEBSOCKET)` - Set network protocol to be used \n    * `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 logger\n    * `UDP/TCP Network Protocol`\n      * `Server IP Address` - Set the IP Address of the server which will receive log messages sent by ESP32\n      * `Port` - Set the Port of the server\n    * `WEBSOCKET Network Protocol`\n      * `Websocket Server URI` - Sets the URI of Websocket server, where logs are to be sent\n    * `Queue Size` - ***Advanced Config, change at your own risk*** Set the freeRTOS Queue size used to pass log messages to logger task.\n    * `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\n* On ESP IDF 5.4.x and later, ANSI log color disable by default, we must enable it with below config, or include this in sdkconfig file: `CONFIG_LOG_COLORS=y`\n    * `Component config` \n      * `Logs`\n        * `Format`\n         * `Color` \n\n## Example\n* Detailed Example App: ![https://github.com/VedantParanjape/esp-component-examples/tree/master/esp_wifi_logger_example](https://github.com/VedantParanjape/esp-component-examples/tree/master/esp_wifi_logger_example)\n\n```C\n#include \u003cstdio.h\u003e\n#include \"freertos/FreeRTOS.h\"\n#include \"freertos/task.h\"\n#include \"wifi_logger.h\"\n\n\nvoid app_main(void)\n{\n    start_wifi_logger(); // Start wifi logger\n\n    while(1)\n    {\n        wifi_log_e(\"test\", \"%s %d %f\", \"hello world wifi logger\", 43, 45.341223242); // write log over wifi with log level -\u003e ERROR\n        wifi_log_w(\"test\", \"%s %d %f\", \"hello world wifi logger\", 43, 45.341223242); // write log over wifi with log level -\u003e WARN\n        wifi_log_i(\"test\", \"%s %d %f\", \"hello world wifi logger\", 43, 45.341223242); // write log over wifi with log level -\u003e INFO\n        wifi_log_d(\"test\", \"%s %d %f\", \"hello world wifi logger\", 43, 45.341223242); // write log over wifi with log level -\u003e DEBUG\n        wifi_log_v(\"test\", \"%s %d %f\", \"hello world wifi logger\", 43, 45.341223242); // write log over wifi with log level -\u003e VERBOSE\n\n        vTaskDelay(100);  // Wait for 100ms, prevent watchdog from triggering a reset\n    }\n}\n```\n\n## Detailed Documentation\n\n* https://vedantparanjape.github.io/esp-wifi-logger/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvedantparanjape%2Fesp-wifi-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvedantparanjape%2Fesp-wifi-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvedantparanjape%2Fesp-wifi-logger/lists"}