Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • You say that the 2 responses are parsed differently, but only show one method. Also the line String data = root[String("formatted")].as<String>(); doesn't look right. From the examples I think it should be String data = String(root["formatted"]); Commented Jun 30, 2017 at 10:07
  • @CodeGorilla Updated answer with the working parser. Commented Jun 30, 2017 at 11:14
  • @CodeGorilla Your suggestion ends up with: 'String(ArduinoJson::JsonObjectSubscript<const char*>)' is ambiguous Commented Jun 30, 2017 at 11:26
  • Strange - I was just looking at the examples, github.com/bblanchon/ArduinoJson/blob/master/examples/…, sorry I couldn't help. Commented Jun 30, 2017 at 11:30
  • very helpful, I'm working a similar problem. Any chance you could share your entire code? Especially more details on the section on handling the Get request timeout. unsigned long startTime = millis(); while(client.available() == 0){ if(millis() - startTime > this -> timeout){ lcd -> clearScreen(); lcd -> drawText("API request failed", 0, 0, this -> randomUint16()); delay(5000); return ""; } } Commented Sep 18, 2017 at 0:33