{"id":18148292,"url":"https://github.com/github0null/esp32c3-wifi-logger","last_synced_at":"2025-04-06T21:47:25.395Z","repository":{"id":258894358,"uuid":"874078324","full_name":"github0null/esp32c3-wifi-logger","owner":"github0null","description":"esp32 无线日志记录工具","archived":false,"fork":false,"pushed_at":"2025-01-09T07:01:21.000Z","size":1375,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-13T03:51:39.781Z","etag":null,"topics":["esp32","logger","uart","wifi"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/github0null.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-10-17T08:07:36.000Z","updated_at":"2025-01-09T07:01:24.000Z","dependencies_parsed_at":"2024-10-30T04:37:57.071Z","dependency_job_id":null,"html_url":"https://github.com/github0null/esp32c3-wifi-logger","commit_stats":null,"previous_names":["github0null/esp32c3-wifi-logger"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github0null%2Fesp32c3-wifi-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github0null%2Fesp32c3-wifi-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github0null%2Fesp32c3-wifi-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github0null%2Fesp32c3-wifi-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/github0null","download_url":"https://codeload.github.com/github0null/esp32c3-wifi-logger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247557805,"owners_count":20958047,"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":["esp32","logger","uart","wifi"],"created_at":"2024-11-01T23:07:53.229Z","updated_at":"2025-04-06T21:47:25.376Z","avatar_url":"https://github.com/github0null.png","language":"Python","readme":"## 无线串口日志打印工具\n\n在开发调试电子产品的过程中，有时候不方便将串口接到电脑看日志，有时候需要长时间抓取日志，也不方便一直连着电脑\n\n这时候可以使用无线串口工具，借助WIFI，来远程打印日志，并进行持久记录\n\n![](./images/web.png)\n\n### 所需硬件\n\n一个 ESP32-C3 开发板模块，请自行购买，比如：\n\nhttps://github.com/WeActStudio/WeActStudio.ESP32C3CoreBoard\n\nhttps://www.nologo.tech/product/esp32/esp32c3SuperMini/esp32C3SuperMini.html#%E7%AE%80%E4%BB%8B\n\n### 固件烧录\n\n\u003e 需自行安装 python 包 esptool\n\u003e 以及 Python Thonny 软件\n\n首先 Clone 本仓库到你的桌面\n\n- 全片擦除\n  ```shell\n  esptool --chip esp32c3 --port \u003c串口名字\u003e erase_flash\n  ```\n\n- 烧录micropython固件\n  ```shell\n  esptool --chip esp32c3 --port \u003c串口名字\u003e --baud 921600 write_flash -z 0x0 ./firmware/firmware-v1.23.0.bin\n  ```\n\n- 用 Python Thonny 打开 client 目录：\n\n  由于模块需要连接到局域网络，因此我们要给它配置一个**现有的WIFI，让它去连接**\n\n  注意：WIFI必须是2.4G的，不支持5G WIFI\n\n  打开 `app.py` 文件，找到如下配置项，填写 WIFI 名字，密码，保存\n  ```\n  CFG_WLAN_SSID   = '\u003cSSID\u003e'\n  CFG_WLAN_PASS   = '\u003cPASS\u003e'\n  ```\n\n  然后将该目录下的所有文件上传到你的 esp32 板子\n\n### 使用\n\nesp32板子的默认串口配置：波特率 115200，TX 为 0 号脚，RX 为 1 号脚\n\n把上述的 esp32 板子的 TX, RX, VCC, GND 连接到你需要记录日志的设备上，然后给你的设备通电。\n\nesp32板子的指示灯会亮起，待指示灯熄灭后，代表网络已连接\n\n由于没有屏幕设备，因此需要使用 局域网扫描工具 获取 esp32 的 IP 地址\n\n![](./images/scan.png)\n\n扫描到地址后，在浏览器中直接访问该 ip 即可进入日志查看 WEB 页面\n\n### 在线配置\n\n访问 /settings 路径，可以在线修改配置，重启后生效\n\n![](./images/web_settings.png)\n\n可用的配置\n\n|键|类型|描述|\n|:---|:---|:---|\n|CFG_DEVICE_TAG|string|设备标签，当有多个设备时，可通过修改标签区分不同设备|\n|CFG_WLAN_SSID|string|WIFI名称|\n|CFG_WLAN_PASS|string|WIFI密码|\n|CFG_UART_BAUD|int|串口波特率|\n|CFG_UART_PIN_TX|int|串口TX脚号|\n|CFG_UART_PIN_RX|int|串口RX脚号|\n|CFG_LED_PIN|int|LED指示灯脚号|\n|CFG_RMT_SERVER_EN|int|是否启用远程日志持久记录（默认关闭）|\n|CFG_RMT_SERVER|string|远程记录服务ip地址|\n|CFG_RMT_PORT|int|服务器端口，默认60000|\n\n### 日志持久记录\n\n默认的 web 页面只能临时查看日志，如果要同时持续记录日志到文件，需要运行日志记录器\n\n方法如下：\n\n在电脑上安装 NodeJS\n\ncd 到 server 目录下，运行 `node ./rmt_recorder.js` 即可运行日志记录服务，默认端口号 60000\n\n访问 http://你的esp32的ip/settings 路径，打开上一步中 WEB 配置页面，进行如下修改：\n\n```\nCFG_RMT_SERVER_EN=1\nCFG_RMT_SERVER='填上一步运行node命令的电脑的ip'\n```\n\n将设备断电再通电，等待 esp32 设备连接到网络后，会自动连接到服务程序\n\n此时应该能看到日志记录服务的日志 `new connection: xxxxx`\n\n而设备的日志将被记录到 ./log_xxx.xxx.xxx.xxx.log\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub0null%2Fesp32c3-wifi-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgithub0null%2Fesp32c3-wifi-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub0null%2Fesp32c3-wifi-logger/lists"}