Binary received uncorrectly by the board: SHA256 mismatch

I tried to upload a sketch to an opta OTA.
It worked when i tried in October, but now I get the Error-Message "Binary received uncorrectly by the board: SHA256 mismatch"

Opta prepared like in this description: Opta™ Memory Partitioning for Use with the Arduino IDE | Arduino Documentation

Can you help?

// ArduinoIoTCloud - Version: 1.11.1
#include <ArduinoIoTCloud.h>

// ArduinoHttpClient - Version: Latest 
#include <ArduinoHttpClient.h>

// Include the necessary header files and define macros
uint8_t* bootloader_data = (uint8_t*)(0x801F000);
uint8_t* bootloader_identification = (uint8_t*)(0x80002F0);

#if __has_include("opta_info.h")
  #include "opta_info.h"
  #define GET_OPTA_OTP_BOARD_INFO
  OptaBoardInfo* info;
  OptaBoardInfo* boardInfo();
#endif

/* 
  Sketch generated by the Arduino IoT Cloud Thing "Untitled 3"
  https://create.arduino.cc/cloud/things

  Arduino IoT Cloud Variables description

  The following variables are automatically generated and updated when changes are made to the Thing

  bool boolLed1;

  Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
  which are called when their values are changed from the Dashboard.
  These functions are generated with the Thing and added at the end of this sketch.
*/
// HttpClient - Version: Latest 

/*
LED_D0: STATUS 1
LED_D1: STATUS 2
LED_D2: STATUS 3
LED_D3: STATUS 4
LED_RESET: LED above the reset button
LED_USER: LED above the user button
*/

#include <b64.h>
// ArduinoRS485 - Version: Latest 
#include <ArduinoRS485.h>
// ArduinoModbus - Version: Latest 
#include <ArduinoModbus.h>
// Ethernet - Version: Latest 
#include <Ethernet.h>
#include <stdlib.h>
#include <stdio.h>
#include <SPI.h>
#include "thingProperties.h"

int i;
int intTemperature, intEnergy;// nur zum Testen
constexpr auto baudrate { 9600 };
// Calculate preDelay and postDelay in microseconds as per Modbus RTU Specification
// MODBUS over serial line specification and implementation guide V1.02
// Paragraph 2.5.1.1 MODBUS Message RTU Framing
// https://modbus.org/docs/Modbus_over_serial_line_V1_02.pdf
constexpr auto bitduration { 1.f / baudrate };
constexpr auto preDelayBR { bitduration * 9.6f * 3.5f * 1e6 };
constexpr auto postDelayBR { bitduration * 9.6f * 3.5f * 1e6 };

unsigned long longLastMillis10=0;
unsigned long longLastMillis1=0;
unsigned long longLastMillis5min=0;
unsigned long longLastMillis60min=0;

int intHttpErr=0;
int intConfigSuccess=0;
int intStatusCode=0;
int intHTTPRetry=0;

const int INT_MAX_METER = 25;
const int INT_MAX_IO = 8;

String token="XXX";
String password="XXX";
String strSerial = "H0623";

struct meter {
  int intMID;
  int intHWtype;
  String strHashCode;
  String strMeterbezeichnung;
  int intValue1;
  int intValue2;
  int intValue3;
  int intValue4;
};
meter allMeter[INT_MAX_METER];
int intCounterInProject = 0;
//meter allMeter[];

struct building {
  String strObjName;
  String strStrasseNr;
  String strPLZ;
  String strOrt;
  int intBID;
};
building thisBuilding;

struct IOChannel{
  int intChNumber;
  String strIOHash;
  int intValue;
};
IOChannel allIOChannel[INT_MAX_IO];
int intIOInProject =0;
//IOChannel allIOChannel[];

struct MeterHW{
  int intMeterType;
  int intNbModbusValuesToRead;
  int intValue1Length; // Anzahl Modbus Register
  int intValue2Length;
  int intValue3Length;
  int intValue4Length;
};

