Go Down

Topic: Ethernet cleint println() makes new packet every time (Read 4705 times) previous topic - next topic


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.


Aug 03, 2011, 02:48 pm Last Edit: Aug 03, 2011, 02:50 pm by mishoboss Reason: 1

In the w5100.h there are two methods:

Code: [Select]
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:

Code: [Select]
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!


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.
The art of getting good answers lies in asking good questions.

Go Up