Go Down

Topic: Telnet Server for ENC28J60 Board (Read 9278 times) previous topic - next topic


Aargh...a newbie with stupid questions...

Yes, i am just starting with the Arduino.
My goal is, to replace the usb/serial interface with
a telnet server. The library of the ENC28J60 looks much more cryptical
than the genuine Ethernet lib.

There are some Webservers in the net, but no telnet.

So i would appreciate if someone gives me a hint or example



Have you searched this forum and the old forum for telnet?
Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0


Yes, i searched the old/new forum as well as several other sources in the web.
There are lots of examples with http servers on the ENC28J60 , but nothing with telnet.
The ethershield lib seems to be much more cryptical than the standard ethernet lib, so
at the moment i am not sure how to handle this.



I take it you never made any more progress on this? I'm going to take a stab at this myself. I agree that  the ENC (ethershield) library seems obtuse/cryptic. But I've managed to get it to work a little bit. It's definitely be nice to be able to just open a port (such as 23) and then from there use it like a serial connection to communicate with my sketch..


Hi, guys!  Any progress with telnet server?
I met the same problem and try to handle it next week.


The library at http://srmonk.blogspot.com/2010/03/simplified-ethernet-library-for-28j60.html is somewhat simpler than the original and i suppose that what you are looking for is some kind of chat server on the arduino (use port 23 instead of 80).


Thanks, poliveira1978.

Little report about solving the problem:
The only library I found for ENC28J60, is so called "etherShield" library.
All other pieces of code are just wrappers for that library.
Due to lack of memory TCP stack not fully implemented and server works in "1 packet" mode.

1) Establish connection, catch packet. 
2) Modify it (put ACK, interchange source - destination, fill data)
3) Send it back.
4) Drop the connection.

This makes telnet server implementation impossible, so next solution was used:
Arduino opens serial port, stores its output, when request comes, send collected data to PC.
Special client application was written for PC side, to send requests and process arduino output.

Buffer on arduino side is small and it takes only 50 msec to fill it, so I suspect problems working with UART on full speed, but for "console" mode the solution works fine.


There's a new library that replaces the ethershield one, it's "ethercard". A good solution for the lack of memory is to use a Teensy++ rather than an Atmega328. That gives you 4x as much SRAM.
I ended up just gutting the webserver example sketch and receiving my commands from the HTTP request.. so I send it http://arduinoipnumber/m5 and the sketch sees it's an m command, and I want #5.. (mode 5, in my case).. Nice and simple. I set it up to drop the connection without any kind of reply after receiving the command. It works great.


I'm trying to do something like this. not telnet, just a straight tcp server. the last time I worked with the ethershield, I did what you did. I just gave in and used the web server example. I'm rewriting my project to make some improvements, and this time, I'm not giving in to http. I'll be working on it until I have a tcp server. I'll figure it out one way or another. I'll have my code posted on my website and a few other places.


These days I have been playing with uIP and have found it to be quite powerful and stable.  The avr-uip project has ported it to AVR.

In a couple hours, I was able to get a telnet server up and running and adding my own commands.  In a few more hours, I had a wget implementation working, pulling down files from websites at 180kbytes/sec.  Not rocket fast, but great for a constrained MCU.  Also it has "protosockets", so it should be able to implement higher-level protocols such as whatever you want to do with a "TCP Server".

The downside is that it is not compatible with the Arduino IDE, and it's pretty arcane.  So for any kind of newbie, I say stick to the official Ethernet boards.

Also today I stumbled across NanodeUIP which looks to be a port of uIP to work with Nanode.  Nanode is an Arduino clone plus an ENC28J60 ethernet in one, so it should be compatible with anyone else's EtherShields based on that chip.  Not sure how far along NanodeUIP is, or how it deals with the uIP configuration tradeoffs.  It's certainly worth a look, though.


itead has arduino clone with wiznet eth for $29


I just received 2 and am playing with them now.

Go Up