Pages: 1 [2] 3   Go Down
Author Topic: Linux/Windows V0022/1.0 ethernet problem SOLVED  (Read 11108 times)
0 Members and 1 Guest are viewing this topic.
SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 107
Posts: 6383
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

so it WAS  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46779  (or related)??  Wow!
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 116
Posts: 5400
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

so it WAS  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46779  (or related)??  Wow!

I don't know. I did not need to get that deep. As soon as I determined how that code worked, it was easy to troubleshoot. First try did it.
I presumed by the write function above that, it also does the &0xFF with the low byte to insure a clear high byte. If you look at that new code, the read function is pretty much a reverse of the write function.

Edit: The closer I look at that, the more it looks like a case of partial uninitialized variable. A 16 bit variable was assigned an address, but never fully initialized (assigned a value). The read returns only a byte. So the high byte (edit: after the second read in the old code) would still be uninitialized after a read.
« Last Edit: August 26, 2011, 01:05:06 pm by SurferTim » Logged

Germany
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 116
Posts: 5400
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

« Last Edit: August 30, 2011, 11:54:57 am by SurferTim » Logged

Munich, Germany
Offline Offline
Jr. Member
**
Karma: 0
Posts: 65
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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 :-)

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! smiley))

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!


Logged

A mouse is a device to point at the xterm you want to type in.

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks surfertim for this bugfix! You're the best  smiley-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.
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 116
Posts: 5400
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: October 11, 2011, 01:19:19 pm by SurferTim » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Done and done  smiley
Logged

Australia
Offline Offline
Sr. Member
****
Karma: 10
Posts: 397
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 116
Posts: 5400
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
Code:
while(client.available())
{
   inChar = client.read();
}
It would return the same dozen or so characters over and over forever.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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....

http://arduino.cc/forum/index.php/topic,84160.msg630427.html#msg630427
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 9
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I applied the fix listed here: http://code.google.com/p/arduino/issues/detail?id=605

If there are other things that need changing, please open issues for them on the Google code issue list (http://code.google.com/p/arduino/issues/list) so they don't get lost.
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 116
Posts: 5400
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I owe you a beer smiley-grin

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!!
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 116
Posts: 5400
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I owe you a beer smiley-grin

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!  smiley
Maybe we can get this fixed.
« Last Edit: March 11, 2012, 07:24:54 am by SurferTim » Logged

Pages: 1 [2] 3   Go Up
Jump to: