Arduino Ethernet and ENC28J60 Module ?

Guys,

Can I use Arduino Ethernet library with ENC28J60 Module ?
thanks

No, not with included one,
you must ether use :
GitHub - njh/EtherCard: EtherCard is an IPv4 driver for the ENC28J60 chip, compatible with Arduino IDE : small footprint but does not share the same api as the legacy library

or

GitHub - ntruchsess/arduino_uip: UIPEthernet: A plugin-replacement of the stock Arduino Ethernet library for ENC28J60 shields and breakout boards. Full support for persistent (streaming) TCP-connections and UDP (Client and Server each), ARP, ICMP, DHCP and DNS. Build around Adam Dunkels uIP Stack. Further developed version can be found on https://github.com/UIPEthernet/UIPEthernet : which share the same api so your application will be easier to port to W5100 but used to have bigger memory footprint, may not still be the case, due to recent optimizations.

I tried this one :
http://www.geeetech.com/wiki/index.php/Arduino_ENC28J60_Ethernet_Module

I deleted the original Ethernet library and got these errors :

In file included from C:\arduino-1.5.2\libraries\ENC28J60/Ethernet.h:5,

  • from WebServer.ino:19:*
    C:\arduino-1.5.2\libraries\ENC28J60/Client.h:22: error: conflicting return type specified for 'virtual void Client::write(uint8_t)'
    C:\arduino-1.5.2\hardware\arduino\avr\cores\arduino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)'
    C:\arduino-1.5.2\libraries\ENC28J60/Client.h:24: error: conflicting return type specified for 'virtual void Client::write(const uint8_t*, size_t)'
    C:\arduino-1.5.2\hardware\arduino\avr\cores\arduino/Print.h:53: error: overriding 'virtual size_t Print::write(const uint8_t*, size_t)'
    In file included from C:\arduino-1.5.2\libraries\ENC28J60/Ethernet.h:6,
  • from WebServer.ino:19:*
    C:\arduino-1.5.2\libraries\ENC28J60/Server.h:16: error: conflicting return type specified for 'virtual void Server::write(uint8_t)'
    C:\arduino-1.5.2\hardware\arduino\avr\cores\arduino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)'
    C:\arduino-1.5.2\libraries\ENC28J60/Server.h:18: error: conflicting return type specified for 'virtual void Server::write(const uint8_t*, size_t)'
    C:\arduino-1.5.2\hardware\arduino\avr\cores\arduino/Print.h:53: error: overriding 'virtual size_t Print::write(const uint8_t*, size_t)'
    WebServer:25: error: 'IPAddress' does not name a type
    WebServer:30: error: 'EthernetServer' does not name a type
    WebServer.ino: In function 'void setup()':
    WebServer:41: error: 'ip' was not declared in this scope
    WebServer:42: error: 'server' was not declared in this scope
    WebServer:44: error: 'class EthernetClass' has no member named 'localIP'
    WebServer.ino: In function 'void loop()':
    WebServer:50: error: 'EthernetClient' was not declared in this scope
    WebServer:50: error: expected `;' before 'client'
    WebServer:51: error: 'client' was not declared in this scope

Client::write returns void, not size_t like required by stream.
the library you use is dated, I think it was for pre-1.0 versions

ok, do you know where I can find for V1.5 ? thanks

that was in my first post, did you try it ?

I've tried ethercard, it works, but doesn't work with tinyFAT, any ideas ?
thanks

I don't see why it would not work, what kind of error do you get ?