post - String object in arduino becomes empty -


i using arduino develop small iot project. till working fine. steps of projects are:

  1. create xml string sensor reading
  2. send xml post server.

the odd thing first 3 trials work perfectly. however, after that, string holding xml becomes empty.

below portion of code:

void loop() {    while (serial3.available()>0)   {     char c = serial3.read();     if (gps.encode(c)){       createxml();           delay(1000);       if(seconds_passed==10000 && !isxmlempty)       {         xml+="\n</start>";         serial.print(xml);          serial.print(f("send server"));                 seconds_passed=0;         isxmlempty=true;         string temp ="";         temp = "xml="+xml;         char *param = new char[temp.length()+1];         temp.tochararray(param,temp.length());         serial.println(param);          if(!postpage(servername,serverport,pushpage,"xml=123")) serial.print(f("fail "));         else serial.print(f("pass "));          xml="";         xml="<start>\n\t";       }      }    }      // if(data==false){ serial.println("no data"); } } 

i thing problem string object. might memory issue. idea?


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

mapreduce - Resource manager does not transit to active state from standby -

serialization - Convert Any type in scala to Array[Byte] and back -