MeterHW MeterHWDef[] = {
  {0,0,0,0,0,0},  //No Hardware 
  {10,1,2,0,0,0}, //Eltako DSZ12DM
  {20,4,2,2,1,1}, //Techem C4s (4 Werte, 2 Register kWh 2 Reg. Volumen, 1 Temp VL 1 RL)
  {30,4,2,2,1,1}, //Techem Ultra S3
  {40,1,2,0,0,0}, //Techem NZR Modularis KWZ Modul
  {50,1,2,0,0,0}, //ABB B23 113-100 - muss noch getestet werden, es könnten auch 3 Modbus Register sein - schauen was das Seneca Teil dazu sagt ###############################
  {60,4,2,2,1,1}, //Salzburg AG UH50
  {70,0,0,0,0,0},  //AutoWMZ - wird hier nicht benötigt
  {80,4,2,2,1,1},  //Techem Ultra S4
  {90,1,2,0,0,0}
};

bool boolDIcurrentState[INT_MAX_IO];
bool boolDIprevState[INT_MAX_IO];


  // Enter a MAC address for your controller below.
  // Newer Ethernet shields have a MAC address printed on a sticker on the shield
  // The IP address will be dependent on your local network:
byte mac[] = {
    0xA8, 0x61, 0x0A, 0x50, 0x06, 0xA2 //little
  };
  //IPAddress ip(192, 168, 1, 200); //enter fixed IP of Opta here

EthernetClient ethClient;
EthernetClient ethClient01;
EthernetClient ethClient02;
HttpClient httpClient(ethClient,"www.sou.at");
HttpClient httpClientIO(ethClient01,"www.sou.at");
HttpClient httpClientHeartBeat(ethClient02,"www.sou.at");

void setup() {
  // Initialize serial and wait for port to open:
  Serial.begin(9600);
  // This delay gives the chance to wait for a Serial Monitor without blocking if none is found
  delay(2500); 

  Serial.println("Opta Device Information");
  uint8_t currentBootloaderVersion = bootloader_data[1];
  String currentBootloaderIdentifier = String(bootloader_identification, 15);
  if (!currentBootloaderIdentifier.equals("MCUboot Arduino")) {
    currentBootloaderIdentifier = "Arduino loader";
  }
  Serial.println("- Bootloader identifier: " + currentBootloaderIdentifier);
  Serial.println("- Magic number (validation): " + String(bootloader_data[0], HEX));
  Serial.println("- Bootloader version: " + String(bootloader_data[1]));

  #if defined(GET_OPTA_OTP_BOARD_INFO)
    printOptaSecureInfo();
  #endif

  token="";
  password="";
  strSerial="";
  for (i=0; i<6; i++){
    mac[i]= info->mac_address[i];
    token+=String(info->mac_address[i], HEX);
    password+=String(info->mac_address[i], HEX);
    strSerial+=String(info->mac_address[i], HEX);
  }
  // Defined in thingProperties.h
  initProperties();

  // Connect to Arduino IoT Cloud
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  
  /*
     The following function allows you to obtain more information
     related to the state of network and IoT Cloud connection and errors
     the higher number the more granular information you’ll get.
     The default is 0 (only errors).
     Maximum is 4
 */
  setDebugMessageLevel(2);
  ArduinoCloud.printDebugInfo();
  
  RS485.setDelays(preDelayBR, postDelayBR);
  
  if (!ModbusRTUClient.begin(9600)) {
    Serial.println("Failed to start Modbus RTU Client!");
      }
  
  while (Ethernet.begin(mac) != 1)
  {
    Serial.println("Error getting IP address via DHCP, trying again...");
    delay(15000);
  } 
  
  
  //get Config - Anzahl DI, Anzahl/Type Mbus
  intConfigSuccess = F_GetConfig();
  while (intConfigSuccess != 1){
    Serial.println("Error getting config from Hermes-Cloud, trying again...");
    delay(15000);
    intConfigSuccess = F_GetConfig();
  }

  Serial.print("Success getting Config. Zähler: ");
  for(i=0; i<25; i++){
    if (allMeter[i].intHWtype > 0) intCounterInProject +=1;
  }
  Serial.println(intCounterInProject);
  //Serial.print(sizeof(allMeter)/sizeof(allMeter[0]));
  Serial.print("IO Channel: ");
  for(i=0; i<8; i++){
    if (allIOChannel[i].intChNumber > 0) intIOInProject +=1;
  }
  Serial.println(intIOInProject);
  //Serial.println(sizeof(allIOChannel)/sizeof(allIOChannel[0]));
  
  
  // Initialize Opta LEDs
  pinMode(LED_D0, OUTPUT); //---arduino Cloud connected
  pinMode(LED_D1, OUTPUT);
  pinMode(LED_D2, OUTPUT);
  pinMode(LED_D3, OUTPUT);
  // Initialize Relays outputs
  pinMode(D0, OUTPUT);
  pinMode(D1, OUTPUT);
  pinMode(D2, OUTPUT);
  pinMode(D3, OUTPUT);
  // Initialize DI
  pinMode(A0, INPUT);
  pinMode(A1, INPUT);
  pinMode(A2, INPUT);
  pinMode(A3, INPUT);
  pinMode(A4, INPUT);
  pinMode(A5, INPUT);
  pinMode(A6, INPUT);
  pinMode(A7, INPUT);
}

