Implementation for Microchip ENC28J60 Ethernet controller

Tkanks for your reply

So, UDP are fully implemented ? We are able to send & receive packets correctly ?
For TCP, it work too ? You just don't have implemented file server for the access by browser (& GET requests, etc ...) ?

Good luck, it's a good job that will surely help the community

I have see nice, cheap (10$) & small boards with the chip:

Nice for DIY projects ...
8)

++

Hmm, I have probably confused with the topic I just posted.

This was the one I built...

Back to the problem!

Cheers,
Kari

No problem anymore, never was, just wrong libraries. Ethershield...
:disappointed_relieved:

Cheers,
Kari

Goes:
I have see nice, cheap (10$) & small boards with the chip:

Nice for DIY projects ...

Yeah, these look great. Where have you seen them for $10?! I've only seen them for $17.

Hello alvarojusten
I have been using your library and webserver examples for the enc28j60 and they work great. Thank you for your work.
My idea is to use a microSD breakout board with the enc28j60, read files from the sd card and send them over ethernet.
I have been using this > EmbeddedMarket.com
and >EmbeddedMarket.com
Using the simplified library(Simon Monk's) I can read from the sd card and send files over the ethernet.
However there are a few problems:

1.With Simon Monk's library the size of the files that can be sent is limited by the buffer size. To send the contents of the buffer I have to use the e.respond(); which closes the connection to the client and no more data can be sent.
2. With your library if I only write this one line #include <SD.h> and make no other additions to the sketch the webserver example stops working (the board replies to pings but if i open the address in a browser it just keeps waiting). I assume the problem is a buffer overrun.

Regarding this I have a few questions I will be thankful if you can help.
Is it possible fill the buffer with chars and send the contents of the buffer to the client without closing the connection?
To explain further : Read single chars from the file on sd card > fill the buffer with these chars > send the packet when the buffer is full > continue reading from file and begin filling buffer again > repeat till the whole file is sent.

If we can implement this, we can have fully functional web servers working off the arduino+enc28j60.
Hoping you can help me with this. Bravo for the good work again !!

I tried the code from GitHub - turicas/Ethernet_ENC28J60: [NOT MAINTAINED, NOT COMPLETED] Implementation of an Arduino-compatible socket layer library that uses Microchip ENC28J60 Ethernet controller. change the IP then upload the program. Upon entering the address in a web browser it didn't load. What do you think is the problem?

I have a different ethernet board but I wired it the same way as the one from http://www.nuelectronics.com/estore/?p=12. I already tested it with other code like the one from http://blog.thiseldo.co.uk/?p=344.

Hope I can make progress with this code since I find it easier to use.

Hi Alvaro !

Any news about your famous library :slight_smile: ?

Cheers!

I tried WebServerSimple and it worked. I can ping my board and access it from a browser.
But only for a while. After that I get the connection lost. No more ping or browser access.

Do you have any idea. I've been struggling for 3 days and nothing.

Thanks in advance.
Inacio

the library is on a very early stage of development, so don't expect it to run flawlessly

Guys, excuse me for this so long delay answering you - I did a lot of trips to free software conferences, had some healthy problems and (unfortunately) Arduino Forum stopped sending emails to my inbox when someone post here.
Let's go - my next comments will have the answers for you!

GaryP:
Finally I got my project started and assembled.
I have communication ok, I can program the MCU.... ethernet circuit is alive, at least it is powered, but I'm not sure if it's really talking with the prosessor. When I open browser and try to connect any IP inside the subnet, this blinks the green light like somebodys knocking, but I can't get response from it.

I have checked this dirty PCB so many times in last two days, that I'm just blind if there's shortcuts or missing links. Schematic has been turned upside down while tracing the problem, components are correct values. Voltages are in tolerances.

WebServerDebug don't give anything.

Hmm, what is the purpose of these dip swithes? I didn't put them for two reason; I don't have suitable and I don't know if it is nessessary in basic testing.

About codes, I only changed the IP-address to much my network, everything else is intact.

It just don't play the game with me, any tips left? Thanks!!!

Cheers,
Kari

Are you using a shield/module based on ENC28J60 Ethernet controller? If yes, please try to run WebServerSimple example (do not run Debug example) and do a request with a light Web client (like wget or curl) -- actually the library stores all the request and, as it is using a lot of memory, if your browser send a lot of information on request it can stop the sketch because of full memory. In future I'll optimize it, but this library will aways use more memory than Wiznet W5100 since with ENC28J60 we need to control everything since Ethernet layer.

Goes:
So, UDP are fully implemented ? We are able to send & receive packets correctly ?
For TCP, it work too ? You just don't have implemented file server for the access by browser (& GET requests, etc ...) ?

Good luck, it's a good job that will surely help the community

No, UDP is not implemented yet and I'm working on client-side TCP now (server-side works with some limitations). My roadmap is to finish TCP (even limited), implement UDP and then start to remove limitations and do optimizations.

Goes:
I have see nice, cheap (10$) & small boards with the chip:

Very nice! Where did you find it?
I found one bigger for $10 at Sure Electronics:

suvenk:
I have been using your library and webserver examples for the enc28j60 and they work great. Thank you for your work.
My idea is to use a microSD breakout board with the enc28j60, read files from the sd card and send them over ethernet.
I have been using this > EmbeddedMarket.com
and >EmbeddedMarket.com
Using the simplified library(Simon Monk's) I can read from the sd card and send files over the ethernet.
However there are a few problems:

1.With Simon Monk's library the size of the files that can be sent is limited by the buffer size. To send the contents of the buffer I have to use the e.respond(); which closes the connection to the client and no more data can be sent.

Wow, there are a lot of companies that assembles ENC28J60 modules. I really need to buy more modules to test compatibility! If do you know people at these companies and you think they can give me one board (free) for testing, please contact me via direct message!
Actually, my library also have this limitation. I need to implement the calculation of TCP packet number so we can send more than one packet per connection. Now I can't do it because I'm working on TCP client-side (3-way handshake), but it is in the roadmap.

suvenk:
2. With your library if I only write this one line #include <SD.h> and make no other additions to the sketch the webserver example stops working (the board replies to pings but if i open the address in a browser it just keeps waiting). I assume the problem is a buffer overrun.

It looks like a memory issue (when you include SD library, it uses more RAM and ATMega can't store all the request info). Please try to do a light request, using wget or curl.

suvenk:
Regarding this I have a few questions I will be thankful if you can help.
Is it possible fill the buffer with chars and send the contents of the buffer to the client without closing the connection?
To explain further : Read single chars from the file on sd card > fill the buffer with these chars > send the packet when the buffer is full > continue reading from file and begin filling buffer again > repeat till the whole file is sent.

If we can implement this, we can have fully functional web servers working off the arduino+enc28j60.
Hoping you can help me with this. Bravo for the good work again !!

For now we can't do it. But, as I said, it is a known limitation and is planned to be removed soon. :slight_smile:
Thanks for using and helping the project!

nomad13:
I tried the code from GitHub - turicas/Ethernet_ENC28J60: [NOT MAINTAINED, NOT COMPLETED] Implementation of an Arduino-compatible socket layer library that uses Microchip ENC28J60 Ethernet controller. change the IP then upload the program. Upon entering the address in a web browser it didn't load. What do you think is the problem?

Can you ping the board? If yes, probably your browser is sending too much information in headers, so use a light HTTP client (like wget and curl) - I'll try to remove this limitation.

nomad13:
I have a different ethernet board but I wired it the same way as the one from http://www.nuelectronics.com/estore/?p=12. I already tested it with other code like the one from http://blog.thiseldo.co.uk/?p=344.

The code from http://blog.thiseldo.co.uk/?p=344 works?

joseinaciojr:
I tried WebServerSimple and it worked. I can ping my board and access it from a browser.
But only for a while. After that I get the connection lost. No more ping or browser access.

Do you have any idea. I've been struggling for 3 days and nothing.

Hello Inacio,
did you do any modifications in WebServerSimple example? Please try to use a lighty HTTP client such as wget and curl, do a lot of subsequent requests (without concurrency) and tell me if the sketch stopped to work (if yes, with how many requests using wget/curl).

Thanks for working on this. I'm sure it will be a big help to the community.

I recently purchased one of the eBay EtherShields with the intention of using it in conjunction with the iPhone app Ardumote (which uses only UDP messaging), but once I started digging around trying to code anything using the supplied ENC28J60 library I realized it wasn't worth the effort and ordered an Arduino W5100 Ethernet Shield. With your efforts however, I'm sure I will find a use for my ENC28J60 based shield one day and many others will benefit from the lower cost ethersheild!

Has anyone experience with this library and the nanode ? (http://wiki.hackspace.org.uk/wiki/Project:Nanode)

I tried to edit the file enc28j60.c as follows : #define ENC28J60_CONTROL_CS 8
without any success.

it would be easier to help if you said what the error was.

did you change also change the following?
#define SPI_SS 8

did the sketch compile and run with the default CS/SS pin?

The sketch uploads without any problem.
What happens is that the board does not respond to either a ping or a http request, even after modification of the SPI_SS constant.

mmoz:
Has anyone experience with this library and the nanode ? (http://wiki.hackspace.org.uk/wiki/Project:Nanode)

Where can I buy a nanode for testing?