user20241: I want to upload/pubish RAW IR Code to MQTT server received through my ESP8266. I have received the following RAW IR code from the Television using the IR receiver sensor: 
RAW IR CODE = {
  4650,4250, 700,1550, 650,1550, 700,1550, 650,450,
  650,500, 600,500, 600,500, 600,550, 550,1700, 550,
  1650, 600,1650, 550,550, 600,500, 600,550, 550,550, 
  600,500, 600,550, 550,1650, 600,550, 550,550, 600,500, 
  600,550, 550,550, 600,500, 600,1650, 600,500, 600,1650, 
  550,1700, 550,1650, 600,1650, 550,1650, 600,1650, 600
}

I want to create a new variable with the following structure: 
value = RAW IR CODE+";" + "ESP8266-01"(This is the ID of the esp8266) 


value =  {
  4650,4250, 700,1550, 650,1550, 700,1550, 650,450, 650,500, 
  600,500, 600,500, 600,550, 550,1700, 550,1650, 600,1650, 550,550,
  600,500, 600,550, 550,550, 600,500, 600,550, 550,1650, 600,550, 
  550,550, 600,500, 600,550, 550,550, 600,500, 600,1650, 600,500, 
  600,1650, 550,1700, 550,1650, 600,1650, 550,1650, 600,1650, 
  600
}; ESP8266-01

