A Couple Questions for Nano & ESP8266 to Uno & Ethernet Shield Value Sharing

Hi Guys. I have modified a Ethernet web server and a ESP8266 sketch to successfully transfer DHT22 values over from the Nano to the Uno. The problem is the values in the Uno are char and I am struggling to convert them to a float so I can base calculations on them. Before that I need to look at the data that comes in a determine which sensor it is coming from. Right now I am sending something like "ShadywoodN1Temp=22.0" or "ShadywoodN1RelH=45.0". ShadywoodN1 being the "node" or sensor. I was looking at the startsWith function to determine which node and if its a temp or humidity. But would this would require the char to be converted to a string then to a float value? Does anyone have any idea how I could do this?

The other issue I have encountered is that it sends the value pretty reliably most of the time but then will occasionally get hung up. I believe the bug is in the Nano code as there are time gaps when I am sending the data to Thingspeak, which this code is based off of . Below is and example of how the values get hung up as seen by the Uno serial monitor. Below that is the code being used.

Thanks for any help.

new client
AT+RST
AT+CIPSTART="TCPShadywoodN1RelH=47.8

client disconnected
new client
AT+RST
AT+CIPSTART="TCPShadywoodN1RelH=47.8

client disconnected
new client
ShadywoodN1Temp=19.5

client disconnected
new client
ShadywoodN1RelH=47.8

client disconnected
new client
ShadywoodN1Temp=19.5

client disconnected
new client
ShadywoodN1RelH=47.9

client disconnected
new client
ShadywoodN1Temp=19.5

client disconnected
new client
ShadywoodN1RelH=48.0

client disconnected
new client
ShadywoodN1Temp=19.5

client disconnected
new client
ShadywoodN1RelH=48.0

client disconnected
new client
AT+RST
AT+CIPSTART="TCPShadywoodN1RelH=48.1

client disconnected
new client
ShadywoodN1Temp=19.4

client disconnected

Uno Webserver

#include <SPI.h>
#include <Ethernet.h>

// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = { 0xD4, 0x28, 0xB2, 0xFF, 0xA0, 0xA1 };
IPAddress ip(192, 168, 0, 143);

// Initialize the Ethernet server library
// with the IP address and port you want to use
// (port 80 is default for HTTP):
EthernetServer server(80);

void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }


  // start the Ethernet connection and the server:
  Ethernet.begin(mac, ip);;
  server.begin();
  Serial.print("server is at ");
  Serial.println(Ethernet.localIP());
}

char ReadVal;

void loop() {
  // listen for incoming clients
  EthernetClient client = server.available();
  if (client) {
    Serial.println("new client");
    // an http request ends with a blank line
    boolean currentLineIsBlank = true;
    while (client.connected()) {
      if (client.available()) {
        //char c = client.read();
        ReadVal = client.read();
        Serial.write(ReadVal);
        // if you've gotten to the end of the line (received a newline
        // character) and the line is blank, the http request has ended,
        // so you can send a reply
        if (ReadVal == '\n' && currentLineIsBlank) {
          client.println("Connection: close");  // the connection will be closed after completion of the response
          break;
        }
        if (ReadVal == '\n') {
          // you're starting a new line
          currentLineIsBlank = true;
        } else if (ReadVal != '\r') {
          // you've gotten a character on the current line
          currentLineIsBlank = false;
        }
      }
    }
    // give the web browser time to receive the data
    delay(1);
    // close the connection:
    client.stop();
    Serial.println("client disconnected");
    Ethernet.maintain();
  }
}

Nano & ESP8266

#include <DHT.h>
#include <SoftwareSerial.h> 
#include <ESP8266wifi.h>


//ESP8266 Pins
#define sw_serial_rx_pin 10 //  Connect this pin to TX on the esp8266
#define sw_serial_tx_pin 11 //  Connect this pin to RX on the esp8266
#define esp8266_reset_pin 5 // Connect this pin to CH_PD on the esp8266, not reset. (let reset be unconnected)

