Offline
Newbie
Karma: 0
Posts: 6
|
 |
« on: February 22, 2013, 11:07:55 am » |
Hi Guys,
I have been looking round the forum and general internet to find a solution. I hope that this hasnt been answered before, but nothing came up in the search
I have connected the Ethernet shield to the MEGA but I cannot get a connection to the network using any of the Example codes in the IDE 1.0.3 - Both units have been purchased in the last two weeks so should be the latest versions.
Is there something I am doing wrong - all code compiles and gets sent correctly to the board.
Things I have tried: I make sure that the MAC address is correctly assigned (I have tried assigning a made up one as well but no joy)
Setting static IP and DHCP assigned ones - no joy
removed SD card
I have seen a couple of posts regarding pins and patching them to other connections but surely the R3 shields should work directly with a mega R3 board without having to do this (the idea of a shield?)
Any ideas
|
|
|
|
« Last Edit: February 22, 2013, 11:12:34 am by slothy »
|
Logged
|
|
|
|
|
Offline
Full Member
Karma: 2
Posts: 128
W9LZ
|
 |
« Reply #1 on: February 22, 2013, 08:33:25 pm » |
Are you absolutely sure that the MAC address matches the device? Try using the TELNET Client example. Does ipconfig /all give you any more info? I've got a clone MEGA and the Arduino Ethernet shield comes dangerously close to the electrolytic cans (ground?) over by the power connector pins. I'm using my MEGA clone in a production environment, or I'd give it a try.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 35
Posts: 1240
|
 |
« Reply #2 on: February 23, 2013, 02:35:24 am » |
Please show us your code. Did you set pin 53 as output ? // Set SPI SS pin as output. // It is not used but it needs to be output for the SPI. pinMode(53, OUTPUT); // Only for the Mega
Use DHCP and what is the IP address ? Serial.println(Ethernet.localIP());
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 6
|
 |
« Reply #3 on: February 23, 2013, 03:49:46 am » |
Hi Erdin, thanks for the Reply. I am using the standard DHCPAddressPrinter that comes with the software. I have added your SPI code but still no joy. /* DHCP-based IP printer This sketch uses the DHCP extensions to the Ethernet library to get an IP address via DHCP and print the address obtained. using an Arduino Wiznet Ethernet shield. Circuit: * Ethernet shield attached to pins 10, 11, 12, 13 created 12 April 2011 modified 9 Apr 2012 by Tom Igoe */
#include <SPI.h> #include <Ethernet.h>
// Enter a MAC address for your controller below. // Newer Ethernet shields have a MAC address printed on a sticker on the shield byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 };
// Initialize the Ethernet client library // with the IP address and port of the server // that you want to connect to (port 80 is default for HTTP): EthernetClient client;
void setup() { // Set SPI SS pin as output. // It is not used but it needs to be output for the SPI. pinMode(53, OUTPUT); // Only for the Mega pinMode(53, OUTPUT); // Open serial communications and wait for port to open: Serial.begin(9600); // this check is only needed on the Leonardo: while (!Serial) { ; // wait for serial port to connect. Needed for Leonardo only }
// start the Ethernet connection: if (Ethernet.begin(mac) == 0) { Serial.println("Failed to configure Ethernet using DHCP"); // no point in carrying on, so do nothing forevermore: for(;;) ; } // print your local IP address: Serial.print("My IP address: "); for (byte thisByte = 0; thisByte < 4; thisByte++) { // print the value of each byte of the IP address: Serial.print(Ethernet.localIP()[thisByte], DEC); Serial.print("."); } Serial.println(); }
void loop() {
}
|
|
|
|
|
Logged
|
|
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 6
|
 |
« Reply #5 on: February 23, 2013, 09:02:17 am » |
Ok. Tried that code and in the serial window I get Starting W5100 0.0.0.0 It repeats if I press any of the reset buttons
|
|
|
|
|
Logged
|
|
|
|
|
Miramar Beach, Florida
Offline
Faraday Member
Karma: 50
Posts: 3450
|
 |
« Reply #6 on: February 23, 2013, 09:06:21 am » |
Then you have either an SPI fail or w5100 fail. Check the connector pins closely, especially the ICSP pins. That is how the SPI data lines get to the Mega.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 6
|
 |
« Reply #7 on: February 23, 2013, 10:42:40 am » |
Ok,
I have just had a look at the two boards and I noticed this (see attached picture)
Now it's time to test my soldering skills out!!!
Fingers crossed that this fixes the problem!
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Tesla Member
Karma: 50
Posts: 6549
Arduino rocks
|
 |
« Reply #8 on: February 23, 2013, 10:53:11 am » |
When I first put an ethernet shield on a mega, I had the pin alignment on one side off by a pin. A close inspection of correct pins in the correct holes solved the issue.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 6
|
 |
« Reply #9 on: February 23, 2013, 10:55:54 am » |
Bingo - or should I say PING!! Thanks guys for all the help  Still surprised that this got through the QA stage of manufacture (or do they not test a shield against it?) Time to get a smaller soldering tip, but initial testing says that the join is good  Pinging 192.168.100.36 with 32 bytes of data: Reply from 192.168.100.36: bytes=32 time=352ms TTL=1 Reply from 192.168.100.36: bytes=32 time<1ms TTL=128 Reply from 192.168.100.36: bytes=32 time<1ms TTL=128 Reply from 192.168.100.36: bytes=32 time<1ms TTL=128 Now I can try some stuff out -
|
|
|
|
|
Logged
|
|
|
|
|
Miramar Beach, Florida
Offline
Faraday Member
Karma: 50
Posts: 3450
|
 |
« Reply #10 on: February 23, 2013, 11:31:41 am » |
I've not seen that before. It appears it is not soldered, also not trimmed? I don't know about QA. It is not mil spec, so they do not test every part. But you think they would have caught that.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Tesla Member
Karma: 50
Posts: 6549
Arduino rocks
|
 |
« Reply #11 on: February 23, 2013, 11:38:13 am » |
Still surprised that this got through the QA stage of manufacture (or do they not test a shield against it?) The board has "made in italy", so what are the expectations?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 6
|
 |
« Reply #12 on: February 23, 2013, 02:49:22 pm » |
I've not seen that before. It appears it is not soldered, also not trimmed?
I think it was the first time the shield was attached it pushed the pin through, I just didn't notice! Looks like the solder hole was never filled (it is now  )
|
|
|
|
|
Logged
|
|
|
|
|
Miramar Beach, Florida
Offline
Faraday Member
Karma: 50
Posts: 3450
|
 |
« Reply #13 on: February 23, 2013, 02:54:25 pm » |
That makes sense. It was aligned (not soldered) until you attached the shield. Good deal on the repair. 
|
|
|
|
|
Logged
|
|
|
|
|
|