How do I stop ESP8266 wifi messages?

I've tried everything, including changing the .cpp files etc., but I can't even figure out where they are coming from, here's a sample of what they look like.

GET / HTTP/1.1 Host: 192.168.1.40 Accept-Encoding: gzip, deflate Connection: keep-alive Upgrade-Insecure-Requests: 1 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15 Referer: http://192.168.1.40/ Cache-Control: max-age=0 Accept-Language: en-us

I've tried so far,

Serial.setDebugOutput(false);

define DEBUG_WIFI 0

define DEBUG_ESP_PORT 0

define DEBUG 0

I have set the tools debug to disable or none too. all to no avail.

Any more ideas. pert, you're an expert on this, I've read a bunch of your comments on the ESP subject!

Those are standard HTTP headers that most any HTTP server will send out as part of an HTTP request from a browser or other client. What on earth makes you think they need to be blocked??

they get in the way of all the other stuff I am sending to serial monitor.

sevenoutpinball: they get in the way of all the other stuff I am sending to serial monitor.

Well, then learn how HTTP works, and filter them out. It is easy enough to recognize and ignore the headers.

Serial.print uses HTTP? That’s news to me.

Where are the messages showing up, on the Serial port ?

@OP, you have been on this forum long enough to know better than this. You are asking for help but keeping us in the dark. We don't know what hardware, libraries or code you are using. All we can say is that text is http headers. What/why it's getting printed, we can't even guess without more info from you.

#include <stdio.h>
#include <string.h>
#include <Wire.h>
#include "MD_DS3231.h"
#include <Arduino.h>
#include <time.h>
#include <ESP8266WiFi.h>
#include "NTPClient.h"
#include <ESP8266mDNS.h>
#include <ArduinoOTA.h>
#include <WiFiUdp.h>
#include <Arduino.h>
#include <time.h> 
#include <ESP8266WiFi.h>
#include "NTPClient.h"
#include <ESP8266mDNS.h>
#include <ArduinoOTA.h>
#include <WiFiUdp.h>

Here are the includes. My code has nothing to do with what is sent to serial monitor. I’ve shown what is being printed. The device is a NodeMCU 1.0

Deva_Rishi: Where are the messages showing up, on the Serial port ?

Yes.

To clarify, every time I click the website, a page of stuff is being written to the serial monitor.

GET / HTTP/1.1
Host: 192.168.1.40
Accept-Encoding: gzip, deflate
Connection: keep-alive
Upgrade-Insecure-Requests: 1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15
Referer: http://192.168.1.40/
Cache-Control: max-age=0
Accept-Language: en-us

Please post a complete sketch that illustrates the problem

your sketch prints data received by WiFiClient created by WiFiServer?

In the serial monitor you get them whether you want them or not.

your code prints this

the code in the include statements sends this stuff

GET /light/off HTTP/1.1
Host: 192.168.1.40
Accept-Encoding: gzip, deflate
Connection: keep-alive
Upgrade-Insecure-Requests: 1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15
Referer: http://192.168.1.40/light/off
Cache-Control: max-age=0
Accept-Language: en-us

every time the screen refreshes, which is a nuisance.

What is a nuisance is that you have not posted a complete sketch that illustrates the problem

UKHeliBob:
Please post a complete sketch that illustrates the problem

It isn’t that it’s a problem per se, but that the extra verbiage coming from the #include <ESP8266WiFi.h> is annoying and was wondering if there was a way to turn it off.

I can pare down my program to the bare bones of the html send and receive, but it’s 649 lines long now and I can’t imagine anyone wading thru that much stuff much less running it.

OK, have it your own way but helping will be difficult

I assume that you want something output to the Serial monitor, not the HTTP messages that you are getting, but who knows ?

again. your code is doing it, not the include

I can pare down my program to the bare bones of the html send and receive, but it's 649 lines long now and I can't imagine anyone wading thru that much stuff much less running it.

The first thing that I would do given the program would be to determine what each Serial.print() in it was doing.

Have you done that ?