alejho / arduino-telnet-client Goto Github PK
View Code? Open in Web Editor NEWa minimal (but real) telnet client for Arduino, actually able to login and send commands to a generic telnet server
License: GNU General Public License v3.0
a minimal (but real) telnet client for Arduino, actually able to login and send commands to a generic telnet server
License: GNU General Public License v3.0
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...
Cannot even login to my router even I input the correct credentials. Where should I check this one? Thanks!
I just noticed that it calls #include "ESP8266telnetClient.h"
instead of #include "ESP8266telnetClient.h"
Hi, are you still supporting this library? Got this error when compiling.
In file included from C:\Users\ABC\Documents\Arduino\telnetMikrotikRouter\telnetMikrotikRouter.ino:1:0:
C:\Users\ZACHARY\Documents\Arduino\libraries\Arduino-Telnet-Client-master/TelnetClient.h:47:33: warning: large integer implicitly truncated to unsigned type [-Woverflow]
const uint8_t PROMPT_REC_TOUT = 300;
^
In function 'global constructors keyed to 65535_0_telnetMikrotikRouter.ino.cpp.o':
lto1.exe: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
lto-wrapper.exe: fatal error: C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc returned 1 exit status
compilation terminated.
c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/bin/ld.exe: error: lto-wrapper failed
collect2.exe: error: ld returned 1 exit status
exit status 1
Also trying your sample has an error:
In file included from C:\Users\ABC\Documents\Arduino\libraries\Arduino-Telnet-Client-master\examples\telnetMikrotikRouter\telnetMikrotikRouter.ino:1:0:
C:\Users\ZACHARY\Documents\Arduino\libraries\Arduino-Telnet-Client-master/TelnetClient.h:47:33: warning: large integer implicitly truncated to unsigned type [-Woverflow]
const uint8_t PROMPT_REC_TOUT = 300;
^
Thanks!
Hi! Im using you library for connect arduino to mikrotik router with enc28j60 shield. But this shield doesn't work with standard arduino Ethernet library and I have to use UIPEthernet library. With UIPEthernet i have error, could you help me?
`telnetMikrotikRouter:7:23: error: no matching function for call to'telnetClient::telnetClient(UIPClient&)'
telnetClient tc(client);
^
In file included from C:\Users\Barkanum\AppData\Local\Temp\arduino_modified_sketch_957500\telnetMikrotikRouter.ino:1:0:
C:\Program Files (x86)\Arduino\libraries\Arduino-Telnet-Client-master/TelnetClient.h:54:5: note: candidate: telnetClient::telnetClient(EthernetClient&)
telnetClient(EthernetClient& client);
^
C:\Program Files (x86)\Arduino\libraries\Arduino-Telnet-Client-master/TelnetClient.h:54:5: note: no known conversion for argument 1 from 'UIPClient' to 'EthernetClient&'
C:\Program Files (x86)\Arduino\libraries\Arduino-Telnet-Client-master/TelnetClient.h:50:7: note: candidate: constexpr telnetClient::telnetClient(const telnetClient&)`
Hi alejho !
I'm back again and i'm using your latest version of library.
I'm still encountering this Login Hang.
I'm stuck here in logging in.
This is the printed output.
Logging in..
login|connecting...
login|connected!
Here is the code I used
Serial.println("Logging in..");
if (tc.login(mikrotikRouterIp, "admin", "arduino")) { //tc.login(mikrotikRouterIp, "admin", "", 1234) if you want to specify a port different than 23
Serial.println("username/password sent.");
tc.sendCommand("ip hotspot user");
}
I'm stuck here, not printing username/password sent output. Hoping that you're still working with this. Thank you !
I am having problems, I want to send the next command
tc.sendCommand("system identity print");
I want to store the result in a variable. But I haven't been able to make it work.
This is my sample command:
/ip hotspot user add name=newuser password=newuser limit-uptime=00:10:00 profile=hotspot-user
It doesn't add to my router.
Here I am again, I encountered Hang in Login phase. Here's the output:
Initializing : 5
Initializing : 4
Initializing : 3
Initializing : 2
Initializing : 1
connecting...
Connected, Logging in..
a
Basically, I'm making delays for the arduino to initialize the ethernet shield. (5 seconds in my case).
after 5 seconds delay. I will try to connect to Mikrotik using this
if (client.connect(mikrotikRouterIp, 23))
if connection is successful then arduino will run this code.
`delay(5000);
if(tc.login(mikrotikRouterIp, "admin", "MyPass", 23)){
}
after executing login code, I got "a" in my serial monitor.
here's my sample command
String St1 ="add profile=Vendo limit-uptime=01:"; String St2 =":00 server=all name="; String St3 =" password=pass"; String FinalSt = St1 + Mins + St2 + wificode + St3; Serial.println(FinalSt); tc.sendCommand(FinalSt);
Error thrown: error: no matching function for call to 'telnetClient::sendCommand(String&)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.