From 6c671efad2033ab392763a38beeabbf46109564d Mon Sep 17 00:00:00 2001 From: tobozo Date: Fri, 29 Sep 2017 10:38:03 +0200 Subject: [PATCH] Extract logs from deauther Implemented on request from @crystalg21 #624, logs can now be extracted from the web UI by accessing http://192.168.4.1/log.txt Some TODOs if this PR is accepted: - Output log to serial - Add links to the web UI --- esp8266_deauther/esp8266_deauther.ino | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/esp8266_deauther/esp8266_deauther.ino b/esp8266_deauther/esp8266_deauther.ino index f9ecd3c..d76f96b 100644 --- a/esp8266_deauther/esp8266_deauther.ino +++ b/esp8266_deauther/esp8266_deauther.ino @@ -195,6 +195,11 @@ void loadStyle() { sendFile(200, "text/css;charset=UTF-8", data_styleCSS, sizeof(data_styleCSS)); } +void loadLog() { + File logFile = SPIFFS.open("/log.txt", "r"); + server.streamFile(logFile, "text/plain"); + logFile.close(); +} void startWiFi(bool start) { if (start) startWifi(); @@ -563,6 +568,7 @@ void setup() { server.on("/restartESP.json", restartESP); server.on("/addClient.json",addClient); server.on("/enableRandom.json",enableRandom); + server.on("/log.txt",loadLog); server.begin();