{"id":16239646,"url":"https://github.com/nopnop2002/esp-idf-net-logging","last_synced_at":"2025-03-19T16:31:31.604Z","repository":{"id":51227885,"uuid":"454268221","full_name":"nopnop2002/esp-idf-net-logging","owner":"nopnop2002","description":"Redirect esp-idf logging to the network","archived":false,"fork":false,"pushed_at":"2025-02-28T08:54:05.000Z","size":55,"stargazers_count":54,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-28T15:35:04.796Z","etag":null,"topics":["esp-idf","esp32","logger","logging","redirects"],"latest_commit_sha":null,"homepage":"","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/nopnop2002.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}},"created_at":"2022-02-01T05:05:44.000Z","updated_at":"2025-02-28T08:54:09.000Z","dependencies_parsed_at":"2023-01-29T23:15:37.117Z","dependency_job_id":"da2fdc10-9f6a-46d7-ab7a-9132e23d74cd","html_url":"https://github.com/nopnop2002/esp-idf-net-logging","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp-idf-net-logging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp-idf-net-logging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp-idf-net-logging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fesp-idf-net-logging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nopnop2002","download_url":"https://codeload.github.com/nopnop2002/esp-idf-net-logging/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244006260,"owners_count":20382441,"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","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":["esp-idf","esp32","logger","logging","redirects"],"created_at":"2024-10-10T13:44:31.737Z","updated_at":"2025-03-19T16:31:31.599Z","avatar_url":"https://github.com/nopnop2002.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# esp-idf-net-logging\nRedirect esp-idf logging to the network.\n\n\nesp-idf has a Logging library.   \nThe Logging library contains the ```esp_log_set_vprintf``` function.   \nBy default, log output goes to UART0.    \nThis function can be used to redirect log output to some other destination, such as file or network.    \n\nI made a project that uses 3 UARTs of ESP32.   \nBut I was in trouble because there was no logging output destination.   \nSo I made this.   \n\n\nThe following protocols are available for this project.\n- UDP   \n- TCP   \n- MQTT   \n- HTTP(POST)   \n\nI referred to [this](https://github.com/MalteJ/embedded-esp32-component-udp_logging).\n\n# Software requirements\nesp-idf v4.4/v5.x.   \n\n\n# Installation\n```Shell\ngit clone https://github.com/nopnop2002/esp-idf-net-logging\ncd esp-idf-net-logging/basic\nidf.py menuconfig\nidf.py flash\n```\n\n# Configuration   \n![config-top](https://user-images.githubusercontent.com/6020549/151915919-d6f19861-8d48-4630-aeed-aab819929dc6.jpg)\n\n## Configuration for UDP Redirect\n![config-udp](https://github.com/nopnop2002/esp-idf-net-logging/assets/6020549/5a9914ff-53a7-44f9-9ebf-08641c5123da)\n\nThere are the following four methods for specifying the UDP Address.\n- Limited broadcast address   \n The address represented by 255.255.255.255, or \\\u003cbroadcast\\\u003e, cannot cross the router.   \n Both the sender and receiver must specify a Limited broadcast address.   \n\n- Directed broadcast address   \n It is possible to cross the router with an address that represents only the last octet as 255, such as 192.168.10.255.   \n Both the sender and receiver must specify the Directed broadcast address.   \n __Note that it is possible to pass through the router.__   \n\n- Multicast address   \n Data is sent to all PCs belonging to a specific group using a special address (224.0.0.0 to 239.255.255.255) called a multicast address.   \n I've never used it, so I don't know anything more.\n\n- Unicast address   \n It is possible to cross the router with an address that specifies all octets, such as 192.168.10.41.   \n Both the sender and receiver must specify the Unicast address.\n\n\n## Configuration for TCP Redirect\nESP32 works as a TCP client.   \n![config-tcp](https://github.com/nopnop2002/esp-idf-net-logging/assets/6020549/1f3a2609-2cce-498b-96fd-e5cf598552af)\n\nYou can use the mDNS hostname of such a TCP server instead of the IP address.   \ntcp-server.local   \n\n\n## Configuration for MQTT Redirect\n![config-mqtt](https://github.com/nopnop2002/esp-idf-net-logging/assets/6020549/d27be5d2-6a1a-4c5f-86c9-6cdf4394d137)\n\n\n## Configuration for HTTP Redirect\nESP32 works as a HTTP client.   \n![config-http](https://github.com/nopnop2002/esp-idf-net-logging/assets/6020549/ea09b7e6-a95a-4351-8fb8-d6d9a9c398cb)\n\nYou can use mDNS host name for your http server.\n\n## Disable Logging to STDOUT\n![config-stdout](https://github.com/nopnop2002/esp-idf-net-logging/assets/6020549/c8516a79-4c55-414f-b0b6-41eff0006e72)\n\n## Use xRingBuffer as IPC\n![config-xRingBuffer](https://github.com/nopnop2002/esp-idf-net-logging/assets/6020549/53aef0cc-0e44-4f19-a10c-d55bc78ef091)\n\nBoth xMessageBuffer and xRingBuffer are interprocess communication (IPC) components provided by ESP-IDF.   \nSeveral drivers provided by ESP-IDF use xRingBuffer.   \nThis project uses xMessageBuffer by default.   \nIf you use this project at the same time as a driver that uses xRingBuffer, using xRingBuffer uses less memory.   \nMemory usage status can be checked with ```idf.py size-files```.   \n\n# View logging   \nYou can view the logging using python code or various tools.   \n- for UDP   \n ![net-logging-udp](https://user-images.githubusercontent.com/6020549/182273454-834cedb7-d884-4a89-823f-13e5d7a1c6b5.jpg)   \n You can use ```netcat``` as server.   \n ![netcat-udp](https://user-images.githubusercontent.com/6020549/198207929-649537ae-0c4e-45ed-8c88-7167505b124e.jpg)   \n We can use [this](https://apps.microsoft.com/detail/9nblggh52bt0) as Logging Viewer.   \n Note that the most recent logging is displayed at the __top__.   \n ![windows-udp-server](https://github.com/user-attachments/assets/0313b845-1a8d-4e06-9a02-1bb91de895d2)   \n We can also use [this](https://apps.microsoft.com/detail/9p4nn1x0mmzr) as Logging Viewer.   \n Note that the most recent logging is displayed at the __buttom__.   \n I like this one better.   \n ![windows-udp-server-11](https://github.com/user-attachments/assets/1d373809-7774-4e84-9256-2f81ec74368d)   \n There are others if you look for them.   \n\n- for TCP   \n ![net-logging-tcp](https://user-images.githubusercontent.com/6020549/182273510-92cf406b-7197-4cfe-9ff6-5421dc8eea8d.jpg)   \n You can use ```netcat``` as server.   \n ![netcat-tcp](https://user-images.githubusercontent.com/6020549/198230565-4fece92e-349f-4555-aba6-2196d3b6c040.jpg)   \n We can use [this](https://sourceforge.net/projects/sockettest/) as Logging Viewer.   \n ![windows-tcp-server-1](https://github.com/user-attachments/assets/76baaaba-2453-47d1-8acc-6f045413fdcc)   \n\n- for MQTT   \n The wifi logging is output in two parts.   \n First time:W (7060) wifi:   \n Second time:Characters after that   \n In MQTT and HTTP, it is displayed separately in two.   \n __If you use broker.emqx.io, continuous Logging will drop.__   \n ![net-logging-mqtt](https://user-images.githubusercontent.com/6020549/182273560-fc1931bf-71f7-4751-a57d-680312a93391.jpg)   \n __Using a local MQTT server is stable.__   \n You can use [this](https://github.com/nopnop2002/esp-idf-mqtt-broker) as a broker.   \n ![net-logging-mqtt-local](https://user-images.githubusercontent.com/6020549/182275982-63581071-c0b0-4851-a928-b5e2286b6893.jpg)\n\n- for HTTP   \n ![net-logging-http](https://user-images.githubusercontent.com/6020549/182273590-26281a3c-c048-466a-9d00-764981f89b49.jpg)\n\n# Disable ANSI Color control\nYou can disable this if you are unable to display ANSI color codes correctly.   \n![ANSI-Color](https://github.com/user-attachments/assets/c36b5f74-e85a-48c0-b498-5cb5301f0d24)   \n\nEnable ANSI Color control   \n![windows-udp-server](https://github.com/user-attachments/assets/0313b845-1a8d-4e06-9a02-1bb91de895d2)   \n\nDisable ANSI Color control   \n![windows-udp-server-2](https://github.com/user-attachments/assets/38d2c698-5690-402c-9419-a7dfe639e4d7)   \n\n\n# API   \nUse one of the following.   \nSubsequent logging will be redirected.   \n```\nesp_err_t udp_logging_init(char *ipaddr, unsigned long port, int16_t enableStdout);\nesp_err_t tcp_logging_init(char *ipaddr, unsigned long port, int16_t enableStdout);\nesp_err_t mqtt_logging_init(char *url, char *topic, int16_t enableStdout);\nesp_err_t http_logging_init(char *url, int16_t enableStdout);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnopnop2002%2Fesp-idf-net-logging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnopnop2002%2Fesp-idf-net-logging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnopnop2002%2Fesp-idf-net-logging/lists"}