Go Down

Topic: ENC28J60 + EtherCard == Fails to Initialize?? (Read 2 times) previous topic - next topic

amites

I have an arduino Uno that I have been learning to tinker with recently, tried adding a Ardruino Ethernet Shield v1.1 with the goal of having a networked client upload sensor data to a remote server

trick is that no existing libraries have been working

tried several

  • https://github.com/jcw/ethercard

  • https://github.com/turicas/Ethernet_ENC28J60



the process goes that while running through setup() the initialization for ether.begin causes the system to hang

I've tried this using IDE 1.0.0, 1.0.1, 1.0.2, and 1.0.3

if I set a static IP for a server example then I am able to ping the server but otherwise get no-where

the ethercard example I referred to has an added snippet at line 29

Code: [Select]
  if (ether.begin(sizeof Ethernet::buffer, mymac) == 0)
    Serial.println( "Failed to access Ethernet controller");
  Serial.println("Greetings Ethernet");


so that it will print to the serial monitor regardless of pass or fail, seems that either I've connected something wrong (likely) or something is wrong with the library (unlikely since it's been in use for a bunch of others)

trick is I don't know what I hooked up wrong, the shield slides into the Uno properly... -- that and being able to ping an IP has me scratching my head

got this shield from eBay so perhaps it has an odd configuration that I'm not aware of??


hope the rambling isn't too difficult to follow  -- trying to include anything that would be useful to debug

moelski

Hi amites,

I actual also work woth the ENC28J60. I use a pollin board where this chip is embedded.
I had the same problems getting even a ping running.

After searching a while I found this answer (An overloaded begin):
Code: [Select]
ether.begin(sizeof Ethernet::buffer, mymac, 4)

The 4 is the Digital Arduino pin where the Chip Select (CS) from the ENC28J60 is connected.
4 is the Pin which is used for my board. So I would suggest to see if this fits to your board.

Dominik
Grüße Dominik
www.logview.info

PaulS

Quote
tried adding a Ardruino Ethernet Shield v1.1 with the goal of having a networked client upload sensor data to a remote server

trick is that no existing libraries have been working

tried several

    https://github.com/jcw/ethercard
    https://github.com/turicas/Ethernet_ENC28J60

The Arduino Ethernet Shield does not use an ENC28J60 chip. It uses a W5100. Why are you trying to use these libraries with that chip?

amites

moelski -- THANK YOU!!!

had to set line 26 to

Code: [Select]
  if (ether.begin(sizeof Ethernet::buffer, mymac, 10) == 0)


in examples/webClient

working

PaulS:: The ENC28J60 chip is the one one this board, all I did was write what I can read on the board -- not saying this is an OFFICIAL Arduino Ethernet Shield -- that's simple what's printed on the board

Go Up