Hi
I'll try to explain my problem properly, but I've been struggling so hard with it over the last week and I know I haven't actually fully understood the problem, let alone managed to work out how to start solving it. With a view to the above, please be kind and help me to explain it better if I didn't manage!
I'm using the W5100 "red" breakout board purchased on eBay with a Mega 2560. (See attached image.) Previously I used this board with my MQTT project using the standard ethernet library and the knolleary Arduino Client for MQTT on a Nano V3. The red ethernet board and Nano V3 still work a treat. It seems safe to say there are no electrical issues with the red ethernet board for this reason.
When I ported over to the Mega 2560, it worked when I used the correct pins: Mega 50-52 for SPI and Mega 10 for chip select. (i.e. NSS (CS) > Mega 10, MI > 50, MO > 51, SOK > 52.)
I started having problems uploading the sketch. After some googling I removed the reset line from ethernet board to Arduino during upload, replaced it after upload finished, then hit the physical reset button on the Arduino. Using this procedure my sketch worked beautifully for a week. No overheating, no random crashing, and apparently full reliability.
In short, randomly after some change I made it stopped - and I've thrown literally HOURS of testing at the problem but haven't gotten to the bottom of it. The problem seems to be related to the reset process, but it's intermittent and therefore hard to pin down. I've gone to the following lengths: replaced ethernet cable, pulled apart my prototype and started from scratch, stripped the sketch back to its minimum code just for Ethernet and MQTT, tested with Arduino sketch for web server (can't get even this to work), and experimented with delays in the setup routine and even manually resetting the ethernet board by wiring it up to a tie-high resistor and switch and setting up the sketch to wait for me to reset then initialise ethernet library.
I literally can't get the thing to ping from a remote machine, let alone get MQTT working. However sometimes randomly it does ping. I have tried to figure out exactly what caused it to work when it did, but it's seemingly random.
When I plug the red board back into my old prototype stripboard on the Nano, it works like a dream.
I've read this forum a tonne and reviewed every old post relating to W5100 and issues with reset routine on the Mega, and tested lots of theories.
So I'm coming hat in hand to ask if someone can help me through by explaining exactly why the Mega was known to have reset issues with the first revisions of the ethernet shield, so I can at least have an understanding of how the resets work.
The ethernet board also works fine with my Uno - web server sketch runs fine. Plug it into the Mega and... same intermittent problems.
I haven't listed most of the things I've tried, or included the code of my sketch, so it's a very vague request at this stage, but if there is anything else someone can write here to shed some light on exactly what happens when a Mega is plugged into a W5100 as compared with an Uno, I would really be grateful.
Thanks
Mat