First off big thanks to ntruchsess for all his great work on the library!
I'm trying to get the ENC28J60 to work with my Duemilanove but I've had no luck. I've tried changing Ethernet.h -> UIPEthernet.h and running the stock Webserver sketch and I've tried the EchoServer example from the UIPEthernet library.
The only thing I get it the "server is at 192.168.1.144" Serial Printing (My router is 192.168.1.1, Subnet = 255.255.255.0).
Any suggestions would be greatly appreciated as I've been fighting this for a week now trying all the possible libraries.
I've got {SCK , SO, SI, CS} to {13 , 12 , 11 , 10}; and here are my code parameters: uint8_t mac[6] = {0x00,0x01,0x02,0x03,0x04,0x05}; IPAddress ip(192,168,1,144); EthernetServer server(80);
does the shield work using any other library (e.g. ethercard)? Any other hardware connected to SPI (e.g. SD-card-reader)?
One of my shields that uses the ICSP-connector for SPI refused to work just because the connector was aprox. 1mm to short to connect reliably...
The headers seem to be long enough (using female - to male headers) and solder joints all seems solid. No other libraries are being used. Only wires going from arduino are the SPI, CS, 3v3, GND.
ok, so what do you expect the echoserver-sketch to do?
What it does:
it opens a serverside socket on the ip-address/port you specify in the sketch and prints out the 'server is at ...' message. Then it waits for clients to connect.
you then can connect using 'telnet ' from your pc. Anything you send in this telnet-session to the arduino is going to be echoed back.
Trying to open the EchoServer-example with your browser will not work.
But maybe your wiring is not ok (eg. it is easy to swap MISO and MOSI...). Following the wiring-diagram from here should be fine.
Thanks for the help! I got the EchoServer working. I didn't get the telnet idea, now I do lol...
Weird thing though, I'm trying to get the WebServer example to work but I feel like I'm so close!
I've changed Ethernet.h to UIPEthernet.h and I've tried commenting out SPI.h and leaving it in.
So here's the serial output: server is at 192.168.1.140 new client G[]T / HTTP/1.1 Host: 192.168.1.140 Connection: keep-alive Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8 User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.63 Safari/537.31 Accep[]-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8,fr-CA;q=0.6,fr;q=0.4 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 []
You'll notice that when I type the address in my browser it creates the connection. Nothing happens though, the browser just hangs there trying to connect until it eventually gives up. Any thoughts?
I solved it!!! Code and circuitry were fine all along.
It was a power supply issue. Turns out my laptop wasn't supplying enough juice to power up my Arduino + ENC28J60 via USB. I used a 12v wall wart and it worked!
An side: I had tried a 10 uF cap across 3v3 and Gnd before trying the external power but it wasn't enough...
Does anyone know how much current the ENC28J60 uses?