I'have problem with sending of tcp sens data to php backend .... after random amount of time it stop sending data ... but all other process at arduino pro mini continue working ... sometime data is damaged ... (not full sting recived) backend looping each 50ms, arduino send data each 0.5-1 sec.
[arduino pro mini
UIPEthernet.h
enc28j60
powered by Linear stabilizer 5v]
void postDATA(String dp){
// Serial.println(dp);
if (client.connect("domain.com.ua",12345)) {
digitalWrite(LED_BUILTIN, HIGH);
client.println(dp);
//delay(32000UL);
conn_retry = 0;
digitalWrite(LED_BUILTIN, LOW);
client.flush();
client.stop();
} else {
//data to eprom
conn_retry++;
if(conn_retry > 10)
{
client.flush();
client.stop();
Ethernet.begin(mac);
Ethernet.maintain();
}
}
}
if((GET_TIME - ptimer) >= 1)
{
postDATA(String("action=data&type=temp
&value=" + String(t1)));
ptimer = GET_TIME;
}
I'have idea to make some array that i've prepare all data to send then send it at one cicle row by row. But i've no idea how to make that array right at arduino IDE ...
And first of all i wount to send JSON data but pro mini have not enouph resurces for it .... 96% of rom is already used buy librarys and code.