JoaoLopesF / RemoteDebug

Library for Arduino to debug projects over WiFi, with web app or telnet, with print commands like Serial Monitor
MIT License
613 stars 127 forks source link

Getting a debug in startup #38

Closed MagTun closed 5 years ago

MagTun commented 5 years ago

Hi,

I am trying to print some values from the startup. I tried to do it by doing this: 1) using your basic example 2) right before the end of startup (below the long list of Serial.println()), I add these lines:

delay(15000);  // this gives me time to connect Putty, 
rdebugDln("startup done");
delay(1000); 
Debug.handle();
delay(5000); // instead of the  yield();

But in Putty, I dont see the startup done, I only see the debug from the loop. In the docs you mention that Debug.handle(); should be in loop. But is there a way to also use it in startup.

JoaoLopesF commented 5 years ago

HI @MagTun

To debug setup code, I recomend you enable serialoutput: Debug.setSerialEnabled(true); And use serial monitor to see the messages, not need extra delays And when done, you can disable serial output, just comment the command setSerialEnabled.

For me, It is a better solution, that I use when need debug setup codes. Server and high delays is not good ...

Regards

João

MagTun commented 5 years ago

Thanks for your reply and sorry for the delays. So it means that if I can't connect my nodemcu to my computer to get the serial monitor, I won't be able to get a debug from start?