Which Library would you advise to use to get the fields hour, minute and second into variables in my sketch?
I managed to communicate with my ESP8266 using AT commands. Also calling the web service worked. But how to automatically do this? Do I have to manually parse the result string (strip the HTTP headers ("Host", "Content-Type", "Content-Length", ...) and parse the JSON)? Or is there a library for that?
If you don't want to write it yourself (says a lot about people when they avoid learning/doing things on their own, just saying...) then you need to learn how to look under the right rocks. A quick look at the web location where Arduino code developers keep their libraries ( GITHUB) shows more than one JSON library attempt. I make no recommendation about how good any of the results are, but I have provided a link to the most popular JSON library for Arduino so far.
This is also a topic that has been discussed in this forum... you would have found conversations about it
...and for the record, the advice from PaulS was spot on.
The problem with a general JSON parser is that there is just no way to do it without malloc()ing some memory.
Actually - I tell a lie. It could be done with a stream reader approach. You give the library some callbacks that get invoked at start object/end object and get given the parse stack. A good old LRLA(1) parser.
PaulMurrayCbr:
Actually - I tell a lie. It could be done with a stream reader approach. You give the library some callbacks that get invoked at start object/end object and get given the parse stack. A good old LRLA(1) parser.