After reading this thread, I learnt about the json parsing library from arduinojson.org
I am trying to use this but I seem to be encountering some resistance.
#define BLYNK_MAX_READBYTES 1024
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <ArduinoJson.h>
char auth[] = "7b98fef52cf04336a72410369668****";
char ssid[] = "**SSID**";
char pass[] = "**PSWD**";
void setup()
{
// Debug console
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
StaticJsonBuffer<1024> jsonBuffer;
Blynk.virtualWrite(V8, "http://api.openweathermap.org/data/2.5/weather?id=7290688&APPID=1f7238a8c0f08b401922637efe12****");
}
void loop()
{
Blynk.run();
}
BLYNK_WRITE(V8)
{
String json = param.asStr();
Serial.println("WebHook data:");
Serial.println(json);
JsonObject& root = jsonBuffer.parseObject(json);
int windSpeed = root["wind"][0];
Serial.println(windSpeed);
}
Every time I try and compile it, I get errors:
WebHook_GET:74:22: error: 'jsonBuffer' was not declared in this scope
JsonObject& root = jsonBuffer.parseObject(json);
^
Multiple libraries were found for "ArduinoJson.h"
Used: C:\Users\insti\Documents\Arduino\libraries\ArduinoJson
Not used: C:\Users\insti\Documents\Arduino\libraries\ArduinoJson-6.x
exit status 1
'jsonBuffer' was not declared in this scope
I feel as though there is something obvious I’m missing, after an hour of contemplating I haven’t managed to figure it out.
Thanks yet again for your incite!