Implementation for Microchip ENC28J60 Ethernet controller

Hello,

what about this instructable. He claims, that you can use the Arduino-Ethernet-library. I didn´t test it so far.

themroc:
what about this instructable. He claims, that you can use the Arduino-Ethernet-library. I didn´t test it so far.
http://www.instructables.com/id/A-credit-card-sized-Ethernet-Arduino-compatable-co/

Hello,
it uses the code from etherShield I mentioned above. "etherShiled" is different from "Ethernet shield" - "etherShield" refers to code (for ENC28J60 controller) that is hard to use and is not present on Arduino IDE; "Ethernet shield" refers to standard Arduino Ethernet shield and code (for controller W5100). If you download the .pde file he attached to the instructable you'll see that this code does not use the Arduino standard Ethernet library.
What I'm trying to do is to create a Arduino Ethernet-compatible library that works with both controllers (so you can use the same code for both).

Hi

This is perfect timing. I have a board and are about to start writing a skecth for it.

I would like very much to have support for DHCP and DNS

Best regards

Wolle:
This is perfect timing. I have a board and are about to start writing a skecth for it.

I would like very much to have support for DHCP and DNS

Hello Wolle,
firstly I'm trying to finish the socket layer (implementing part of TCP and UDP stacks). In the future I can work in another protocols (such DHCP, DNS etc.), but first I need to finish socket layer. :slight_smile:
If you can use the library, please give me your feedback.
Thanks.

Hi,

Compiling gives me errors ?

arduino-0022\libraries\turicasEthernet\utility\socket.c: In function 'connect':
arduino-0022\libraries\turicasEthernet\utility\socket.c:190: error: 'destinationPort' redeclared as different kind of symbol
arduino-0022\libraries\turicasEthernet\utility\socket.c:189: error: previous definition of 'destinationPort' was here
arduino-0022\libraries\turicasEthernet\utility\socket.c:210: error: redeclaration of 'sourcePort' with no linkage
arduino-0022\libraries\turicasEthernet\utility\socket.c:190: error: previous declaration of 'sourcePort' was here
arduino-0022\libraries\turicasEthernet\utility\socket.c:211: error: redeclaration of 'destinationPort' with no linkage
arduino-0022\libraries\turicasEthernet\utility\socket.c:190: error: previous declaration of 'destinationPort' was here

Hi alvarojusten,

This is fantastic news !

I am sure there are lots of people out there who are eagerly waiting your library. I just wanted to send you encouragement !!!

Cheers from Sg,
Keff

Enn40:
Hi,

Compiling gives me errors ?

arduino-0022\libraries\turicasEthernet\utility\socket.c: In function 'connect':
arduino-0022\libraries\turicasEthernet\utility\socket.c:190: error: 'destinationPort' redeclared as different kind of symbol
arduino-0022\libraries\turicasEthernet\utility\socket.c:189: error: previous definition of 'destinationPort' was here
arduino-0022\libraries\turicasEthernet\utility\socket.c:210: error: redeclaration of 'sourcePort' with no linkage
arduino-0022\libraries\turicasEthernet\utility\socket.c:190: error: previous declaration of 'sourcePort' was here
arduino-0022\libraries\turicasEthernet\utility\socket.c:211: error: redeclaration of 'destinationPort' with no linkage
arduino-0022\libraries\turicasEthernet\utility\socket.c:190: error: previous declaration of 'destinationPort' was here

Hello Enn40,
excuse me for that - I pushed a code that I didn't compile to verify syntax problems (it'll not happen again). Please download the library again and try it: the last commit I did to repository is working fine (maybe you can experience some bugs if you enable debugging, but the normal usage of the library is OK now).

keff_in_sg:
Hi alvarojusten,

This is fantastic news !

I am sure there are lots of people out there who are eagerly waiting your library. I just wanted to send you encouragement !!!

Hello Keff,
thanks! It'll be nice if you have an etherShield, test the library and give me more feedback.

Thanks ,

Web server simple led example gives me:

/arduino-0022/arduino-0022/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld.exe: WebServerSimpleLED.cpp.o: No such file: No such file or directory

