Arduino UNO, ESP8266-01 and openweathermap.org for weather monitoring

i am new to this forum please let me if something goes wrong.
I am trying to make a weather station using Arduino UNO, ESP8266-01 and openweathermap.org API. While using in the browser i am getting long data. Now i want display in my serial terminal. i am attaching my code please help. This code written to know what are the data present in the receiver.
Some variables or header files that i am not using but still in the code.

#include <SoftwareSerial.h>
#include <ArduinoJson.h>
// LED
int ledPin = 13;
char inChar[400];
String answer, stempk, cod;
int incod, tempk, tempc, postemp, hot, cold;
#define DEBUG true
// replace with your channel's thingspeak API key
String apiKey = "cd065caeed3dbb55dbe482c87a987441";
String site = "api.openweathermap.org"; //Create a string named site
// connect 10 to TX of Serial USB
// connect 11 to RX of serial USB
SoftwareSerial ser(9,8); // RX, TX
StaticJsonBuffer<200> jsonBuffer;
String Time();
// this runs once
void setup() {
pinMode(A0,INPUT);
pinMode(A1,INPUT);
digitalWrite(A0,HIGH);
digitalWrite(A1,HIGH);
// initialize the digital pin as an output.
pinMode(ledPin, OUTPUT);
// enable debug serial
Serial.begin(115200);
// enable software serial
ser.begin(115200);
// reset ESP8266 WiFi connection AT+CIPMUX=1 AT+CWJAP="EngineersGarage","egP@$$w0rd?"
ser.println("AT");
delay(100);
ser.println("AT+GMR");
delay(100);
ser.println("AT+CWMODE=3");
delay(100);
ser.println("AT+RST");
delay(500);
ser.println("AT+CIPMUX=1");
delay(100);
String cmd="AT+CWJAP="EngineersGarage","egP@$$w0rd?"";
ser.println(cmd);
delay(100);
ser.println("AT+CIFSR");
delay(100);
Serial.println("EnginbeersGarage Weather Station");
Serial.println("System Ready.....");
}

void loop(void) {
// blink LED on board
digitalWrite(ledPin, HIGH);
delay(200);
digitalWrite(ledPin, LOW);
delay(200);
if(digitalRead(A0)==LOW){
Serial.println("Fetching Data...");
Time();
}
}

// prepare GET string GET api.openweathermap.org/data/2.5/weather?q=Bhubaneswar,in&appid=cd065caeed3dbb55dbe482c87a987441\r\n\r\n
String Time()
{

char inv = '"';
String add = "AT+CIPSTART";
add += "=";
add += inv;
add += "TCP";
add += inv;
add += ",";
add += inv;
add += "api.openweathermap.org"; // Host_server_name
add += inv;
add += ",";
add += "80";
add += "\r\n";
sendData(add, 3000, 0); // Establishing a TCP Connection. ( AT+CIPSTART = "TCP","Host_server_name",80 )
Serial.println(add);
String rest = "AT+CIPSEND=90";
rest += "\r\n";
sendData(rest, 2000, 0); //Number of characters to send. ( "AT+CIPSEND=90" )
String hostt = "GET /data/2.5/weather?q=Jaipur,in&units=metric&appid=cd065caeed3dbb55dbe482c87a98744 HTTP/1.0\r\nHost: api.openweathermap.org";
//hostt += "Host: api.openweathermap.org\r\n\r\n";
// hostt += "\r\n";
// hostt += "Host:api.openweathermap.org";
hostt += "\r\n\r\n\r\n\r\n\r\n";
String Time = sendData(hostt, 2000, 1); // GET request ( GET /apps/thinghttp/send_request?api_key=XXXXXXXXXXXXXXXX
// Host: Host_server_name )

return (Time);
}

String sendData(String command, const int Goldout, boolean debug)
{
String response = "";

ser.print(command); // send the read character to the Serial1

long int Gold = millis();

while ( (Gold + Goldout) > millis())
{
while (ser.available())
{

// The esp has data so display its output to the serial window
char c = ser.read(); // read the next character.
response += c;
}

}

if (debug)
{
//Serial.print(response);
response.toCharArray(inChar, 400);
for(int j=0;j<400;j++){
//if(inChar[j] == '+' && inChar[j+3] == 'D'){
Serial.print(j);
Serial.println(inChar[j]);
// }
}
}

return response;
}

Please help :frowning: :frowning: :confused:

What is the problem?

ser.begin(115200);

In my experience software serial will run no faster than 38400 baud, reliably. You will need to change the baud rate in the sketch and the ESP as well.

I found that using the AT firmware and an Arduino to control the ESP cumbersome and inflexible. I suggest that you look into programming the ESP stand alone using the Arduino IDE and the Arduino ESP8266 core. Check out this guide. The core files include many example sketches to help you get it going.

Please read the "how to use the forum" stickies to see how to format and post code. Also the "Read this before posting a programming question" sticky at the top of this topic.

Thank You for a quick reply frnd, but when i am trying to send or receive data from thingspeak.com i am able to do that. But when i am trying the same for the openweathermap.org i am not able to do that with the same set of code. So, i think baudrate might be not the problem. some syntax issue :confused: :confused: :confused: :frowning:

am not able to do that with the same set of code.

Well, of course not.

But, we have no idea what the code you posted improperly actually does.