Hello guys,
I have one "etherShield" (an Ethernet shield that uses the Microchip ENC28J60 controller) and it does not work with the standard Arduino Ethernet library. It works with the etherShield library (http://www.nuelectronics.com/estore/?p=12) but is very very painful to write code for it (we need to implement ARP and TCP actions in the "application" layer - you can see examples in http://www.nuelectronics.com/download/projects/etherShield.zip).
The good news is that Microchip ENC28J60 is cheaper than WIZnet W5100. So I decided to write a new library (for now it's called Ethernet_ENC28J60) compatible with Arduino Ethernet examples, Ethernet.cpp, Server.cpp and Client.cpp - to do it I'm writing a socket layer that exposes the same API the standard Ethernet library does.
For now I can create a TCP server with some limitations -- but it works! I modified the WebServer example to make it more simple and actually I can complete a HTTP request successfully.
I'm planning to turn it fully-compatible with Arduino Ethernet shield library and want to know if we can merge this code in the Ethernet library when it is done -- so we can support both controllers, with the same code (maybe adding "#define ENC28J60" to application's code so the Ethernet library can switch between the "card driver").
Note: I posted an email about this in the developers mail list but as it wasn't answered, I'm posting here. What is the best place to this kind of topic?
Sounds great!
Might use it in a future project that I have been delaying because of this (expensive wiznet and bad support for the enc28j60).
I'm now watching the project @github (awesome code sharing platform by the way) to be up-to-date.
One question, which are the differences between the ethernet and fullstack repos at github?
chiva:
Might use it in a future project that I have been delaying because of this (expensive wiznet and bad support for the enc28j60).
I'm now watching the project @github (awesome code sharing platform by the way) to be up-to-date.
Very nice!
chiva:
One question, which are the differences between the ethernet and fullstack repos at github?
Please ignore FullStack - I started with this project trying to change Ethernet.cpp, Server.cpp and Client.cpp but I decided to rewrite only socket.c instead of all those files. Rewriting just socket.c may be more painful but it'll more easy to maintain compatility with Arduino Ethernet Library, write "drivers" for other controllers and also improving the actual Ethernet library.
I'll delete the FullStack repository in a near future.
If you can, please try the examples I sent to the repository and send news about it! Now working on connect().
alvarojusten:
So I decided to write a new library (for now it's called Ethernet_ENC28J60) compatible with Arduino Ethernet examples, Ethernet.cpp, Server.cpp and Client.cpp - to do it I'm writing a socket layer that exposes the same API the standard Ethernet library does.
Very nice! Happy to hear it. Bringing up my ENC28J60 is my next project, so I will definitely check this out. I mostly need a client, so maybe I can pitch in for your efforts
As to getting it in as an official library, definitely finish it first. Then the code can be reviewed and really proposed.
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).
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.
If you can use the library, please give me your feedback.
Thanks.
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
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.
/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
/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.
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!