title: How t send Strings with Arduino nRF24L01 module - decode / encode strings
body: <p>I use 2 sensor modules (DHT11 and TSL2561) with an Arduino Nano and want to send the meassured values via nRF24L01 Module to another nRF24L01 Module. I checked the other Topics but nothing worked so far.</p>
  
  <p>Thats the Transmitter Code:</p>
  
  <pre><code>void loop() {
  
    String stringAll, stringTemp1, stringTemp2, stringHum1, stringHum2, stringLux1, stringLux2;    
  
    byte temperature = 0;
    byte humidity = 0;
    byte data[40] = {0};
    if (dht11.read(pinDHT11, &amp;temperature, &amp;humidity, data)) {
      Serial.print("Read DHT11 failed");
      return;
    }
  
    stringAll += (int)temperature;
    stringAll +=  ", ";           
    stringAll += (int)humidity;
    stringAll += ", ";              
  
    sensors_event_t event;
    tsl.getEvent(&amp;event);
  
    if (event.light) {
      stringAll += event.light;
      stringAll += " lux";
    }
  
    radio.write(&amp;stringAll, sizeof(stringAll));
    // Serial.println(stringAll);
  
    delay(1100);                                          
  }
  </code></pre>
  
  <p>Thats the format (example) of the string if I test with "Serial.println(stringAll)": 
  25, 36, 123.00 lux</p>
  
  <p>Thats the Receiver Code:</p>
  
  <pre><code>void loop() {
    //Serial.println("omfg");
    if (radio.available()) {
  
      // char stringAll[1000] = "";
      String stringAll;
  
      len = radio.getDynamicPayloadSize();
      radio.read( &amp;stringAll, len );
      Serial.println(stringAll);
  
    }
  }
  </code></pre>
  
  <p>In this case nothing appears in the serial monitor of the Receiver. If I use " char stringAll[1000] = ""; " instead of " String stringAll; " just two squares appear in each line of the Serial monitor.</p>
  
  <p>I have no clue how to solve this problem and would be grateful if someone could help me.</p>