SPARK protocols

I need some of your help, I am very understand SPARK protocols, including file:
spark_protocol.h and spark_protocol.cpp.it is the http protocol to achieve it?
give me some tips or an overall framework flowchart or diagram you?

I guess you are Chinese?

:spark: core <–> Cloud(server) with SSL encryption <—> REST API for mobile/web Apps

It’s using COAP Protocol…

Files to handle communication is here: https://github.com/spark/core-communication-lib

yes you must be Chinese

Can tell me a email,Facilitate communication怂

Hi @linjinxing,

Good question, I have a post here where I talk about the core -> cloud connection, and the security protocol: https://community.spark.io/t/how-does-sparkcore-maintain-connection-to-cloud-api/2300/2?u=dave

Thanks,
David

hi @Dave @bko @FelipePlets
SPARK protocols use COAP why not use some Open Source,Why not use open source, and write their own code to achieve COAP agreement怂Such as:libcoap(http://sourceforge.net/projects/libcoap/develop)
more:http://en.wikipedia.org/wiki/Constrained_Application_Protocol

   Thanks 
   LIN

Hi @linjinxing,

CoAP is an open specification like HTTP. We do use Open Source libraries for CoAP on the server side, and we wrote our own byte-specific implementation on the Core due to the constraints of the system and so that as much space was leftover as possible. CoAP as is didn’t have an encryption layer we felt was usable / strong enough, so that’s why we added an AES layer on top of it. We hope to contribute back improvements we make along the way back if we can.

Thanks,
David

3 Likes

Do you maybe have any sketches, diagrams, any documentation about how the protocol works or how was it designed?

I’m kind of hacking home automation and want to integrate Spark Core with existing system. I need to omit the cloud as I’m going to control my bedroom lights (through both Android and capacity sensors), but the internet in my area breaks too often.

Have you considered setting up a local cloud? It can run on a raspberry pi and provide you with all the cool Cloud functions, without the need for an internet connection. Definitely take a look at it. Depending on what you’re running your H.A. on, this might even be neater to implement :slight_smile:

2 Likes

Have you had a look into the ā€œLocal Cloud Serverā€?

Or you could do direkt TCP/UDP communication with the out-if-the-box TCPServer/TCPClient and UDP objects (which may still have some childhood issues).
You might like to look into SEMI_AUTOMATIC or MANUAL mode, too.

Darn, @Moors7 has beaten me to it :wink:

2 Likes

@Moors7: Yes. Right now I’m running spark-server on Raspberry Pi, but there are dozen other things running on it and sometimes it’s a bit slow.

@ScruffR: Thanks, I’m aware of all of these and I’m using it. I like Spark Protocol in case I want to switch back or so.

Being a hacker at heart I want to hack my own solution :wink:

2 Likes

Hi @orian,

The local Spark Server and Spark protocol are there so you can hack your own solution at home. I’d recommend diving into the source code and digging around, that’s the easiest and fastest way to learn the protocols and services. :slight_smile:

Thanks,
David