Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit eaf6e58

Browse files
committed
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.
1 parent ec13b31 commit eaf6e58

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/FirebaseStream_ESP8266/FirebaseStream_ESP8266.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void setup() {
4444
Serial.println();
4545
Serial.print("connected: ");
4646
Serial.println(WiFi.localIP());
47-
stream = fbase.stream("/bitcoin");
47+
stream = fbase.stream("/bitcoin/last");
4848
}
4949

5050

@@ -65,7 +65,7 @@ void loop() {
6565
Serial.println(event);
6666
JsonObject& json = buf.parseObject((char*)event.c_str());
6767
String path = json["path"];
68-
float data = json["data"]["last"];
68+
float data = json["data"];
6969

7070
// TODO(proppy): parse JSON object.
7171
display.clearDisplay();

0 commit comments

Comments
 (0)