Help . . . I need memory

hi ,

i tell the situation

i have a iboard (328+) that i use to play bridge between wireless nrf24l01 devices and a SQL server and a UDP server.
The iboard is pretty because everything is at one.

but if i upload my sketch on the iboard the program doens't run it's halt on the sql connection.
If i place the sketch on a Mega board it runs fine.

here a show you the sketch , i now its a little bit messy , but its my first great script

#include <digitalWriteFast.h>
#include <iBoardRF24Network.h>
#include <iBoardRF24.h>
#include <SPI.h>
#include "Ethernet.h"
#include "sha1.h"
#include "mysql.h"
#include <EthernetUdp.h>
char user[] = "root";
char password[] = "wortel";
char INSERT_SQL[50];
char REMOTEDATA[20];
char type ;

// BASE1
byte mac_addr[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFD, 0xAA };
IPAddress ip(192, 168, 111, 171);
const uint16_t this_node = 01;
//-------------------------------------
IPAddress server_addr(192, 168, 111, 150);
IPAddress remote(192, 168, 111, 105);
unsigned int remoteport = 8888;
void UDPDATA(int ploegnr, int code, int teller, int tellerplus);
Connector my_conn;
EthernetUDP Udp;
iBoardRF24 radio(3,8,5,6,7,2);
//iBoardRF24 radio(30,31,32,33,34,35);
iBoardRF24Network network(radio);
const unsigned long interval = 100; 
unsigned long last_sent;
unsigned long packets_sent;
struct boodschap_t
{
  unsigned int code;
  unsigned int ploeg;
};

struct control_t
{
  unsigned int ploegnr;
  unsigned int rondecontrol;
  unsigned int opstartcontrol;
};

int ploegdata [5][6] =
{
    // BASE1
  // {ploeg , code , node , teller, tellerstop , tellerplus}
  
  {
    1,555,011,0,0,0    }
  ,
  {
    2,555,2,0,0,0    }
  ,
  {
    3,555,3,0,0,0   }
  ,
  {
    4,555,4,0,0,0   }
  ,
  {
    5,555,5,0,0,0   }
};

void setup(void)
{
  Serial.begin(57600);
  Serial.println("Base gestart");
  SPI.begin();
  Ethernet.begin(mac_addr);
  Udp.begin(remoteport);
  radio.begin();
  network.begin(/*channel*/ 90, /*node address*/ this_node);
  bool dok = radio.setDataRate(RF24_2MBPS);
   

  if (my_conn.mysql_connect(server_addr, 3306, user, password))
  {
    Serial.print("connect ");
  }
  else
  {
    Serial.print("fout ");
  }


}
void loop(void)
{
  
  network.update();
  unsigned long now = millis();
  if ( now - last_sent >= interval  )
  {
    last_sent = now;
    for (int i = 0 ; i < 5 ; i++)
    {
      int ploeg = 0;
      int code = 555;
      ploeg = ploegdata[i][0];
      int other_node = ploegdata[i][2];
      if (ploegdata[i][3] < 5)
      {
        ploegdata[i][1]= 555;
        type ='I';
        ploegdata[i][5]++;
      }
      else

          if (ploegdata[i][3] == 5)
        {
          ploegdata[i][1]= 666;
          type ='C';
         sprintf(INSERT_SQL, "INSERT INTO score.Ronde VALUES (NULL, %d, NULL)", ploegdata[i][0]);
                my_conn.cmd_query(INSERT_SQL);
          ploegdata[i][5] = 0;
          ploegdata[i][4] = 0;
        }

        else
          if (ploegdata[i][3] > 5)
          {
            ploegdata[i][1]= 111;
            ploegdata[i][5] = 0;
            ploegdata[i][4] = 0;
            type ='O' ;
          }

      boodschap_t boodschap = {code ,ploeg};
      RF24NetworkHeader header(other_node, type);
      bool ok = network.write(header,&boodschap,sizeof(boodschap));
      if (ok)
      {
        UDPDATA(ploegdata[i][0],ploegdata[i][1],ploegdata[i][5]);
        ploegdata[i][3]++;
        ploegdata[i][4] = 0 ;

      }
      else
      {

        if (ploegdata[i][4] == 0)
        {
          ploegdata[i][1] = 777;
          ploegdata[i][5] = 0;
          UDPDATA(ploegdata[i][0],ploegdata[i][1],ploegdata[i][5]);
          ploegdata[i][4] = 1;


        }
        ploegdata[i][3]=0;
        ploegdata[i][5] = 0;
        code = 777;
      }
      delay(100);
      network.update();

      while ( network.available() )
      {
        RF24NetworkHeader haader;
        control_t control;
        network.read(haader,&control,sizeof(control));

        
        sprintf(INSERT_SQL, "INSERT INTO score.control VALUES (NULL, %d, %d, NULL)", control.rondecontrol,control.opstartcontrol);
                my_conn.cmd_query(INSERT_SQL);
      }




    }

  }

}

void UDPDATA(int ploegnr, int code, int tellerplus)
{

  sprintf(REMOTEDATA, "%d#%d#%d", ploegnr,code,tellerplus);
  Udp.beginPacket(remote, remoteport);
  Udp.write(REMOTEDATA);
  Udp.endPacket();

}

if i comment the sprintf lines , everything works fine except the writing to the servers of course.

with the sprintf lines uncomment i have only 300bytes free

what can i do to make more running memory

Help o Help

1,555,011,0,0,0

Not part of your problem, but the sudden use of octal?

Have you thought of using the F() macro for your constant prints?
That could save a fair amount of RAM

the adressing of the RF24network is in octal

you have a base 01 and the childs are 011 , 021 , 031

will try the F macro

I have also comment al the serial.print lines in the mysql.cpp file

now it works without problems.

will try to also clear more to get more memory ,but i don't have a lot of constant strings

only the

INSERT_SQL, "INSERT INTO score.Ronde VALUES (NULL,

is a constant sting

but i don't have a lot of constant strings

Really?

Google "sprintf_P"