Ethernet. Sending DATA - upload complete - next Connection failed.

Hi;
I trying to send data to Weather Underground. I minimized sketch to see if connection and download works.
Unfortunately, something is wrong, because always the first attempt is OK, but second attempt to send data is not. See attachment.
Can you help me - what I'm doing wrong?

int DEBUG = 1;   

#include <Ethernet.h>  
byte mac[] = { 
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};  
  
IPAddress ip(192,168,0,150);
IPAddress gateway(192,168,0,1); 
IPAddress subnet(255, 255, 255, 0);
EthernetClient client;

unsigned int localPort = 8888;

char SERVER[] = "rtupdate.wunderground.com";           // Realtime update server - RapidFire
//char SERVER [] = "weatherstation.wunderground.com";  // Standard server
char WEBPAGE [] = "GET /weatherstation/updateweatherstation.php?";
char ID [] = "XXXXXX";
char PASSWORD [] = "XXXXX";



unsigned int timeout = 30000;          

void setup(void){

  Serial.begin(38400);
 // Wire.begin();    
  Serial.print(F("\nInitializing..."));
  if (Ethernet.begin(mac) ) {
    Serial.println("Initialization complete");
   } 
  else {
    Serial.println("Something went wrong during ethernet startup!");
    } 

} 

void loop(void){  

float tempf = 72.0;

                    
  if (DEBUG) {   

  Serial.println("+++++++++++++++++++++++++");

 Serial.print("temp= ");
 Serial.println(tempf);
 
  }
  
 delay(2500);


//Send data to Weather Underground
 if (client.connect(SERVER, 80)) { 
    if (DEBUG) {    
      Serial.println("Sending DATA ");
      }

    client.print(WEBPAGE); 
    client.print("ID=");
    client.print(ID);
    client.print("&PASSWORD=");
    client.print(PASSWORD);
    client.print("&dateutc=");
    client.print("now");    //can use instead of RTC if sending in real time

    client.print(tempf);
    if (DEBUG) {   
      Serial.println("Upload complete");
      }
 }      
    else {
      if (DEBUG) { Serial.println(F("Connection failed")); }
      return;
      }
    
    delay(2500); 
}

Connection failed.png

You are trying to use the same client to connect again, without closing the previous connection.

Pieter

Thx PeterP. I'll try to modify my sketch.