552
edits
| Line 176: | Line 176: | ||
If you get ENC28J60 version 0 - this means that the ATmega has failed to make contact with the ENC28J60 - and this is often a soldering fault on the PCB. If you have an ohm-meter, make sure that pin 14 of the ATmega (Digital 8) has good continuity with pin 9 of the ENC28J60 - AND that it is not shorted to 0V, +5V, +3V3 or any other nearby signal which would prevent it from switching cleanly between levels. Dig 8 comes very close to the 3V3 connector on the "Wireless" connector - an easy place to get a solder short. | If you get ENC28J60 version 0 - this means that the ATmega has failed to make contact with the ENC28J60 - and this is often a soldering fault on the PCB. If you have an ohm-meter, make sure that pin 14 of the ATmega (Digital 8) has good continuity with pin 9 of the ENC28J60 - AND that it is not shorted to 0V, +5V, +3V3 or any other nearby signal which would prevent it from switching cleanly between levels. Dig 8 comes very close to the 3V3 connector on the "Wireless" connector - an easy place to get a solder short. | ||
Assuming that the ENC28J60 initialises correctly, it will flash the yellow and green LEDs on the ethernet connector - simultaneously 3 times at about one second intervals. This confirms that the ENC28J60 has been initialised. | |||
The code then performs a DHCP discover - sending a DHCP request to the router. If this DHCP request is answered, it then populates the various IP arrays for myIP, gwIP, DNS_IP etc and prints them out to the serial terminal as follows. | |||
My IP: 192.168.0.6 | |||
Netmask: 255.255.255.0 | |||
DNS IP: 192.168.0.1 | |||
GW IP: 192.168.0.1 | |||
You have now completed the testing phase of the Nanode and can move onto some real applications. | |||
'''EtherShield_Webserver''' | |||
Now from the Files/EtherShield/Examples load the EtherShield_webserver sketch. | |||
Once again edit the initialisation line from (mymac) to (mymac,8) | |||
es.ES_enc28j60Init(mymac); | |||
es.ES_enc28j60Init(mymac,8); | |||
Now compile and upload the code to the Nanode board | |||
If successful you should first get the compilation report message: | |||
Binary sketch size: 6422 bytes (of a 30720 byte maximum) | |||
And "Done Uploading" | |||
Now open a new window of your browser and point it to the IP Address as defined by My IP in the last example | |||
My IP: 192.168.0.6 | |||
So open up http://192.168.0.6/ | |||
And your Nanode should serve its first webpage. It doesn't do much, but does have a clickable link to Andy Lindsay's blog page. | |||
Now, edit the code and chance every reference to Arduino in these lines to Nanode | |||
so the code looks like this: | |||
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<html><head><title>Nanode ENC28J60 Ethernet Shield V1.0</title></head><body>")); | |||
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<center><h1>Welcome to Nanode ENC28J60 Ethernet Shield V1.0</h1>")); | |||
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<hr><br><h2><font color=\"blue\">-- Put your Nanode online -- ")); | |||
Now re-compile and upload and refresh your browser window - you should see the text changes you made in the code reflected in the served page. | |||
edits