Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

no-ip can not update ip address #39

Open
microicRI opened this issue Mar 17, 2022 · 1 comment
Open

no-ip can not update ip address #39

microicRI opened this issue Mar 17, 2022 · 1 comment

Comments

@microicRI
Copy link

Hi there,
thanks for any help
username:password not working with noip
is there any working example for?

@JohnboyK
Copy link

JohnboyK commented May 7, 2022

If you get the code 404 permanently then pls. check following:
Do you reuse the httpclient for update of NOIP?
In this case you have to ensure the reuse(false) !! See following:

  if ( !HttpClObj.begin(HttpSubClient, "http://ifconfig.me/ip") ){   // Start with IP-URL  and check if connected
      Serial.print(F("\n###Err Connection to Ext IP-Site"));
  }  //  end if connection not successful
  httpRetCode = HttpClObj.GET();             //Send the request 
  if (httpRetCode > 0) {
      if (httpRetCode == HTTP_CODE_OK) {
          glbTmpStr_a = HttpClObj.getString();
          glbTmpStr_a.toCharArray(glbBuf_tiny1, sizeof(DDNS_IP_Old) );
      }  //  end  if (httpRetCode == HTTP_CODE_OK) 
      else {   // if unexpected return code
          Serial.printf("\n[HTTP] Ext IP GET... failed, error: %s\n", HttpClObj.errorToString(httpRetCode).c_str());        
      }
  }  //  end  if (httpRetCode > 0)
  HttpClObj.end();         // close the connection in any way

  //  ---------------------------------------------------------- 
  //  this is important:
  HttpClObj.setReuse(false); //  to avoid problems of reused - see: https://github.com/esp8266/Arduino/issues/8331 
  //  
  //  -----------------------------------------------------------

  if ( !HttpClObj.begin(HttpSubClient, glbBuf_medla) ) {        // Start with generated update-URL
    Serial.print(F("\n###Err Connection to NoIP-Update Site"));
  }  //  end if connection not successful
  
  httpRetCode = HttpClObj.GET();                // try the update 
  #if INCL_DDNS_UPD_DEBUG                // if we have to include code for DEBUG of DDNS-Updater
      Serial.print(F("\nNoIP-Upd-HTTP-Code: "));
      Serial.print (httpRetCode);
  #endif  //  end  if INCL_DDNS_UPD_DEBUG  
  if (httpRetCode == 200) {
      glbTmpStr_a = HttpClObj.getString();
      #if INCL_DDNS_UPD_DEBUG                // if we have to include code for DEBUG of DDNS-Updater
          Serial.print(F("\nNoIP-Upd-Answ length: "));
          Serial.print (glbTmpStr_a.length());
          Serial.print(F(" / Content >"));
          Serial.print (glbTmpStr_a);
          Serial.print(F("<"));
      #endif  //  end  if INCL_DDNS_UPD_DEBUG  
    
    // Replace Old IP with new one to detect further changes.
  }  //  end  if (httpRetCode == 200) 
  else {  // if NOT the expected HTTP-Code  ( see also: https://www.noip.com/de-DE/integrate/response and https://www.noip.com/de-DE/integrate/request)
      Serial.print(F("\nERR NoIP-Update unexpected HTTP-Answer-Code:"));
      Serial.print(httpRetCode);
      Serial.printf("\n[HTTP] GET... failed, error: %s\n", HttpClObj.errorToString(httpRetCode).c_str());
      glbTmpStr_a = HttpClObj.getString();
      #if INCL_DDNS_UPD_DEBUG                // if we have to include code for DEBUG of DDNS-Updater
          Serial.print(F("\nNoIP-Upd-Answ length: "));
          Serial.print (glbTmpStr_a.length());
          Serial.print(F(" / Content >"));
          Serial.print (glbTmpStr_a);
          Serial.print(F("<"));
      #endif  //  end  if INCL_DDNS_UPD_DEBUG  
  }  //  end  if NOT the expected HTTP-Code
  HttpClObj.end();     // end in any way

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants