Remove debug webserver output on a esp8266 wifi serial bridge

Hi,
I've made a Serial/Wifi bridge with an esp8266.
I works well until I gad the Webserver function.
Now on my serial I've lots of debug information when I connect the webserver or click on button.
I've try to had in my code

  Serial.setDebugOutput(false);

I've put the debug level to nothing
I've change the Tools "Debug port" on Serial1 but now the bridge doesn't works.

Do you have any idea how to stop the debug of the webserver ?

Thanks for your help

which webserver library are you using?

I take it from
https://www.esp8266.com

That’s a forum link… not a library

For webserver I take the code from this webpage

https://randomnerdtutorials.com/esp8266-web-server/

So the library is installed from " esp8266 by ESP8266 Community"

Thanks

This is still not a link to the library but I will guess this is the WiFiServer class you get from the default include or ESP8266WiFi.h as I see that in the example

When you search for what happens it’s always useful to go look into the source code

So source code is here

In the associated .cpp they include debug.h and have a few calls to their DEBUGV() macro

This macro is defined here and you see the macro can be deactivated (empty code) based on the DEBUG_ESP_CORE

So the question becomes where an you play with this flag DEBUG_ESP_CORE

Now you have a keyword to search in Google and you should find easily that this is a flag passed during compilation

https://docs.platformio.org/en/latest/platforms/espressif8266.html#serial-debug

Some flags are made visible in the IDE tools menu so I would go look there if by any chance the esp8266 tools would expose an ability to set the debug level when you compile your app and searching for that would lead to

https://arduino-esp8266.readthedocs.io/en/latest/Troubleshooting/debugging.html

——-

Hope this helps you become self sufficient for digging into questions, finding source code and understanding behavior from the code is super useful

Hi J-M-L,
Thanks for all this informations.
I've tested the debug flag but when the debug information are removed all the serial is down and my bridge is off.
I tried to redirect debug to Serial1 while my bridge is on Serial but the debug information are still there.
I tried to find where the debug are printed in the code to find if there is a flag but I don't find them.
Here is the debug information I receive with Debut port= Serial1 and Debug Level "Wifi" or "HTTP Request" the informations are quite the same

GET /5/on HTTP/1.1
Host: 192.168.0.1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,/;q=0.8
Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
DNT: 1
Connection: keep-alive
Upgrade-Insecure-Requests: 1

Thanks for you help

do you have a Serial.begin(xxx) in your setup?

post your code.

Hi,
Of course I've one for my UDP/Serial bridge
Here is my code
Wifi_UDP_USART_BRIDGE_V3.ino (9.0 KB)
In need to clean it when all will work.

have you removed the Serial.setDebugOutput(false);?
( By default the diagnostic output from WiFi libraries is disabled when you call Serial.begin)

Yes at line 85 in my code.

I can't read the .ino from my phone.

have you tried without that?

I've tried
Debug with Port Serial or Serial1
Serial.setDebugOutput( false) or Serial1.setDebugOutput( false)
With different debug Level
Nothing => still debug frame
NoAssert => No more Serial ouput with Serial1
MDNS=> still debug frame

I can't test all the possibilities it is insane !!!
Do you think it is possible to import the lib in the sketch directory and remove all the debug output?

if you set the debug level to None

and just compile

void setup() {
  Serial.begin(115200);
  Serial.println("Hello World");
}
void loop() {}

do you see Hello World ?

No nothing output with this code and configuration

interesting.... and weird...

I'm on my iPhone so can't really explore much. worth digging into this

have you tried pressing reset on your ESP32 once the Serial monitor was open?

The debug frame are send each time I click on the button.