Pages: 1 2 [3]   Go Down
Author Topic: Ethernet cleint println() makes new packet every time  (Read 2680 times)
0 Members and 1 Guest are viewing this topic.
Wellington, New Zealand
Offline Offline
Sr. Member
Karma: 1
Posts: 404
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think you should have success if you keep exploring the option to avoid the "while (readSnCR(s));" statement.

I found the RTR and RCR registers in the wiznet w5100 datasheet.  You can download a copy from here (sparkfun) or from the wiznet website.

Offline Offline
Karma: 0
Posts: 42
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


In the w5100.h there are two methods:

void W5100Class::setRetransmissionTime(uint16_t _timeout) {

void W5100Class::setRetransmissionCount(uint8_t _retry) {

They are not used anywhere in the Ethernet library, so these get some default values. If you want to change these settings, just modify the begin() function in Ethernet.cpp to:

void EthernetClass::begin(uint8_t *mac, uint8_t *ip, uint8_t *gateway, uint8_t *subnet)
 // Add the following two lines:
  W5100.setRetransmissionTime(50); // in milliseconds, 50 is a good value
  W5100.setRetransmissionCount(1); // tries just once

Now my Arduino freezes just for 50 millis every 12 seconds, which is acceptable.

Thank you, dhunt for pointing me in the right direction!
« Last Edit: August 03, 2011, 07:50:09 am by mishoboss » Logged

Seattle, WA USA
Online Online
Brattain Member
Karma: 653
Posts: 50888
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It would be nice to see this added to the official version of the library, with default arguments for the begin method, so that a user could override the default values if desired.

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