void loop() {
  ArduinoCloud.update();
  
  
  
  //#############################################################################
  //######### Überwachen der Digitaleingänge ####################################
  //######### und Cloud connection           ####################################
  //#############################################################################   
  
  if ((millis()-longLastMillis10)>=5000){
      longLastMillis10=millis();
      
      if (ArduinoCloud.connected()){
        digitalWrite(LED_D0, HIGH);
      }
      else{
        digitalWrite(LED_D0, LOW);
        ArduinoCloud.begin(ArduinoIoTPreferredConnection); // Test ob dann die Verbindung wiederhergestellt wird
      }
      
      
      
      boolDIcurrentState[0] = digitalRead(A0);
      boolDIcurrentState[1] = digitalRead(A1);
      boolDIcurrentState[2] = digitalRead(A2);
      boolDIcurrentState[3] = digitalRead(A3);
      boolDIcurrentState[4] = digitalRead(A4);
      boolDIcurrentState[5] = digitalRead(A5);
      boolDIcurrentState[6] = digitalRead(A6);
      boolDIcurrentState[7] = digitalRead(A7);
      
      
      for (i=0;i<intIOInProject;i++){
        if (boolDIcurrentState[i] != boolDIprevState[i]){
          allIOChannel[i].intValue = boolDIcurrentState[i];
          
          String postData = "her_bid=" + String(thisBuilding.intBID) + "&her_iohash=" + allIOChannel[i].strIOHash + "&her_value=" + String(allIOChannel[i].intValue);
          String strPayload = "";
          intStatusCode=400;
          intHTTPRetry=0;
          
          while (((intStatusCode>299)||(intStatusCode<200)) && (intHTTPRetry<5))
          {
            httpClientIO.beginRequest();
            httpClientIO.post("/hermes/inject_io.php","application/x-www-form-urlencoded",postData);
            httpClientIO.endRequest();
  
            // Ausgabe der Serverantwort
            intStatusCode = httpClientIO.responseStatusCode();
            Serial.print("Status code: ");
            Serial.println(intStatusCode);
            
            if (intHTTPRetry>0) delay(2000);
            intHTTPRetry+=1;
          }
          strPayload = httpClientIO.responseBody();
          httpClientIO.stop();
          
          //strPayload = httpClientIO.responseBody();
          Serial.println("Server response: " + strPayload);
          
        }
      }
      
      for (i=0;i<INT_MAX_IO;i++){
        boolDIprevState[i] = boolDIcurrentState[i];
      }
      
    }
    
    
    /*
    struct IOChannel{
  int intChNumber;
  String strIOHash;
  int intValue;
};
IOChannel allIOChannel[INT_MAX_IO];
int intIOInProject =0;

*/
  //#############################################################################
  //######### Auslesen der Zählerwerte - Modbus Register alle 10s ###############
  //#############################################################################
  
  if ((millis()-longLastMillis1)>=10000){ 
      longLastMillis1=millis();
      
      F_ReadAllMeter();
      for (i=0;i<intCounterInProject;i++){
        Serial.print("Meter: " + String(i+1) + "Value1: ");
        Serial.println(allMeter[i].intValue1);
        Serial.print("Meter: " + String(i+1) + "Value2: ");
        Serial.println(allMeter[i].intValue2);
        Serial.print("Meter: " + String(i+1) + "Value3: ");
        Serial.println(allMeter[i].intValue3);
        Serial.print("Meter: " + String(i+1) + "Value4: ");
        Serial.println(allMeter[i].intValue4);
      }
    }
    
  //#############################################################################
  //######### Schicke Heartbeat alle 5 min ############# ########################
  //#############################################################################
  
  if ((millis()-longLastMillis5min)>=300000){
    longLastMillis5min=millis();
    F_Heartbeat();
  }
  
   //#############################################################################
  //######### Schicke Zählerstände an Hermes Cloud alle 60 min ###################
  //##############################################################################
  
   if ((millis()-longLastMillis60min)>=3600000){ 
    longLastMillis60min=millis();
    F_SendMeterData();
  }
  
  
  // DI Überwachen - bei Änderung push an Hermes Server
  
  
}

