From b95e0eb04ea16803fb36b8272162c3d481016508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=88=90=E9=94=B4?= Date: Sat, 25 Feb 2023 19:11:36 +0800 Subject: [PATCH] update: fix example mistake --- examples/demo/demo.ino | 8 +++++++- examples/demo_ap/demo_ap.ino | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/examples/demo/demo.ino b/examples/demo/demo.ino index a7d962e..063706e 100644 --- a/examples/demo/demo.ino +++ b/examples/demo/demo.ino @@ -53,8 +53,14 @@ void setup() { void loop() { delay(2000); + // we suggest you to use `print + "\n"` instead of `println` + // because the println will send "\n" separately, which means + // it will cost a sending buffer just for storage "\n". (there + // only 8 buffer space in ESPAsyncWebServer by default) WebSerial.print(F("IP address: ")); - WebSerial.println(WiFi.localIP()); + // if not use toString the ip will be sent in 7 part, + // which means it will cost 7 sending buffer. + WebSerial.println(WiFi.localIP().toString()); WebSerial.printf("Millis=%lu\n", millis()); WebSerial.printf("Free heap=[%u]\n", ESP.getFreeHeap()); } \ No newline at end of file diff --git a/examples/demo_ap/demo_ap.ino b/examples/demo_ap/demo_ap.ino index 507895a..a8c42f9 100644 --- a/examples/demo_ap/demo_ap.ino +++ b/examples/demo_ap/demo_ap.ino @@ -50,8 +50,14 @@ void setup() { void loop() { delay(2000); + // we suggest you to use `print + "\n"` instead of `println` + // because the println will send "\n" separately, which means + // it will cost a sending buffer just for storage "\n". (there + // only 8 buffer space in ESPAsyncWebServer by default) WebSerial.print(F("IP address: ")); - WebSerial.println(WiFi.localIP()); + // if not use toString the ip will be sent in 7 part, + // which means it will cost 7 sending buffer. + WebSerial.println(WiFi.localIP().toString()); WebSerial.printf("Millis=%lu\n", millis()); WebSerial.printf("Free heap=[%u]\n", ESP.getFreeHeap()); } \ No newline at end of file