Enn

Enn40:
Web server simple led example gives me:

/arduino-0022/arduino-0022/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld.exe: WebServerSimpleLED.cpp.o: No such file: No such file or directory

Sorry, I don't use Windows and don't know how to add customized libraries. What I can suggest is to move the Ethernet_ENC28J60 folder from sketchbook/libraries to the libraries folder in the Arduino installation path.

Sometimes the Arduino IDE gives me some errors about paths but I just need to recompile and it works fine -- maybe it could be your case too.

Yeah, I just pulled this, and compiled the examples, and they all compiled without any complaints. This is on OSX.

alvarojusten:
firstly I'm trying to finish the socket layer (implementing part of TCP and UDP stacks).

So, what's left to be done to get clients working?

maniacbug:
Yeah, I just pulled this, and compiled the examples, and they all compiled without any complaints. This is on OSX.

Nice! Did you opened your browser to test if page load fine?

alvarojusten:
Nice! Did you opened your browser to test if page load fine?

Nono, haven't touched the hardware yet. Just pulled down the software and started to dig through it.

What do you suggest as a simple test to see if the connections are even hooked up right?

Ok, actually just for fun, I threw this together.

Running WebServerDEBUG, I get this:

DEBUG:
  INIT
DEBUG:
  ANSWERING_RECEIVED_ARP_REQUEST
DEBUG:
  INIT
DEBUG:
  INIT
DEBUG:
  ANSWERING_RECEIVED_ARP_REQUEST
DEBUG:
  INIT
DEBUG:
  INIT
DEBUG:
  INIT
DEBUG:
  INIT
DEBUG:
  INIT
DEBUG:
  INIT
DEBUG:
  INIT
DEBUG:
  ANSWERING_RECEIVED_ARP_REQUEST
DEBUG:
  INIT
DEBUG:
  IGNORING_PACKET_NOT_FOR_ME
DEBUG:
  INIT
DEBUG:
  INIT
DEBUG:
  INIT

And this is what I did to trigger it (and yes, I changed the IP address in the example to this one)

$ wget http://192.168.1.98/
--2011-03-27 20:47:21--  http://192.168.1.98/
Connecting to 192.168.1.98:80... connected.
HTTP request sent, awaiting response... Read error (Operation timed out) in headers.

maniacbug:
And this is what I did to trigger it (and yes, I changed the IP address in the example to this one)

$ wget http://192.168.1.98/

--2011-03-27 20:47:21--  http://192.168.1.98/
Connecting to 192.168.1.98:80... connected.
HTTP request sent, awaiting response... Read error (Operation timed out) in headers.

I know about this problem. The fact is that debugging uses too much memory and probably it needs more memory than an Arduino have. The version without debugging works perfectly. In the next days I'll work on this problem to reduce memory usage of debugging routines and hope it be fixed. Please see for updates on GitHub!

W00t!!

$ wget -O - -q http://192.168.1.98/
analog input 0 is 8

analog input 1 is 1019

analog input 2 is 434

analog input 3 is 403

analog input 4 is 366

analog input 5 is 351

Ok so like I said before... What's left for the client?! :smiley:

maniacbug:
W00t!!

$ wget -O - -q http://192.168.1.98/

analog input 0 is 8

analog input 1 is 1019

analog input 2 is 434

analog input 3 is 403

analog input 4 is 366

analog input 5 is 351

Nice! :slight_smile:

maniacbug:
Ok so like I said before... What's left for the client?! :smiley:

Hahah. I need to debug TCP three-way handshake and modify send and disconnect functions.

alvarojusten:
Hahah. I need to debug TCP three-way handshake and modify send and disconnect functions.

Well, when you do, you've got a ready user and tester right here...

We make a slight change on the code and now it can work with our IE shield with D8 pin config XD

http://arduino.cc/forum/index.php/topic,57006.0.html

ITead:
We make a slight change on the code and now it can work with our IE shield with D8 pin config XD

http://arduino.cc/forum/index.php/topic,57006.0.html

Nice! Can you send me the modifications?