//DHT Info
#define DHTPIN 2  
#define DHTTYPE DHT22 
DHT dht(DHTPIN, DHTTYPE); 

//Software Serial to ESPWIFI
SoftwareSerial swSerial(sw_serial_rx_pin, sw_serial_tx_pin);
ESP8266wifi wifi(swSerial, swSerial, esp8266_reset_pin, Serial);
//Webserver and Values
#define IP "192.168.0.143" // Uno Ip
String GET = "ShadywoodN1"; // Node #
String field1="Temp=";
String field2="RelH=";
String field3="3=";
String field4="4=";


float h_=0.0,hi_=0.0,t_=0.0,p_=0.0;

void setup() {

  swSerial.begin(115200);
  Serial.begin(9600);
  while (!Serial)
    ;
  Serial.println("Starting wifi");
  wifi.setTransportToTCP();// this is also default
  wifi.endSendWithNewline(true); // Will end all transmissions with a newline and carrage return ie println.. default is true
  wifi.begin();
  wifi.connectToAP("Name", "pword");
      
  Serial.begin(9600); 
  swSerial.println("AT+RST"); // this resets the ESP8266.
  Serial.println("AT+RST"); 

 
  delay(2000);

  swSerial.println("AT");
  Serial.println("AT");
  
  delay(5000);
  if(swSerial.find("OK")){
      Serial.println("OK");  
  
      Serial.println("Connected");
  }    
}

void loop() {
  delay(20000); //Delay before reading DHT
  char buffer[16];
  Serial.println("in the main loop");
  float h = dht.readHumidity();
  float t = dht.readTemperature();

if (isnan(h) || isnan(t)) {
    Serial.println("Failed to read from DHT sensor!");
return;
  }
 
  
  Serial.print("Humidity: "); 
  Serial.print(h);
  Serial.print(" %\t");
  Serial.print("Temperature: "); 
  Serial.print(t);
  Serial.println(" *F\t");

  
  String tempF=dtostrf(t,4,1,buffer);
  Serial.println(tempF);
   delay(2000);
  update(tempF,field1,"f_");
  t_=t;

  
  delay(2000);
  String humidity=dtostrf(h,4,1,buffer);
  Serial.println(humidity);
    update(humidity,field2,"h_");
    h_=h;

  delay(1000);
  Serial.println("loop-de-loop");  
}

void update(String value, String field, String previous_value_var){

  Serial.println("in the update loop"); 
  swSerial.println("AT+RST"); //ESP restart
  Serial.println("AT+RST");
  delay(3000); //restart delay
  String cmd = "AT+CIPSTART=\"TCP\",\""; //https://github.com/espressif/esp8266_at/wiki 
  cmd += IP; // += is concatenating the previous cmd string with the content of IP
  cmd += "\",80"; // same thing here it just keep adding stuff to the cmd string content

  swSerial.println(cmd);
  Serial.println(cmd);
  delay(10000); //Delay after starting TCP connection
  
  if(swSerial.find("Error")){
    Serial.println("AT+CIPSTART Error");
    return;
  }
  cmd = GET;
  cmd += field;
  cmd += value;
  cmd += "\r\n\r\n"; // it seems that this part is important, to input enough \r\n, mine does not work if I only have one pair.
  swSerial.print("AT+CIPSEND="); 
  swSerial.println(cmd.length());
  Serial.print("AT+CIPSEND=");
  Serial.println(cmd.length());
  delay(5000);
  if(swSerial.find(">")){ // if ESP8266 return the > prompt back from the CIPSEND command, you are set, if not something is wrong
    swSerial.print(cmd); //type in the GET command string and done
    Serial.print(">");
    Serial.println(cmd);
    previous_value_var=value;    
  }
  else
  {
   Serial.println("AT+CIPCLOSE"); //this command somehow does not work and always return errors so I just comment it out
   Serial.println("AT+CIPSEND error");
  }

}

You mean a string, not a char. atof() converts a character string to float.