Go Down

Topic: Ethernet Shield ENC28J60 with Uno Rev3 (Read 5796 times) previous topic - next topic

mitjafelicijan

Sep 14, 2012, 11:58 am Last Edit: Sep 14, 2012, 12:01 pm by mitjafelicijan Reason: 1
I am having difficulties with getting to work this two together. I have tried other libraries and was not able to get them working. Other stuff (such as sensors and led) is working fine.

I am using Arduino Uno Rev3
Ethernet Shield for Arduino Uno R1 R2 R3 - ENC28J60 RJ45 - http://goo.gl/JEIX5
Arduino-1.0.1 software
Ubuntu 11.04

The problem is that it cant get an ip address from router. I have also tried declaring static ip and it didnt work. All this I tried without adding any other libraries.

I also tried other libraries such as
http://code.google.com/p/flamingoarduino
https://github.com/thiseldo/EtherShield

I also found this thread http://arduino.cc/forum/index.php/topic,27556.0.html but most of the links are not working anymore.

When I tried it with flamingoarduino I got this error:

Code: [Select]
arduino-1.0.1/libraries/EncEthernet/enc28j60.c:18:55: error: WConstants.h: No such file or directory
arduino-1.0.1/libraries/EncEthernet/enc28j60.c: In function 'enc28j60ReadOp':
arduino-1.0.1/libraries/EncEthernet/enc28j60.c:46: error: 'LOW' undeclared (first use in this function)
arduino-1.0.1/libraries/EncEthernet/enc28j60.c:46: error: (Each undeclared identifier is reported only once
arduino-1.0.1/libraries/EncEthernet/enc28j60.c:46: error: for each function it appears in.)
arduino-1.0.1/libraries/EncEthernet/enc28j60.c:60: error: 'HIGH' undeclared (first use in this function)
arduino-1.0.1/libraries/EncEthernet/enc28j60.c: In function 'enc28j60WriteOp':
arduino-1.0.1/libraries/EncEthernet/enc28j60.c:66: error: 'LOW' undeclared (first use in this function)
arduino-1.0.1/libraries/EncEthernet/enc28j60.c:73: error: 'HIGH' undeclared (first use in this function)
arduino-1.0.1/libraries/EncEthernet/enc28j60.c: In function 'enc28j60ReadBuffer':
arduino-1.0.1/libraries/EncEthernet/enc28j60.c:78: error: 'LOW' undeclared (first use in this function)
arduino-1.0.1/libraries/EncEthernet/enc28j60.c:92: error: 'HIGH' undeclared (first use in this function)
arduino-1.0.1/libraries/EncEthernet/enc28j60.c: In function 'enc28j60WriteBuffer':
arduino-1.0.1/libraries/EncEthernet/enc28j60.c:97: error: 'LOW' undeclared (first use in this function)
arduino-1.0.1/libraries/EncEthernet/enc28j60.c:109: error: 'HIGH' undeclared (first use in this function)
arduino-1.0.1/libraries/EncEthernet/enc28j60.c: In function 'enc28j60Init':
arduino-1.0.1/libraries/EncEthernet/enc28j60.c:163: error: 'OUTPUT' undeclared (first use in this function)
arduino-1.0.1/libraries/EncEthernet/enc28j60.c:164: error: 'HIGH' undeclared (first use in this function)
arduino-1.0.1/libraries/EncEthernet/enc28j60.c:170: error: 'INPUT' undeclared (first use in this function)
arduino-1.0.1/libraries/EncEthernet/enc28j60.c:173: error: 'LOW' undeclared (first use in this function)


I have then removed Ethernet library that comes with IDE and tried again and the problem was the same.

Maybe there is a problem with the version of Arduino IDE. I dont know. Does anybody have library that will work with this shield? I am fairly new to Arduino and I just cant seem to figure it out.

Update: Every sketch it tried was from examples that came with the specific library.

Thnx in advance.

pylon

Have you tried this library: http://jeelabs.net/projects/11/wiki/EtherCard?

I don't own a ENC28J60 hardware but there were several successful projects using this library with that hardware in the forum.

PaulS

Quote
arduino-1.0.1/libraries/EncEthernet/enc28j60.c:18:55: error: WConstants.h: No such file or directory

That library clearly has not been update for 1.0(+). Feel free to do so.

tochinet

Support and development for the "old" Ethernet libraries for ENC28J60 were stopped more than one year ago. The best library (1.0 compatible) to use now is EtherCard from jcw (on Github).

mitjafelicijan

To solve this you should copy arduino-1.0.1/hardware/arduino/cores/arduino/Arduino.h into your working sketch folder and change

#include "WConstants.h"

to

#include "Arduino.h"

pylon

You don't have to copy Arduino.h, just include it.

Go Up