overflow problem or ?

Hello Arduino community,

I am beginner in the Arduino programming and I would like to ask for help (I have an Arduino TIAN).

I am currently in internship and I am in charge of debugging a number of issues. Unfortunately, it's been a while since I have a problem: my program works well but after sometimes 7 8 hours or another day 14 15 hours of operation it stops working and I do not receive datas.

So I think the problem comes from the communication betyeen Linux and microcontroller. I think it is something like overflow. I tested by using cstrings - char arrays (with /0 terminat) but it doesn't change the problem. The program is fast at the beginning then after 2 to 3 hours before stopping it becomes more and more slow with the message "timeout" (I receive datas on Laview). Do the old data remain in the memory, are archived and therefore eat the memory? Is the data stored (archived), so a purge problem?

So I will put the program here.

In the hope of having an answer in help. Thanks.

Here is the first part of my program:

#include <Ciao.h>
#include <Arduino.h>
#include <Wire.h>
#include <SPI.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>

#define SEALEVELPRESSURE_HPA (1013.25)

Adafruit_BME280 bme;

//Variablen Tian nach Labview

String TtL[48];

float baroAlti     =0; // 0, Stelle, 
float baroHumi     =0; // 1, Stelle,     
float baroPres     =0; // 2, Stelle, 
float baroTemp     =0; // 3, Stelle, 
int beepFB         =0; // 4, Stelle, 
int beltStat1      =0; // 5, Stelle, 
int beltStat2      =0; // 6, Stelle, 
int beltStat3      =0; // 7, Stelle, 
int beltStat4      =0; // 8, Stelle, 
int charIMeas      =0; // 9, Stelle, 
int charTimeEl     =0; // 10, Stelle, 
int charUfin1      =0; // 11, Stelle, 
int charUMeas      =0; // 12, Stelle, 
int charUZero1     =0; // 13, Stelle, 
int charUZero2     =0; // 14, Stelle, 
int fsMeas         =0; // 15, Stelle, 
int genReadyFB     =0; // 16, Stelle, 
int gndSwGnd       =0; // 17, Stelle, 
int gndSwUGnd      =0; // 18, Stelle, 
long heart2        =0; // 19, Stelle, 
int hs1Stat        =0; // 20, Stelle, 
int hs2Stat        =0; // 21, Stelle, 
int hs3Stat        =0; // 22, Stelle, 
int hvOnOffFB      =0; // 23, Stelle, 
int mafsMeas       =0; // 24, Stelle, 
int polFbMed       =0; // 25, Stelle, 
int polFbNeg       =0; // 26, Stelle, 
int polFbPos       =0; // 27, Stelle, 
int secCust1       =0; // 28, Stelle, 
int secCust2       =0; // 29, Stelle, 
int secEmrgSW      =0; // 30, Stelle,
int secloop        =0; // 31, Stelle,
int secLoop1       =0; // 32, Stelle,   
int secLoop2       =0; // 33, Stelle, 
int statusA1       =0; // 34, Stelle, 
int statusA2       =0; // 35, Stelle, 
int statusA3       =0; // 36, Stelle,   
int timehours      =0; // 37, Stelle, 
int timetemp       =0; // 38, Stelle, 
int trigFB         =0; // 39, Stelle, 
int trigDone       =0; // 40, Stelle, 
int voltMeasM      =0; // 41, Stelle, 
int voltMeasT      =0; // 42, Stelle, 
int msg            =0; // 43, Stelle, 
int lockwarn       =0; // 44, Stelle, 
int debug          =0; // 45, Stelle,
long timeDS        =0; // 46, Stelle, 

//Variablen Labview nach Tian

String LtT[62];

int beep           =0; // 0, Stelle, 
int beepvolt       =0; // 1, Stelle,     
int belt           =0; // 2, Stelle, 
int charIRamp1     =0; // 3, Stelle, 
int charIRamp2     =0; // 4, Stelle, 
int charISet       =0; // 5, Stelle, 
int charTime       =0; // 6, Stelle, 
int charURamp1     =0; // 7, Stelle, 
int charURamp2     =0; // 8, Stelle, 
int charUSet       =0; // 9, Stelle, 
int fs             =0; // 10, Stelle, 
int fsAuto         =0; // 11, Stelle, 
int fsHyst         =0; // 12, Stelle, 
int fsIncMax       =0; // 13, Stelle, 
int fsIncMin       =0; // 14, Stelle, 
int fsMin          =0; // 15, Stelle, 
int fsPlus         =0; // 16, Stelle, 
int fsSet          =0; // 17, Stelle, 
int gen            =0; // 18, Stelle, 
int genConf        =0; // 19, Stelle, 
int genReady       =0; // 20, Stelle, 
int heart1         =0; // 21, Stelle, 
int hvOnOff        =0; // 22, Stelle, 
int lockAct1       =0; // 23, Stelle, 
int lockAct2       =0; // 24, Stelle, 
int lockAct3       =0; // 25, Stelle, 
int lockAct4       =0; // 26, Stelle, 
int lockAct5       =0; // 27, Stelle, 
int lockAct6       =0; // 28, Stelle, 
int lockDate1      =0; // 29, Stelle, 
int lockDate2      =0; // 30, Stelle, 
int lockDate3      =0; // 31, Stelle,   
int lockDate4      =0; // 32, Stelle, 
int lockDate5      =0; // 33, Stelle, 
int lockDate6      =0; // 34, Stelle, 
int lockImp        =0; // 35, Stelle,   
int lockImpA       =0; // 36, Stelle, 
int lockTime       =0; // 37, Stelle, 
int lockTimA       =0; // 38, Stelle, 
int mafs           =0; // 39, Stelle, 
int mafsAuto       =0; // 40, Stelle, 
int mafsHyst       =0; // 41, Stelle, 
int mafsIncMax     =0; // 42, Stelle, 
int mafsIncMin     =0; // 43, Stelle, 
int mafsMin        =0; // 44, Stelle, 
int mafsPlus       =0; // 45, Stelle, 
int mafsSet        =0; // 46, Stelle, 
int mafsTime       =0; // 47, Stelle, 
int pol            =0; // 48, Stelle, 
int shunt          =0; // 49, Stelle, 
int trig           =0; // 50, Stelle, 
int trigPhaOn      =0; // 51, Stelle, 
int trigPhase      =0; // 52, Stelle, 
int voltOver       =0; // 53, Stelle, 
int voltOver1      =0; // 54, Stelle, 
int voltOverEx     =0; // 55, Stelle, 
int trigAuto       =0; // 56, Stelle, 
int timeInst       =0; // 57, Stelle, 
int trigtemp       =0; // 58, Stelle,
int timegnd        =0; // 59, Stelle,
int DcImp          =0; // 60, Stelle,

