Page 1 of 1

JSON on LPC1347

PostPosted: Sat Feb 22, 2014 9:20 pm
by andrewdlindsay
Hi Guys,

I'm trying to do some JSON parsing of some results received by my WiFiDIPCortex but there seems to be a distinct lack of usable JSON libraries available for mbed.

I was trying picojson but that gives lots of errors:

Code: Select all
Error: No space in execution regions with .ANY selector matching vendor.o(.bss__ZNSs9__nullrefE).
Error: No space in execution regions with .ANY selector matching main.cpp.LPC1347.o(.data).
Error: Sections of aggregate size 0x7c bytes could not fit into .ANY selector(s).


However this does compile on LPC1768 mbed boards.

I tried MbedJSONValue which did compile but seems to hang within the library when trying to parse the json string.

In the meantime I'm trying some simple examples to see if I can narrow down where the problem lies.

Cheers

Andrew

Re: JSON on LPC1347

PostPosted: Sat Feb 22, 2014 10:52 pm
by Carl-SolderSplash
Hi have you tried picojson ...

http://mbed.org/users/mimil/code/picojson/

Example of it in use here : http://mbed.org/users/ansond/code/df-20 ... mostat.cpp

I'm playing with socket.io stuff at the momment so may need to look at JSON parsing soon too

EDIT : Looking at twitter I see I am a few hours late and you have tried picojson

Re: JSON on LPC1347

PostPosted: Sun Feb 23, 2014 3:16 pm
by andrewdlindsay
picojson is the one that is giving the errors. It seems to be processor specific as the errors arent thee when I try to compile for a 1768 mbed. I've not tried my freescale board yet.

I'm guessing that since the WiFiDIPCortex are fairly new there may not have been anyone trying JSON with them so this issue wouldnt have been seen. I'm basically trying to use skynet.im, or more specifically a local version of this. The responses are all JSON and are being received, its just the parsing now to get the required data.

Dog walk first then look at it again.

Cheers

Andrew

Re: JSON on LPC1347

PostPosted: Sun Feb 23, 2014 4:52 pm
by andrewdlindsay
Having some success now, but with code borrowed from http://mbed.org/users/vladounet/code/EvrythngApi/. I just created a new library with just the JsonParser.h and .cpp files, removed the debug code for now and I'm able to extract values. When I get it into a stable state and I'm sure its working I'll publish it as a separate library, after checking licenses etc on the code.

Cheers

Andrew