1

am stuck with something simple which is concating string not sure what am doing wrong , am getting exception (3 ) error due to it

3   LoadStoreErrorCause Processor internal physical address or data error during load or store

my code

    String HOST = "useotools.com";
    String API_URL = "/iot/api.php";   // API URL
    uint16_t HTTPS_PORT = 4000;  // HTTPS port
    uint16_t HTTP_PORT = 4001;  // HTTP port


void https_request_function(){
String HOST_URL = "http://"+String(HOST)+":"+String(HTTP_PORT)+String(API_URL)+"";

}

when first time https_request_function() is called then HOST_URL is displayed correctly and on 2nd time when this function is called by code it trigger exception(3) which is strange .

6
  • see CStringBuilderExample in my StreamLib (it is in Library Manager)
    – Juraj
    Oct 3, 2019 at 13:09
  • 1
    related: stackoverflow.com/q/308695/3984613 (as this is not entirely specific to Arduino)
    – Ghanima
    Oct 3, 2019 at 13:32
  • @Ghanima thanks i tired like this but still on 2nd call it print weird boxes snprintf(HOST_URL, sizeof HOST_URL, "%s%s%s%d%s", "http://",HOST.c_str(),":",HTTP_PORT,API_URL.c_str());
    – user889030
    Oct 3, 2019 at 14:01
  • @Juraj that string builder lib not exists in esp boards :(
    – user889030
    Oct 3, 2019 at 14:02
  • 1
    platformio.org/lib/search?query=streamlib
    – Juraj
    Oct 3, 2019 at 15:47

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.