HTTP server (REST & JSON) on Spark core

This project implement a Http server on Sparkcore itself. Once compiled into the Web IDE, the server will be available at http://IP-SPARKCORE (port 80 by default)
My Github : HTTP server (REST & JSON) on Spark core

Google+ Community


I managed to flash first time using web IDE. But I am not able to Flash it again. Only on commenting out the ws.loop(); IDE is able to flash the core.

What’s your Spark firmware ?
In IDE [Setting]
My FW is version 0.21

It is 0.2.1. What I have noticed is – If I am making use of Spark Tinker functions, like digitialread etc, I am not able to flash the Core from IDE. I either need to comment out Spark tinker functions or ws.opp(); in order to flash the core from IDE.

What is ws.opp() function ? ws.loop() ?
What error is displayed in debug build (the bottom of the IDE)?

Sorry it was a typo… ws.loop();

There was one error with my code. It is getting flashed now.

1 Like

Captain… Attempting to test your application but getting compile errors… hard for me, possibly easy for you to solve.

\core-firmware\build/…/inc/HttpResponse.h:50: undefined reference to HttpResponse::DEFAULT_CONTENT_TYPE' obj/src/application.o: In functionWebServer::loop()’:

and similar for
undefined reference to HttpRequest::HttpRequest()' undefined reference toHttpRequest:: parse(char)'
undefined reference to `HttpRequest::URL() const’
and so on…

Please advise if you can.

I am using NetBeans as a local compiler rather than the cloud. I am off to compile on the cloud hoping to find the solution there.

Thank you very much

Hye @LZHenry ,
Sorry for my english, I am a french.
I dont know compile the project without the Web IDE. I do not know Netbeans.
Sorry !

Captain… I am from the US and wish I could speak/write other languages!!!

Transferred your code to the cloud and was able to load into the CORE. Now I need to understand how to use the browser to display the WEB page.

  1. I assume that with NetBeans compiler I am not properly picking up a typedef for one of your variables; the cloud is properly recognizing the structures. I need to search and learn.

Thank you for sharing the project.

Hello Sir, I tried to flash the code using web IDE. it flashed properly, but i m not able to open the webpage while i am connected to the same network to which core is connected. In the video, you have used… I tried to access using this url but it was not working. How can I know or get the IP address of the server implemented in the core, printed on the screen? How to use “serial.print”? Please help.

Hi @Prashut

you must use a network scanner to identify the Spark core IP address of your subnet.

@prashuk, here is a topic on different ways to get your Core’s IP address:

thanks peekay !! :slight_smile:
I used
Serial.print(" Local IP: ");

to get my IP.

Is there any way to connect my spark core with proxy server or to set the proxy to connect my core with wi-fi ??

I get everything to validate and upload, but when I go to the ip address in the browser, the website looks nothing like the examples in the video. Instead, I get a static line of text saying:


or at analogue:


What am I doing wrong?

Actually I changed the GUI to optimize memory.

You can use Old1-spark-Web-Tinker.ino in Github file for old GUI.

Ah oke, than this isn’t what I’m looking for. I want a constant stream of analog input values on a website. Looking into TCPserver and UDP now.

That’s constant stream, but with http client query.
Don’t try to refresh because core down.