Linux/Windows V0022/1.0 ethernet problem SOLVED

Hi SurferTim,

I am experiencing the same issues with Mega 2560R2 + Ethernet Shield. I was about to give up until I saw your post. Could you help me understand what steps are exactly necessary to get this fixed? Are any of the code changes checked into githib? If not, could you share with me/us the changed libraries?

Thanks so much in advance,
Sounder030

If you are talking about just the ethenet shield fix, that is in
/arduino-0022/libraries/Ethernet/utility/w5100.h
Open that file with a text editor. At about line 253, you will see the "old code" I posted above.
Edit to the "new code" and save.

Add: That is all one line of code to the compiler. Insure the backslashes stay intact at the end of each line. The only line that does not have a backslash is after the last curly brace.

1000 thanks to SurferTim, CodingBadly and westfw. Now it works for me too.

@CodingBadly: Thanks for putting the arguments, why I didn't posted any assumed bugfix without getting any confirmation even on the bug itself. They exactly matches my reasons. Plus my assumed bugfix next day turned out to not really do it :slight_smile:

SurferTim:
I found it. It was in the w5100.h file starting at line 253 in my version. The new compiler version did not like the old way.

I had (and still have) gcc 4.3.5, and experienced the bug
(I mean the one described in http://arduino.cc/forum/index.php/topic,57972.0.html to avoid confusion). Now I only took your patch from the previous post (w5100.h) and now it works. I did not take earlier mentioned change in socket.cpp.

Even my keep-alive socket connect (for very fast sensor polling) is working now! :)))

If anyone want to see the code (arduino code for the server and java for the client side) just ask for it. I just dont want to flood the board with code nobody wants to see.

Thanks again to you guys!

Thanks surfertim for this bugfix! You're the best :wink:

This problem was not only on linux, but also on windows (using the libs in the 1.0 beta zip) It wasnt until i found out that available() always returned 1024 that i could properly google for this issue. I can confirm your fix works with the latest AVR Studio 5 (and underlying avr-gcc) on windows. I'm not using arduino's gui as i could not get it to program at all.

Thanks for that report. Maybe we can get a change implemented soon. It has been reported. Maybe if you posted a comment on the change request, it might help. Here is the change request to the Arduino team:
http://code.google.com/p/arduino/issues/detail?id=605&start=200

Add: I also changed the topic on the original post to include Windows. That should help other find this.

Done and done :slight_smile:

Is this bug fix for W5100.h still required if I am running:

  • avr-gcc 4.5.3
  • gcc 4.6.1
    and Arduino 1.0?

lemming:
Is this bug fix for W5100.h still required if I am running:

  • avr-gcc 4.5.3
  • gcc 4.6.1
    and Arduino 1.0?

Maybe not. The gcc had a bug that was causing that problem. The symptoms of this problem would be apparent. In my case, it caused client.available() to return a value larger that 1023, so it would never exit a routine like this:

while(client.available())
{
   inChar = client.read();
}

It would return the same dozen or so characters over and over forever.

Im wondering if this is the source of my problem (why I can't get my brand new Nanode working on the Ethernet libs).
I need some time to digest all the info you've posted here....

I applied the fix listed here: Google Code Archive - Long-term storage for Google Code Project Hosting.

If there are other things that need changing, please open issues for them on the Google code issue list (Google Code Archive - Long-term storage for Google Code Project Hosting.) so they don't get lost.

Thanks, David. Some here may not know who you are, but I do. Thanks for your efforts to keep this stuff together. :smiley:

I owe you a beer :smiley:

I have been going mad trying to figure out why I was getting corrupt data from my ethernet board yet I could happily ping it.. it made no sense at all - in my mind if I can get data from a ping request I can get data from any other request.

Your one liner fixed it, you absolute beauty \o/

Instructables here I come!!

gregoryfenton:
I owe you a beer :smiley:

I have been going mad trying to figure out why I was getting corrupt data from my ethernet board yet I could happily ping it.. it made no sense at all - in my mind if I can get data from a ping request I can get data from any other request.

Your one liner fixed it, you absolute beauty \o/

Instructables here I come!!

Instead of a beer, one of which I am currently enjoying, how about going here and submitting a comment that you want the code crew to fix this bug NOW!
http://code.google.com/p/arduino/issues/detail?id=605

edit: Thank you for leaving a comment on the Arduino code page! :slight_smile:
Maybe we can get this fixed.

\o/ I have just downloaded the rc1 of 1.0.1 and the patch is already in there, my app compiles and runs perfectly :smiley:

Thanks to everyone that reported the issue, and my heartfelt thanks to Tim for the patch itself.

/case closed

gregoryfenton:
\o/ I have just downloaded the rc1 of 1.0.1 and the patch is already in there, my app compiles and runs perfectly :smiley:

Thanks to everyone that reported the issue, and my heartfelt thanks to Tim for the patch itself.

/case closed

You're welcome. And thanks for the news on the v1.0.1 release with the fix. I will get off their backs for a while. :slight_smile:

Where can I download the 1.0.1 rc?

mrboni:
Where can I download the 1.0.1 rc?

Thanks, Coding Badly. Now I'm running three versions. :slight_smile:

thanks!