Webhook and OpenWeatherMap

Arduino Mega with ESP01-S

I’m trying to get the weather data from OpenWeatherMap, I have registered and have an API key. Every time I run this very simple sketch I get “Buffer Overflow” message on the Serial monitor.

I’ve now changed the sketch to the example code using the sunrise / sunset api and get the same result.

I’ve tried entering the web address in the webhook widget and calling it from the hardware and I’ve tried entering the web address in the code. You can see the 2 options in the getData routine.

I’ve tried increasing / decreasing the #define BLYNK_MAX_READBYTES 1024 but still I get this buffer overflow error.



#define BLYNK_PRINT Serial

#define BLYNK_MAX_READBYTES 1024

#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>

char auth[] = "93d1**************859";
char ssid[] = "Feixun_0F7A80";
char pass[] = "********";
#define EspSerial Serial1
#define ESP8266_BAUD 115200
ESP8266 wifi(&EspSerial);

BlynkTimer timer;

BLYNK_WRITE(V0) {
  String webhookdata = param.asStr();
  Serial.println("WebHook data:");
  Serial.print(param.asStr());
}
void setup()
{
  Serial.begin(9600);
  EspSerial.begin(ESP8266_BAUD);
  Blynk.config(wifi, auth, "blynk-cloud.com", 80);
  if (Blynk.connectWiFi(ssid, pass)) {
    Blynk.connect();
  }
  timer.setInterval(20000L, GetData);
}

void GetData()
{
  Blynk.virtualWrite(V0, 1);
  //Blynk.virtualWrite(V0, "https://api.sunrise-sunset.org/json?lat=50.4495484&lng=30.5253873&date=2016-10-01");
}

void loop()
{
  if (Blynk.connected()) {
    Blynk.run();
  }
  timer.run();
}

[0]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
/
//_, /////_
/
__/ v0.5.2 on Arduino Mega

[582] Connecting to Feixun_0F7A80
[3627] AT version:0.22.0.0(Mar 20 2015 10:04:26)
SDK version:1.0.0
compile time:Mar 20 2015 11:00:32
[4677] Failed to enable MUX
[13726] +CIFSR:STAIP,“192.168.1.111”
+CIFSR:STAMAC,“b4:e6:2d:39:14:02”
[13735] Connected to WiFi
[14553] Redirecting to 139.59.206.133:80
[15137] Ready (ping: 12ms).
[37305] Buffer overflow

I have completed 2 great air quality projects using Arduino/ESP-01S and Blynk but this very simple thing has got me stumped. I’m sure it must be just a simple mistake or omission.