From eaf6e5852ef10352abc60fb7ed05c4f4c6b2831f Mon Sep 17 00:00:00 2001 From: Ed Coyne Date: Mon, 21 Mar 2016 20:39:02 -0700 Subject: [PATCH] Fix streaming parsing So my previous fix only fixed the first result in the stream. All of the others are of a different format. However if we ask for the /last value directly all results look the same. Didn't see this before because the job updating the bitcoin database was down and it wasn't seeing any updates but that is fixed now. --- examples/FirebaseStream_ESP8266/FirebaseStream_ESP8266.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/FirebaseStream_ESP8266/FirebaseStream_ESP8266.ino b/examples/FirebaseStream_ESP8266/FirebaseStream_ESP8266.ino index f3fe2b54..14aded26 100644 --- a/examples/FirebaseStream_ESP8266/FirebaseStream_ESP8266.ino +++ b/examples/FirebaseStream_ESP8266/FirebaseStream_ESP8266.ino @@ -44,7 +44,7 @@ void setup() { Serial.println(); Serial.print("connected: "); Serial.println(WiFi.localIP()); - stream = fbase.stream("/bitcoin"); + stream = fbase.stream("/bitcoin/last"); } @@ -65,7 +65,7 @@ void loop() { Serial.println(event); JsonObject& json = buf.parseObject((char*)event.c_str()); String path = json["path"]; - float data = json["data"]["last"]; + float data = json["data"]; // TODO(proppy): parse JSON object. display.clearDisplay();