Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tc.sendCommand returns true everytime #14

Open
cyreanne opened this issue Jul 15, 2021 · 4 comments
Open

tc.sendCommand returns true everytime #14

cyreanne opened this issue Jul 15, 2021 · 4 comments

Comments

@cyreanne
Copy link

cyreanne commented Jul 15, 2021

hello sir, im new to this page, this is not really an issue, but cant find a way to contact you and ask for help about my code
im trying to use the ESP8266 on arduino ide I used the library created by videojedi which is based on your library,
anyway I noticed on your telnetMikrotikRouter example, when i used it on ESP8266 on line number 41
" if(tc.login(mikrotikRouterIp, "admin", ""))"
this returns false when my login is successfull..
else statement is executed..
but this is not really my problem,
i want to check if username already exist on a hotspot server of mikrotik
i have this lines of code:

String mt_cmd ="/ip hotspot user add name=cyreanne password=cyreanne profile=1day server=hotspot1";
erMsg = "";
int datalen = mtcmd.length() +1;
char dataSend[datalen];
mt_cmd.toCharArray(dataSend, datalen);
if(tc.sendCommand(dataSend)){ //this always returns true
erMsg = "username already exist";
tc.disconnect();
Serial.println(erMsg);
}
else{
erMsg = "username added successfully";//so this is never executed even if username does not exist
tc.disconnect();
Serial.println(erMsg);
}
am I doing it right? or can you point me to the right direction sir.. thank you so much...

@melafaust
Copy link

good day say can you solve this issue upon compiling, thanks.

ESP8266TelnetClient.cpp:75:19: error: control reaches end of non-void function [-Werror=return-type]
75 | this->disconnect();
| ~~~~~~~~~~~~~~~~^~
cc1plus.exe: some warnings being treated as errors
exit status 1

@rexonECE
Copy link

good day say can you solve this issue upon compiling, thanks.

ESP8266TelnetClient.cpp:75:19: error: control reaches end of non-void function [-Werror=return-type] 75 | this->disconnect(); | ~~~~~~~~~~~~~~~~^~ cc1plus.exe: some warnings being treated as errors exit status 1

Hello, did you already solve this problem? We have same issues..

@kuatroestrellas
Copy link

good day say can you solve this issue upon compiling, thanks.
ESP8266TelnetClient.cpp:75:19: error: control reaches end of non-void function [-Werror=return-type] 75 | this->disconnect(); | ~~~~~~~~~~~~~~~~^~ cc1plus.exe: some warnings being treated as errors exit status 1

Hello, did you already solve this problem? We have same issues..

I solved it
replaces file ESP8266telnetClient.cpp line 75
"this->disconnect();" to "return false;"

@melafaust
Copy link

melafaust commented Mar 25, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants