GithubHelp home page GithubHelp logo

alejho / arduino-telnet-client Goto Github PK

View Code? Open in Web Editor NEW
23.0 23.0 24.0 32 KB

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

C++ 100.00%

arduino-telnet-client's People

Contributors

alejho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

arduino-telnet-client's Issues

tc.sendCommand returns true everytime

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...

login failed error

Cannot even login to my router even I input the correct credentials. Where should I check this one? Thanks!

Error while compiling Test

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!

How to Validate the Response from Mikrotik

Noob Question,,

Sir I'm new to arduino.. I would like to ask.. if it possible to evaluate the Mikrotik Response. Because I would to know sir.. if the user is being duplicated.. Thank you...

ARDUINO SKETCH

aa1

SERIAL MONITOR

aa2

enc28j60

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&)`

Login Hang using updated library.

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 !

Send a command and store the result

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.

Login Hang

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.

Question: How can I Send a command from string ?

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&)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.