I am unsure: which data type do I need to save the variable value so that it can later be retrieved/subscribed and sent to another IR sender using irsend.sendRaw, because I want to split the variable "value" into 2 parts after receiving it, the ID and the RAW code. After getting the RAW code, I want to use the irsend.sendRaw(RAW CODE, length of RAW , 38).
Could someone help me?
My attempts:
At first I tried to save it as a string, so that it can be retrieved and separated for irsend.sendRaw. However I am unable to compile it. 
This is the code which I used to upload: 
      /*
     * IRremoteESP8266: IRServer - MQTT IR server
     * An IR LED must be connected to ESP8266 RX port (GPIO-3)
     * An IR receiver to GPIO 0
     * used library:
     * https://github.com/markszabo/IRremoteESP8266
     */    
    #include <WiFiClient.h>

   #include <ESP8266WiFi.h>

 #include <IRremoteESP8266.h>
    #include <PubSubClient.h>
    int RECV_PIN = 0; //an IR detector/demodulator is connected to GPIO pin 0

    IRrecv irrecv(RECV_PIN);
    decode_results results;

    const char* ssid = "MY-SSID";
    const char* password = "MY-WIFI-PSK";

    const char* topicRaportPrefix = "esp8266/02/info/";
    const char* topicSubscribe = "esp8266/02/sender/#";
    const char* topicPrefix = "esp8266/02/";

    const char* mqtt_server = "10.10.10.10";
    const char* mqtt_user = "mqtt_user";
    const char* mqtt_pass = "mqtt_pass";

    String clientName; // MQTT client name
    char message_buff[100];


     void dump(decode_results *results) {
        const int count = results->rawlen;
          Serial.println(c);
          c++;
          Serial.println("For IR Remote ");
          for (int i = 1; i < count; i++) {

          if ((i % 2) == 1) {
            Serial.print("+");
            Serial.print(results->rawbuf[i]*USECPERTICK, DEC);
        uint16_t  raw_ir_code[count] = results->rawbuf[i]*USECPERTICK;
            client.publish( "esp8266/02/sender", raw_ir_code);

After doing the changes proposed, I still get an error in compiling: 

no matching function for call to 'PubSubClient::publish(const char [18], uint16_t [(int)count])'


user13432: First create a topic and include the ESP8266 ID. Do not make it part of the published value. 
Second publish the raw data as-is, uint16_t raw_ir_code[RAW_IR_CODE_MAX]. The alternative is to convert to string (characters). But if the subscriber has the same architecture (interpretation of data), there is no need to convert it to string and back. Simply publish the raw data as it is. 
You will need to cast the raw_ir_code vector to the appropriate type for the MQTT publish call. 
Cheers!

20241: <p>I want to upload/pubish RAW IR Code to MQTT server received through my ESP8266. I have received the following RAW IR code from the Television using the IR receiver sensor: </p>

<pre><code>RAW IR CODE = {
  4650,4250, 700,1550, 650,1550, 700,1550, 650,450,
  650,500, 600,500, 600,500, 600,550, 550,1700, 550,
  1650, 600,1650, 550,550, 600,500, 600,550, 550,550, 
  600,500, 600,550, 550,1650, 600,550, 550,550, 600,500, 
  600,550, 550,550, 600,500, 600,1650, 600,500, 600,1650, 
  550,1700, 550,1650, 600,1650, 550,1650, 600,1650, 600
}
</code></pre>

<p>I want to create a new variable with the following structure: </p>

<pre><code>value = RAW IR CODE+";" + "ESP8266-01"(This is the ID of the esp8266) 


value =  {
  4650,4250, 700,1550, 650,1550, 700,1550, 650,450, 650,500, 
  600,500, 600,500, 600,550, 550,1700, 550,1650, 600,1650, 550,550,
  600,500, 600,550, 550,550, 600,500, 600,550, 550,1650, 600,550, 
  550,550, 600,500, 600,550, 550,550, 600,500, 600,1650, 600,500, 
  600,1650, 550,1700, 550,1650, 600,1650, 550,1650, 600,1650, 
  600
}; ESP8266-01
</code></pre>

<p>I am unsure: which data type do I need to save the variable value so that it can later be retrieved/subscribed and sent to another IR sender using <code>irsend.sendRaw</code>, because I want to split the variable "value" into 2 parts after receiving it, the ID and the RAW code. After getting the RAW code, I want to use the <code>irsend.sendRaw</code>(RAW CODE, length of RAW , 38).</p>

<p>Could someone help me?</p>

<p>My attempts:<br>
At first I tried to save it as a string, so that it can be retrieved and separated for <code>irsend.sendRaw</code>. However I am unable to compile it. </p>

<p>This is the code which I used to upload: </p>

<pre><code>      /*
     * IRremoteESP8266: IRServer - MQTT IR server
     * An IR LED must be connected to ESP8266 RX port (GPIO-3)
     * An IR receiver to GPIO 0
     * used library:
     * https://github.com/markszabo/IRremoteESP8266
     */    
    #include &lt;WiFiClient.h&gt;

   #include &lt;ESP8266WiFi.h&gt;

 #include &lt;IRremoteESP8266.h&gt;
    #include &lt;PubSubClient.h&gt;
    int RECV_PIN = 0; //an IR detector/demodulator is connected to GPIO pin 0

    IRrecv irrecv(RECV_PIN);
    decode_results results;

    const char* ssid = "MY-SSID";
    const char* password = "MY-WIFI-PSK";

    const char* topicRaportPrefix = "esp8266/02/info/";
    const char* topicSubscribe = "esp8266/02/sender/#";
    const char* topicPrefix = "esp8266/02/";

    const char* mqtt_server = "10.10.10.10";
    const char* mqtt_user = "mqtt_user";
    const char* mqtt_pass = "mqtt_pass";

    String clientName; // MQTT client name
    char message_buff[100];


     void dump(decode_results *results) {
        const int count = results-&gt;rawlen;
          Serial.println(c);
          c++;
          Serial.println("For IR Remote ");
          for (int i = 1; i &lt; count; i++) {

          if ((i % 2) == 1) {
            Serial.print("+");
            Serial.print(results-&gt;rawbuf[i]*USECPERTICK, DEC);
        uint16_t  raw_ir_code[count] = results-&gt;rawbuf[i]*USECPERTICK;
            client.publish( "esp8266/02/sender", raw_ir_code);
</code></pre>

<p>After doing the changes proposed, I still get an error in compiling: </p>

<blockquote>
  <p>no matching function for call to 'PubSubClient::publish(const char [18], uint16_t [(int)count])'</p>
</blockquote>
 13432: <p>First create a topic and include the ESP8266 ID. Do <strong>not</strong> make it part of the published value. </p>

<p>Second publish the raw data as-is, <code>uint16_t raw_ir_code[RAW_IR_CODE_MAX]</code>. The alternative is to convert to string (characters). But if the subscriber has the same architecture (interpretation of data), there is no need to convert it to string and back. Simply publish the raw data as it is. </p>

<p>You will need to cast the <code>raw_ir_code</code> vector to the appropriate type for the MQTT publish call. </p>

<p>Cheers!</p>