void F_SendMeterData(){
  
  for (i=0;i<intCounterInProject;i++){
    String postData="";
    postData = "her_mid=" + String(allMeter[i].intMID) + "&her_hash=" + allMeter[i].strHashCode 
                        + "&her_value=" + String(allMeter[i].intValue1)
                          + "&her_value_add_1=" + String(allMeter[i].intValue2)
                             + "&her_value_add_2=" + String(allMeter[i].intValue3)
                                + "&her_value_add_3=" + String(allMeter[i].intValue4);
     
  
    String strPayload = "";
    httpClient.beginRequest();
    httpClient.post("/hermes/inject.php","application/x-www-form-urlencoded",postData);
    httpClient.endRequest();
    // Ausgabe der Serverantwort
    strPayload = httpClient.responseBody();
    Serial.println("Server response: " + strPayload);
    httpClient.stop();
  }
}




void F_Heartbeat(){
  String postData = "bid=" + String(thisBuilding.intBID) + "&sernum=" + strSerial;
  String strPayload = "";
  
  httpClientHeartBeat.beginRequest();
  httpClientHeartBeat.post("/hermes/heartbeat.php","application/x-www-form-urlencoded",postData);
  httpClientHeartBeat.endRequest();
  
  // Ausgabe der Serverantwort
  strPayload = httpClientHeartBeat.responseBody();
  Serial.println("Server response: " + strPayload);
  httpClientHeartBeat.stop();
  
}

void F_ReadAllMeter(){
  for (i=0;i<intCounterInProject;i++){
    switch (allMeter[i].intHWtype){
      case 0:
        break;
      case 10:
        allMeter[i].intValue1 = F_ReadUINT32 (1,10+i*20,1); //(SlaveID,StartReg,Use HextoDec)
        break;
      case 20:
        allMeter[i].intValue1 = F_ReadUINT32 (1,10+i*20,1);
        allMeter[i].intValue2 = F_ReadUINT32 (1,12+i*20,1);
        allMeter[i].intValue3 = F_ReadUINT16 (1,14+i*20,1);
        allMeter[i].intValue4 = F_ReadUINT16 (1,16+i*20,1);
        break;
      case 30:
        allMeter[i].intValue1 = F_ReadUINT32 (1,10+i*20,1);
        allMeter[i].intValue2 = F_ReadUINT32 (1,12+i*20,1);
        allMeter[i].intValue3 = F_ReadUINT16 (1,14+i*20,1);
        allMeter[i].intValue4 = F_ReadUINT16 (1,16+i*20,1);
        break;
      case 40:
        allMeter[i].intValue1 = F_ReadUINT32 (1,10+i*20,1);
        break;
      case 50:
        allMeter[i].intValue1 = F_ReadUINT32 (1,10+i*20,1);
        break;
      case 60:
        allMeter[i].intValue1 = F_ReadUINT32 (1,10+i*20,1);
        allMeter[i].intValue2 = F_ReadUINT32 (1,12+i*20,1);
        allMeter[i].intValue3 = F_ReadUINT16 (1,14+i*20,1);
        allMeter[i].intValue4 = F_ReadUINT16 (1,16+i*20,1);
        break;
      case 70:
        break;
      case 80:
        allMeter[i].intValue1 = F_ReadUINT32 (1,10+i*20,0);
        allMeter[i].intValue2 = F_ReadUINT32 (1,12+i*20,0);
        allMeter[i].intValue3 = F_ReadUINT16 (1,14+i*20,0);
        allMeter[i].intValue4 = F_ReadUINT16 (1,16+i*20,0);
        break;
      case 90:
        allMeter[i].intValue1 = F_ReadUINT32 (1,10+i*20,1);
        break;
    }
  }
}



