manually parse json

Hi, I have to send a structure of datas (200 bytes more or less) in Json format but I have read in this forum that there is a limit of 32 bytes to send information using I2C. I am trying to create a manual json strucuture but I have problems to create a dinamic array. Please, Can you help me to create "cadena_temperatura" :

char ID_SEN[]="101"; char H_DISPOSITIVO[]="ARDUINO NANO V3.0/NRF24L01+"; char H_SEN[]="DHT11 Sensor de Temperatura y Humedad"; char DESCTEMP[]="Temperatura"; char ACCESSTEMP[]="R"; float temperatura = 0; int PERIOD=60; char UNITSTEMP[]="ºC"; char codigo [2]; char cadena_temperatura[255];

cadena_temperatura="{"SENSOR_ID":"ID_SEN","H_DEV":"H_DISPOSITIVO","H_SENSOR":"H_SEN","DESCRIPTION":"DESCTEMP","ACCESS":"ACCESSTEMP","VALOR":temperatura,"MIN01":tmin,"MAX01":tmax,"PERIODO":PERIOD,"UNITS":"UNITSTEMP"}";

Where tmax, tmin and temperatura are float, and they are the dates of a ensor DHT11

Do you think there is a other manner to parse a structure json?.

The error is
'const char [196]' to 'char [255]'

Thanks for your help

code tags have [ ] on this forum,

I'll try to recreate the error

You cannot assign to arrays, only initialise them.

If you want to initialise the array you could do this:

char cadena_temperatura[255] = { "{\"SENSOR_ID\":\"ID_SEN\",\"H_DEV\":\"H_DISPOSITIVO\",\"H_SENSOR\":\"H_SEN\",\"DESCRIPTION\":\"DESCTEMP\",\"ACCESS\":\"ACCESSTEMP\",\"VALOR\":temperatura,\"MIN01\":tmin,\"MAX01\":tmax,\"PERIODO\":PERIOD,\"UNITS\":\"UNITSTEMP\"}" };

In this code, ID_SEN, H_DISPOSITIVO and H_SEN aren't variables, they are just text in the string. More of a task ahead if you want the arrays contents in their place.

Some code to get started building up a JSON string

It does not handle variables or whatever

void setup() 
{
  Serial.begin(115200);
  Serial.println("Start ");

  strcpy(cadena_temperatura,"");
  strcat(cadena_temperatura, "{\"");
  strcat(cadena_temperatura, "\"SENSOR_ID\":\"ID_SEN\",");
  strcat(cadena_temperatura, "\"H_DEV\":\"H_DISPOSITIVO\",");
  strcat(cadena_temperatura, "\"H_SENSOR\":\"H_SEN\",");
  strcat(cadena_temperatura, "\"DESCRIPTION\":\"DESCTEMP\",");
  strcat(cadena_temperatura, "\"ACCESS\":\"ACCESSTEMP\",");
  strcat(cadena_temperatura, "\"VALOR\":temperatura,");
  strcat(cadena_temperatura, "\"MIN01\":tmin,");
  strcat(cadena_temperatura, "\"MAX01\":tmax,");
  strcat(cadena_temperatura, "\"PERIODO\":PERIOD,");
  strcat(cadena_temperatura, "\"UNITS\":");
  strcat(cadena_temperatura, "\"UNITSTEMP\"");
  strcat(cadena_temperatura, "}");

  Serial.println(cadena_temperatura);
}

void loop() 
{
}

Based on my simple XMLwriter class it should be easy to create a JSON writer class.

Thanks for your answers. If I would like to insert in the structure variables, How can I Do it?