Implementation for Microchip ENC28J60 Ethernet controller

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?

alvarojusten:
Where can I buy a nanode for testing?

Sent you a PM with details.

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

Where did you find this for $10?

Cheers,

I see that the picture has an embedded name on it - I found an ebay listing with that pictures' users name with the same item the listing was buy it now for 15.95 + 6 shipping from hong kong.

pantonvich:
I see that the picture has an embedded name on it - I found an ebay listing with that pictures' users name with the same item the listing was buy it now for 15.95 + 6 shipping from hong kong.

Can you supply the link, please?

http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=120571109230&ih=002&category=4660&ssPageName=WDVW&rd=1#ht_1324wt_1163

doing a search on ebay for "ENC28J60"

this one is 9.44 includes shipping - but it looks like it doesn't have the 74HC
http://cgi.ebay.com/ENC28J60-LAN-Ethernet-Network-Module-AVR-51-LPC-STM32-/190548762559?pt=LH_DefaultDomain_0&hash=item2c5d975fbf#ht_3757wt_1163

Hi folks,
after a long time, I restarted the development of the library and there are new things at the GitHub repository!
The coolest one is the Makefile I wrote for WebServerDEBUG example (actually this is the example I'm using to test and develop new features of the library) -- it speeds up development since with a little command (or call from vim editor) I can compile and upload the entire project, so I don't need Arduino IDE anymore.
I'm correcting some problems related by users and we'll have a more stable version of what is implemented in next some days.

Perfect job!

Your Lib works with the DomoticHome Android App & Code Generator http://domotichome.heroku.com/masters

Thx

Hi Alvaro, i cant use your lib.. my upload is ok.. but when i try connect with browse.. "Oops! Google Chrome could not connect to 192.168.1.123" Sou brasileiro :smiley:

desktop:
Hi Alvaro, i cant use your lib.. my upload is ok.. but when i try connect with browse.. "Oops! Google Chrome could not connect to 192.168.1.123" Sou brasileiro :smiley:

Olá desktop, tudo bem? Você consegue pingar a placa? Se não consegue, pode ser que:

1- As configurações de IP estejam erradas.
2- Você tenha mais de um diretório começando por "Ethernet" no diretório "sketchbook/libraries" ou tenha compilado de forma incorreta a biblioteca.

Dê uma olhada nesses itens acima e tente novamente. Caso não consiga conectar pelo Google Chrome mas consiga pingar, dê um reset no Arduino e tente fazer um request HTTP utilizando um navegador mais lightweight como wget ou curl.

I am so glad, to found this topic here. :slight_smile:

i've the same problem, as mentioned above. when i ping my arduino, i get an answer. but if i try to load the ip in my browser it don`t work. so i tried with curl and it works. but why it dousn't work with other browsers such as firefox, chrome or opera?

Thanks for help :wink:

Edit:
Oh :slight_smile: i found the answer on page 5