Wish JsonParser.h Library

Discussion in 'B4R Bugs & Wishlist' started by Peter Simpson, Mar 19, 2017.

  1. Peter Simpson

    Peter Simpson Well-Known Member Licensed User

    The title say it all really, I'm looking for the JsonParser.h file, or to be more specific THIS ONE.

    I'm still working on learning C++ in what little spare time I have.

    Cheers...
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Parsing json on Arduino can be complicated due to the limited memory available and the lack of garbage collection.

    This is not a simple library to use. You need to handle all the events as this is a streaming parser.
    It might be simpler to parse the string with ByteConverter. This is for example how WebSocketClient parses the server responses.
    What are you trying to parse?
     
    Peter Simpson likes this.
  3. Peter Simpson

    Peter Simpson Well-Known Member Licensed User

    I'm looking at a project to parse a weather Json file and also to do some data logging for my home.

    Well I'm using a 'SonOff' smart switch (just to experiment with). Memory wise well you are correct especially for the device that I'm using. So I've already replaced/upgraded the flash memory for a Winbond 25Q32FVSIG (about £0.35 each), but I'm going to replace it again doubling the size of even the replacement chip. I've also flashed the device Firmware with ESPEasy R120, thus I now have full control over The 'SonOff' device. I could have just used an ESP8266 with a 3.3v relay shield but I wanted to use this particular device just for the fun of it. I use the 'SonOff' for a test smart sprinkler (irrigation system).

    So after doing all that I then decided to look for a Json Parser and that's when I became stuck :(

    BTW you can also use the Winbond 25Q32FVSIG on an ESP-01, maybe I should create a tutorial on doing that.

    So basically I'm parsing an online file and data logging for my house.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Post a json example and I can help you parse it.

    Don't use json unless you must. Use B4RSerializator for communication with other B4X platforms.
     
  5. Peter Simpson

    Peter Simpson Well-Known Member Licensed User

    Other B4X platforms, hmm that would mean using either a Raspberry Pi or a spare Android device which both defeats the original object.

    Okay I'll look into your answer of using the B4RSerializator.

    Thank you Erel...
     
Loading...