Greetings all! This is my first question/post, and my question is about the Ethernet Shields using the Wiznet chip.
Long story short, I used the example code from the Ethernet Library, and after that didn’t work I changed the IP address accordingly after connecting to my Router to resolve this, and modified the code to simplify the information spit out, rather than using the FOR loop to read all 6 analog input pins.
Things work sort of, but I started experiencing problems, that of occasional random garbage after connecting to the device. Not entirely random garbage, just aperiodic random garbage comingled with normal output data. The data would be read flawlessly for several iterations, then suddenly garbage, or the device would stop responding.
I changed the source example to just spit out millis() readings and an iterator showing how many times the Browser had queried the device, and changed the line of code that tells the browser to query every 5 seconds, to querying every 30 seconds. That was all fine and good, as by the Browser the page contents now showed when exactly, as well as which iteration. It ran fine for more than an hour, but being adventurous I changed the latency back to 5 seconds from “my client.println(”<meta http-equiv=“refresh” content=“30”>");"
This information (chronological information and iterative information that I modified the source code to spit out) later became important when I was to cut & paste aperiodic random spew (that appeared in the browser) from the shield. That which was spewed occasionally, was the comingled results of the information to be currently broadcast, as well as what appeared to be the partial (reverse-chronological) contents of the buffer of the Wiznet chip. Not linear, just randomly sized chunks of previous buffer contents, including content which was no longer relevant having uploaded new code after resetting the Arduino (but not resetting the Wiznet). I figured out that I should hard-reset the Wiznet device (my rev of the board doesn’t do that).
Still I had the problem; unpredictable outputs from the device, regardless of latency. Occasionally, the sensible outputs from the device would be interrupted by burps and farts of information that was present since the last hardware reset. Not things that the Arduino was sending. To me the result appears like interrupt recursion, where two devices are trying to stream stuff at the same time.
The initial workaround that I used, was to change the “refresh” latency to 30 seconds, rather than 5. But I’m not going to let it run for DAYS to figure out if that (ultimately) solved my problem. The example code causes the Browser to refresh every 5 seconds, and should work without issue notwithstanding.
This problem to me is mysterious. I’ve ruled out the infrastructure, and the power supply and such. I get regular message broadcasts, occasionally mixed with (what appears to be) random (5100) buffer garbage after making the changes to the source code.
Given that this problem is aperiodic, and is it consistent (the information spewed varies in quantity if not content), and having looked at the physical hardware, I can only suspect that this problem is firmware related should that be the case, or there is something lacking in the Software examples (the libraries) which does not address this problem; but the problem is likely related to the Wiznet chip.
Maybe this is as simple as purging the buffer of the Wiznet chip somehow visa vis the Ethernet library? Again if that was important, it should have been part of the (library) example, so I apologize for lack of due-diligence in finding a solution before posting the question in the first place. My questions (3) being, what is causing this aperiodic garbage output despite periodic non-random output? Should there be a Library upgrade to address this problem if it is not entirely unique? And given the spurious nature of this problem which I think is (5100) buffer related, is there a simple workaround to alleviate this?
Perhaps a single line of CODE would remedy the situation, but I think that if this WAS a known issue, the library examples dating back more than 5 years would have had just this.
Has anyone else experienced this exact problem in particular? That not of it not working, but just not working predictably.
I’d appreciate any ideas as to how to solve this problem; replacing the physical hardware doesn’t to me seem like the obvious solution given that it does in fact work most of the time. I’m not convinced that this is a Hardware problem, I’m more inclined to think its a software or firmware problem.
Thanks for reading, and if anyone has any ideas about this, I’d like to hear them.