esp8266 / Arduino

ESP8266 core for Arduino
GNU Lesser General Public License v2.1
16.09k stars 13.33k forks source link

lwip esp-ping noisy serial output #9049

Closed SteveRMann closed 9 months ago

SteveRMann commented 11 months ago

Basic Infos

Platform

Settings in IDE

Problem Description

PLEASE make a quiet mode for the ping function.

I use ping to monitor the state of my local servers, but the debug output of ping clutters an already busy terminal screen. PLEASE make a quiet mode that simply returns a Boolean true or false if the ping is successful or not.

I just want a simple response if the target is present or not: if (Ping.ping(remote_ip) == 0){

I DO NOT want the library to print other unwanted data to my terminal: "ping 5, timeout 0, total payload 160 bytes, 5098 ms"

If I want to see that, then it should be up to me, not the library.

mcspr commented 11 months ago

https://github.com/d-a-v/esp82xx-nonos-linklayer/blob/e4051dea44249d3d3b76e7772a3cf99d741b4506/glue-lwip/esp-ping.c#L252-L254 is the culprit. I'd guess it needs some kind of if PING_DEBUG around the printf

ACE1046 commented 11 months ago

Assign sent_function in ping_option structure and messages will go away.

d-a-v commented 11 months ago

@SteveRMann does the solution proposed by @ACE1046 suits you ?