//--------------- Wandelt hex in dec --------------------------
byte F_Hex2Dec (byte byteIN){
  int inthelplow, inthelphigh;
  inthelplow=byteIN & 0x0F;
  inthelphigh=byteIN>>4;
  return inthelplow+inthelphigh*10;
}

//--------------- get Config Function -------------------------

int F_GetConfig(){
  
      String postData = "token=" + token + "&password=" + password;
      String strPayload = "";
      String strLine = "";
      int intPos = 0;
      int intLineType = 0;
      int intCounterCount = -1;
      int intIOCount = -1;
      
      httpClient.beginRequest();
      httpClient.post("/hermes/getconfig.php","application/x-www-form-urlencoded",postData);
      httpClient.endRequest();
      
      // Ausgabe der Serverantwort
      strPayload = httpClient.responseBody();
      Serial.println("Server response: " + strPayload);
      httpClient.stop();

      while (strPayload.indexOf('\r\n', intPos) != -1) {
        strLine = strPayload.substring(intPos, strPayload.indexOf('\r\n', intPos));
        Serial.println("Zeile erhalten: " + strLine);

        // Felder verarbeiten 
        int intFieldPos = 0;
        String strField = "";
        int intFieldCount = 0; // für die weiterverarbeitung in die struct
        
        while (intFieldPos < strLine.length()) {
          int intnextFieldPos = strLine.indexOf(';', intFieldPos);
          if (intnextFieldPos == -1) {
            intnextFieldPos = strLine.length();
          }
          strField = strLine.substring(intFieldPos, intnextFieldPos);
          Serial.println("Feld erhalten: " + strField);
          intFieldPos = intnextFieldPos + 1;
          //Wir checken welches Feld daherkommt 
          //0020 = Gebäude - 5 Nutzfelder
          //0030 = Zähler - 6 Nutzfelder
          //0040 = IO Störmeldung - 4 Nutzfelder
         
          if (strField == "0020"){
            intLineType = 20;
          }
          else if (strField == "0030"){
            intLineType = 30;
            intCounterCount += 1;
          }
          else if (strField == "0040"){
            intLineType = 40;
            intIOCount += 1;
          }
          
          switch (intLineType) {
            case 20:
              // statements
              // Gebäudedaten befüllen
              switch (intFieldCount){
                case 1:
                  thisBuilding.strObjName = strField;
                  break;
                case 2:
                  thisBuilding.strStrasseNr = strField;
                  break;
                case 3:
                  thisBuilding.strPLZ = strField;
                  break;
                case 4:
                  thisBuilding.strOrt = strField;
                  break;
                case 5:
                  thisBuilding.intBID = strField.toInt();
                  break;
              }
              intFieldCount += 1;
              break;
              
            case 30:
              
              switch (intFieldCount){
                case 1:
                  allMeter[intCounterCount].intMID = strField.toInt();
                  break;
                case 2:
                  allMeter[intCounterCount].strHashCode = strField;
                  break;
                case 3:
                  allMeter[intCounterCount].strMeterbezeichnung = strField;
                  break;
                case 5:
                  allMeter[intCounterCount].intHWtype = strField.toInt();
                  break;
                
              }
              intFieldCount += 1;
             
              break;
            case 40:
              // wie legen wir die Störmeldungen an ?? auch struct array
              switch (intFieldCount){
                case 1:
                  allIOChannel[intIOCount].intChNumber = strField.toInt();
                  break;
                case 3:
                  allIOChannel[intIOCount].strIOHash = strField;
                  break;
              }
              intFieldCount += 1;
              
              break;
              
           
          }
        }
        intPos = strPayload.indexOf('\r\n', intPos) + 1;
        
      }
  return 1;
}

    //####################################################################################################
    //########## Funktion liest einen Uint32 Wert via Modbus         ########################################
    //####################################################################################################

  unsigned int F_ReadUINT32 (int intSlaveID, int intStartReg, int intUseHextoDec){

  unsigned int i, uintReadValue;
  word wordtemp=0;
  byte bytetemp=0;
  
    //--------- read --------------
    if (!ModbusRTUClient.requestFrom(intSlaveID, HOLDING_REGISTERS, intStartReg, 2)) {
    Serial.print("failed to read registers! ");
    Serial.println(ModbusRTUClient.lastError());
    } 
    else {
        if(intUseHextoDec==1){
          wordtemp=ModbusRTUClient.read();
          bytetemp=wordtemp;
          uintReadValue=F_Hex2Dec(bytetemp)*10000;
          bytetemp=wordtemp>>8;
          uintReadValue+=F_Hex2Dec(bytetemp)*1000000;
          wordtemp=0;
          bytetemp=0;
          wordtemp=ModbusRTUClient.read();
          bytetemp=wordtemp;
          uintReadValue+=F_Hex2Dec(bytetemp);
          bytetemp=wordtemp>>8;
          uintReadValue+=F_Hex2Dec(bytetemp)*100;
        }
        else {
          wordtemp=ModbusRTUClient.read();
          bytetemp=wordtemp;
          uintReadValue=bytetemp*10000;
          bytetemp=wordtemp>>8;
          uintReadValue+=bytetemp*1000000;
          wordtemp=0;
          bytetemp=0;
          wordtemp=ModbusRTUClient.read();
          bytetemp=wordtemp;
          uintReadValue+=bytetemp;
          bytetemp=wordtemp>>8;
          uintReadValue+=bytetemp*100;
        }
    }
  return uintReadValue;
}


