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

Serial output not working #33

Closed jeroenst closed 5 years ago

jeroenst commented 5 years ago

When using this code: Debug.setSerialEnabled(true); Debug.begin(esp_hostname); Debug.setResetCmdEnabled(true); Debug.setCallBackProjectCmds(&processCmdRemoteDebug); DEBUG("\n"); DEBUG("ESP8266 started...\n"); Serial.println("\n\nHello\n"); Debug.printf("Hello2\n");

The ESP8266 started (and everyting with the debug macro after this code) is not printed when using the DEBUG macro. The Hello and Hello2 are printed.

What's wrong?

jeroenst commented 5 years ago

Bug is caused by _PasswordOk on line 445

JoaoLopesF commented 5 years ago

Hi @jeroenst

Yes, It is correct. I made a version 1.5.3, only use password logic if this is enabled

Please update and verify

jeroenst commented 5 years ago

I see your fix. But I think it would be better that serial debugging always works if enabled, also when a password is used on the telnet interface (which is great actually and I will use from now on!)

jeroenst commented 5 years ago

Tested your fix, it works when no password is defined. When a password is defined, the RemoteDebug lib has building errors.

JoaoLopesF commented 5 years ago

@jeroenst , sorry by delay. Please send the error

jeroenst commented 5 years ago

/home/jeroen/Arduino/libraries/RemoteDebug/RemoteDebug.cpp: In member function 'boolean RemoteDebug::isActive(uint8_t)': /home/jeroen/Arduino/libraries/RemoteDebug/RemoteDebug.cpp:454:17: error: '_PasswordOk' was not declared in this scope boolean ret = (_PasswordOk && ^ /home/jeroen/Arduino/libraries/RemoteDebug/RemoteDebug.cpp: In member function 'void RemoteDebug::showHelp()': /home/jeroen/Arduino/libraries/RemoteDebug/RemoteDebug.cpp:744:15: error: '_PasswordAttempt' was not declared in this scope help.concat(_PasswordAttempt); ^ /home/jeroen/Arduino/libraries/RemoteDebug/RemoteDebug.cpp: In member function 'void RemoteDebug::processCommand()': /home/jeroen/Arduino/libraries/RemoteDebug/RemoteDebug.cpp:1139:44: error: a function-definition is not allowed here before '{' token void RemoteDebug::setFilter(String filter) { ^ /home/jeroen/Arduino/libraries/RemoteDebug/RemoteDebug.cpp:1150:33: error: a function-definition is not allowed here before '{' token void RemoteDebug::setNoFilter() { ^ /home/jeroen/Arduino/libraries/RemoteDebug/RemoteDebug.cpp:1161:77: error: a function-definition is not allowed here before '{' token String RemoteDebug::formatNumber(uint32_t value, uint8_t size, char insert) { ^ /home/jeroen/Arduino/libraries/RemoteDebug/RemoteDebug.cpp:1199:1: error: expected '}' at end of input } ^ exit status 1 Error compiling for board Generic ESP8285 Module.

jeroenst commented 5 years ago

_passwordOk in .h is _PasswordOk in .cpp _passwordAttempt in .h is _PasswordAttempt in .cpp and there is a } missing on line 891 of RemoteDebug.cpp

jeroenst commented 5 years ago

Works with version 3.0.5