Connecting Arduino Uno to ThingSpeak usind NodeMcu ESP8266-12E

Hi there,
I am doing a project on underground cable fault detection.My prototype is ready, i am using an Arduino Uno as micro-controller.i need to send the data(fault locations) to an IoT platform. i have chosen ThngSpeak to upload my data.

I am able to send the data from the Arduino Uno to the WiFi module serially(checking the incoming data from the Uno on the serial monitor of the ESP8266-12E) and also i have been able to connect the WiFi module to ThingSpeak

The only problem is that only 0s are being sent to the platform even if the Arduino Uno is reading different values.Below is the code uploaded to the ESP8266-12E module. I an needing some help to figure out why the ESP8266-12E is not sending the data its reciving instead its sending only zeros

#include <ESP8266WiFi.h>



String apiKey = "GCC8OP2PI5JYIOY3";
const char* ssid = "Telecom-YCTb"; 
const char* password = "n4mcE5mV"; 

const char* server = "api.thingspeak.com";
int data1, data2, data3, data4, data5, ok;
WiFiClient client;
unsigned char buff[10], i;
String buffer1, buffer2;
void setup() {
 Serial.begin(9600);
  delay(10);
  WiFi.begin(ssid, password);
  Serial.println();
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED)
  {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("WiFi connected");

}

void loop() 
{
  if (Serial.available() > 0)
  {
    delay(100);
    while (Serial.available() > 0)
    {
      buffer1 = Serial.readString();
      if (buffer1[0] == '*')
      {
        if (buffer1[7] == '#')
        {
          Serial.println(buffer1);
          data1 = ((buffer1[1] - 0x30) * 10 + (buffer1[2] - 0x30));
          data2 = ((buffer1[3] - 0x30) * 10 + (buffer1[4] - 0x30));
          data3 = ((buffer1[5] - 0x30) * 10 + (buffer1[6] - 0x30));
        }
      }
    }

  }
  if (client.connect(server, 80))
  {
    String postStr = apiKey;
    postStr += "&field1=";
    postStr += String(data1);
    postStr += "&field2=";
    postStr += String(data2);
    postStr += "&field3=";
    postStr += String(data3);
    postStr += "\r\n\r\n\r\n";
    client.print("POST /update HTTP/1.1\n");
    client.print("Host: api.thingspeak.com\n");
    client.print("Connection: close\n");
    client.print("X-THINGSPEAKAPIKEY: " + apiKey + "\n");
    client.print("Content-Type: application/x-www-form-urlencoded\n");
    client.print("Content-Length: ");
    client.print(postStr.length());
    client.print("\n\n");
    client.print(postStr);
    Serial.println(postStr);
  }
  client.stop();
  Serial.println("Waiting...");
  delay(20000);
}

look at what you are doing here,

{
  if (Serial.available() > 0)
  {
    delay(100);
    while (Serial.available() > 0)
    {
      [code]buffer1 = Serial.readString();

if (buffer1[0] == '*')
{
if (buffer1[7] == '#')
{[/code]

Have a look at Serial Input Basics for solutions. Although i think it is actually

    while (Serial.available() > 0)
    {

that is causing your problem, depending on how often you send information. What you are doing is sending 'raw-data' with a very marginal error check, and since there is no delay after the while, if new data has arrived the second time around you are very likely to lose sync. Mainly because ofbuffer1 = Serial.readString(); where you clear the buffer regardless (and just assume that 1 complete msg has arrived. If you don't want to go through the whole Serial Input Basics, the least you can do is ping the Arduino for data to be send and then wait for it to arrive.