int F_ReadUINT16 (int intSlaveID, int intStartReg, int intUseHextoDec){
  word wordtemp=0;
  byte bytetemp=0;
  int i, intReadValue;
    if (!ModbusRTUClient.requestFrom(intSlaveID, HOLDING_REGISTERS, intStartReg, 1)) {
    Serial.print("failed to read registers! ");
    Serial.println(ModbusRTUClient.lastError());
    } 
    else {
        if(intUseHextoDec==1){
          wordtemp=ModbusRTUClient.read();
          bytetemp=wordtemp;
          intReadValue=F_Hex2Dec(bytetemp);
          bytetemp=wordtemp>>8;
          intReadValue+=F_Hex2Dec(bytetemp)*100;
          
        }
        else {
          wordtemp=ModbusRTUClient.read();
          bytetemp=wordtemp;
          intReadValue=bytetemp;
          bytetemp=wordtemp>>8;
          intReadValue+=bytetemp*100;
        }
      
    }
  return intReadValue;
}

#if defined(GET_OPTA_OTP_BOARD_INFO)

/**
  Checks if the magic number is 0xB5. If it is, prints the secure information of the device in the Serial Monitor.
  
  @params none
  @return none
*/
void printOptaSecureInfo() {
  info = boardInfo();
  if (info->magic == 0xB5) {
    Serial.println("- Secure information version: " + String(info->version));
    Serial.println("- Ethernet functionality: " + String(info->_board_functionalities.ethernet == 1 ? "Yes" : "No"));
    Serial.println("- Wi-Fi module functionality: " + String(info->_board_functionalities.wifi == 1 ? "Yes" : "No"));
    Serial.println("- RS-485 functionality: " + String(info->_board_functionalities.rs485 == 1 ? "Yes" : "No"));
    Serial.println("- QSPI memory size: " + String(info->external_flash_size) + " MB");
    Serial.println("- Secure board revision: " + String(info->revision >> 8) + "." + String(info->revision & 0xFF));
    Serial.println("- Secure VID: 0x" + String(info->vid, HEX));
    Serial.println("- Secure PID: 0x" + String(info->pid, HEX));
    Serial.println("- Ethernet MAC address: " + String(info->mac_address[0], HEX) + ":" + String(info->mac_address[1], HEX) + ":" + String(info->mac_address[2], HEX) + ":" + String(info->mac_address[3], HEX) + ":" + String(info->mac_address[4], HEX) + ":" + String(info->mac_address[5], HEX));
    if (info->_board_functionalities.wifi == 1) {
      Serial.println("- Wi-Fi MAC address: " + String(info->mac_address_2[0], HEX) + ":" + String(info->mac_address_2[1], HEX) + ":" + String(info->mac_address_2[2], HEX) + ":" + String(info->mac_address_2[3], HEX) + ":" + String(info->mac_address_2[4], HEX) + ":" + String(info->mac_address_2[5], HEX));
    }
  } else {
    Serial.println("- No secure information available!");
    printBootloaderInfo();
  }
}
#endif