//another

int beltUGnd=0;
long previousMillis05     =0;
long previousMillis1      =0;
long previousMillis2      =0;
long previousMillis1800   =0;

void setup()
{
  Wire.begin();
  Ciao.begin();
  bme.begin();
  PinSetup();
  
  baroAlti =  bme.readAltitude(SEALEVELPRESSURE_HPA);
  baroHumi =  bme.readHumidity();
  baroPres =  bme.readPressure();
  baroTemp =  bme.readTemperature();
    
  digitalWrite(13, HIGH); 
  
}

void loop() 
{
    if (millis() - previousMillis05 > 500) 
    {
      previousMillis05 = millis(); 
    }
    
    if (millis() - previousMillis1 > 1000) 
    {
      previousMillis1 = millis(); 
      digitalWrite(13, LOW); 
    }
    
    if (millis() - previousMillis2 > 2000) 
    {
      previousMillis2 = millis();
   
      baroAlti =  bme.readAltitude(SEALEVELPRESSURE_HPA);
      baroHumi =  bme.readHumidity();
      baroPres =  bme.readPressure();
      baroTemp =  bme.readTemperature();
      digitalWrite(13, HIGH); 
      
      CiaoReadWrite();
    }
    
    if (millis() - previousMillis1800 > 10000)
    {
      previousMillis1800 = millis(); 
    }
    
    if (beep==1) digitalWrite(11, HIGH);
    if (beep==0) digitalWrite(11, LOW);
    
    
}

And finally the other part:

void CiaoReadWrite()
{
   CiaoData data = Ciao.read("restserver");
   if(!data.isEmpty())
   {
       String id = data.get(0);
       String sender = data.get(1);
       String message = data.get(2);
       //message.toUpperCase();
       
       String LtT[62];
       splitString(message,"=",LtT,62);
       
       beep         =LtT[0].toInt();
       beepvolt     =LtT[1].toInt();
       heart1       =LtT[5].toInt();
       heart2       =heart1;
       
       
       TtL[0]=String(baroAlti*100);
       TtL[1]=String(baroHumi*10);
       TtL[2]=String(baroPres);
       TtL[3]=String(baroTemp*10);
       
       TtL[5]=String(heart2);
       TtL[6]=id;
       TtL[7]=String(beepvolt);        
       
       Ciao.writeResponse("restserver",id, TtL[0]+"="+TtL[1]+"="+TtL[2]+"="+TtL[3]+"="+TtL[4]+"="+TtL[5]+"="+TtL[6]+"="+TtL[7]+"=");
    }
}

void PinSetup()
{
 // Pind als digital Output
 
 pinMode(0, OUTPUT);
 pinMode(1, OUTPUT);
 pinMode(2, OUTPUT);
 pinMode(3, OUTPUT);
 pinMode(4, OUTPUT);
 pinMode(7, OUTPUT);
 pinMode(8, OUTPUT);
 pinMode(9, OUTPUT);
 pinMode(10, OUTPUT);
 pinMode(11, OUTPUT);
 pinMode(12, OUTPUT);
 pinMode(13, OUTPUT);
 
 // Pins als digital Input
 
 pinMode(5, INPUT);
 pinMode(6, INPUT);
 
 // Pins als Analog Output
 
 //keine/ none
 
 //Pins als Analog Input

 // A00
 // A01
 // A02
 // A03
 // A04
 // A05

}

Your use of String would be the first place I'd look. Work on the cstring version you made instead.

What does compiler say about (Arduino) memory % usage ? Can you "speed up" , for testing, your mS intervals to see if the program fails sooner? Can you identify, in Arduino program , where is the "timeout" occurring?

Small memory savings could be had if you put your pin initializations into a function.

( Ignore "String" is a problem - that is standard canned "catch all" response and in this case by a person who did not read your post to boot. )