I'm Pretty new the Arduino scene and I'm using a Wemos d1 Pro Mini and I'm trying to parse a JSON URL(Just printing the whole string to serial for now) but its way to big and my board just resets.
JSON:https://poloniex.com/public?command=returnTicker
I know the code works because I can get this https://poloniex.com/public?command=returnOrderBook¤cyPair=BTC_NXT&depth=50
While doing a google search I found GitHub - squix78/json-streaming-parser: Arduino library for parsing potentially huge json streams on devices with scarce memory but I do not understand how to get it to work.
Essentially what I want it to do is pull
"BTC_BURST":{"id":15,"last":"0.00000675","lowestAsk":"0.00000675","highestBid":"0.00000674","percentChange":"0.10655737","baseVolume":"2452.31027933","quoteVolume":"372519946.72358555","isFrozen":"0","high24hr":"0.00000755","low24hr":"0.00000550"}
From https://poloniex.com/public?command=returnTicker
Any help would be appreciated.
Here is my code so far, it uses the ESP8266 Wifi manager.
#include <ESP8266HTTPClient.h>
#include <ESP8266WiFi.h>
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
#include <ArduinoJson.h>
#define LCD_ROWS 2
#define LCD_COLS 16
LiquidCrystal_I2C lcd(0x3F, LCD_COLS, LCD_ROWS);
WiFiManager wifiManager;
char apname[] = "ssid";
//char appass[] = "pass";
void configModeCallback (WiFiManager *myWiFiManager) {
lcd.home();
lcd.clear();
lcd.print("Now Entering");
lcd.setCursor(0, 1);
lcd.print("Setup Mode");
delay(2000);
lcd.home();
lcd.clear();
lcd.print("Pls Conn To AP");
lcd.setCursor(0, 1);
lcd.print(apname);
}
void setup() {
Serial.begin(115200);
Serial.println();
lcd.begin(4,5);
lcd.backlight();
startup();
thankyou();
lcd.home();
lcd.clear();
lcd.print("Connecting");
lcd.setCursor(0, 1);
lcd.print("To Local WiFi");
wifiManager.setTimeout(180);
wifiManager.setAPCallback(configModeCallback);
wifiManager.autoConnect(apname); //pass would go here
lcd.clear();
lcd.print("Connected!");
delay(2000);
}
void resetesp(){
wifiManager.resetSettings();
}
void startup(){
lcd.clear();
lcd.home();
lcd.print("Ticker Test");
lcd.setCursor(0, 1);
lcd.print("By Draknoid");
delay(2000);
}
void thankyou(){
lcd.clear();
lcd.home();
lcd.print("Thank You!");
lcd.setCursor(0, 1);
lcd.print("Your Name Here");
delay(2000);
}
void loop() {
if (WiFi.status() == WL_CONNECTED) { //Check WiFi connection status
HTTPClient http; //Declare an object of class HTTPClient
http.begin("https://poloniex.com/public?command=returnTicker","83:7D:87:4B:80:8B:B9:26:33:C0:5A:DC:30:18:58:D9:69:14:D1:4F"); //Specify request destination
int httpCode = http.GET();//Send the request
if (httpCode > 0) { //Check the returning code
String payload = http.getString(); //Get the request response payload
Serial.println(payload); //Print the response payload
}
http.end(); //Close connection
}
delay(50000); //Send a request every 30 seconds
}