/**
  Prints clock source, USB speed, Ethernet functionality, Wi-Fi functionality, RAM memory size, QSPI memory size, video output functionality, and secure element functionality.
  
  @params none
  @return none
*/
void printBootloaderInfo() {
  Serial.println("- Clock source: " + getClockSource(bootloader_data[2]));
  Serial.println("- USB Speed: " + getUSBSpeed(bootloader_data[3]));
  Serial.println("- Ethernet functionality: " + String(bootloader_data[4] == 1 ? "Yes" : "No"));
  Serial.println("- Wi-Fi functionality: " + String(bootloader_data[5] == 1 ? "Yes" : "No"));
  Serial.println("- RAM size: " + getRAMSize(bootloader_data[6]));
  Serial.println("- QSPI memory size: " + String(bootloader_data[7]) + " MB");
  Serial.println("- Video output functionality: " + String(bootloader_data[8] == 1 ? "Yes" : "No"));
  Serial.println("- Secure element functionality: " + String(bootloader_data[9] == 1 ? "Yes" : "No"));
}

/**
  Convert a flag in the bootloader data to USB speed information.
  
  @param bootloader flag (uint8_t)
  @return USB speed information as a String
*/
String getUSBSpeed(uint8_t flag) {
  switch (flag) {
    case 1:
      return "USB 2.0/Hi-Speed (480 Mbps)";
    case 2:
      return "USB 1.1/Full-Speed (12 Mbps)";
    default:
      return "N/A";
  }
}

/**
  Convert a flag in the bootloader data to clock source information.
  
  @param bootloader flag (uint8_t)
  @return clock source information as a String
*/
String getClockSource(uint8_t flag) {
  switch (flag) {
    case 0x8:
      return "External oscillator";
    case 0x4:
      return "External crystal";
    case 0x2:
      return "Internal clock";
    default:
      return "N/A";
  }
}

/**
  Convert a flag in the bootloader data to RAM size information.
  
  @param bootloader flag (uint8_t)
  @return RAM size information as a String
*/
String getRAMSize(uint8_t flag) {
  if (flag == 0) {
    return "N/A";
  }
  return (String(flag) + "MB");
}





/*
  Since BoolLed1 is READ_WRITE variable, onBoolLed1Change() is
  executed every time a new value is received from IoT Cloud.
*/
void onBoolLed1Change()  {
  // Add your code here to act upon BoolLed1 change
}


Post the error messages. I will take a SWAG and say it appears you have selected the wrong board.

I select the online OPTA - go to linked thing - and then directly to the sketch.
How should i select the wrong board?


image
image

I have deleted the device and added it again. Then uploaded the memory-partition sketch (https://docs.arduino.cc/tutorials/opta/memory-partitioning/). After that i uploaded my sketch again.
Sketch runs but shows some error at startup


OTA does still not work :frowning:

Any ideas, how to fix the cryptography certificate reconstruction failure?

I have replaced the opta by a new one - that works.
The other one is on my desk, tried to format, upload simple sketch over comport. It connects to the cloud, but ota end with : "Error received during OTA: Error code -4"