Serial port: prevent unwanted output of libraries (debug)

Hi,

I starting a project on something new for me using Nextion and Wemos D1 mini.

The pupose is to build an interactive information screen where I retrieve all kinds of dat from the net (weather, news, etc) but also home sensors and port that to the Nextion (using the ITEAD lib).

What now bothers me is that all kind of libraries to use (like the OpenWeatherMap or WifiClientSecure) have build-in serial output for debugging reasons. In these I did not find a global variable to manage their serial output.
Since I only have one Serial port on the Wemos I'm afraid these serial print messages to monitor/debug might interfere the Nextion communication. The single only serial port is used for Nextion.

Will the Nextion recognize these as not applicable and ignore these at all time?
Otherwise I would need to block/comment out these debug messages but it is a hard thing to do going through all the libs and sub-libs they again use.

Gr,
Ron

is it the ESP32 or ESP8266 version of the D1 mini?
if ESP32 it has three hardware serial ports if ESP8266 have a look at espsoftwareserial

Thanks for helping me.
It is an ESP8266.

Point still is how to dispatch Nextion and other lib messages to either serial port.
The other libs use the opened Serial when one is there.

The debug will go to the NOT connected hardware Serial; you should be using the software Serial. Bottom line: no conflicts.

Hi @Petjepet

The debug output for the "ESP8266WiFi" library is controlled by a custom board menu in the Arduino IDE Tools menu:

So just select Tools > Debug port > Disabled from the Arduino IDE menus to disable the debug output from that library.

I don't find a library of that name in Library Manager, so I was not able to investigate the debug serial output it produces. It might be that it uses the same standardized debug control system as the ESP8266WiFi library. If so, then disabling it via the Tools > Debug port menu will solve the problem for this "OpenWeatherMap" library as well.

If you find that the "OpenWeatherMap" library still produces unwanted serial output even after you set Tools > Debug port to "Disabled", please provide more information about the library so we can investigate further: Did you install it from Arduino IDE Library Manager? If so, please provide the exact name of the library as shown in Library Manager. Or if you downloaded the library directly from some website, please provide a link to the website.

When a library outputs serial for debug reason it is very likely that it has a procedure to switch off such debug outputs.
When you link to the respective library and explain what exactly get's printed you don't want to see, some will be able to check how this can be achieved.