NOOB question about Spark server

I’ve used the electric imp on a project. I want to switch to spark for 2 reasons. 1) no squirrel, 2) I think spark will let you build you own server. Am I correct in #2, that I can build a local server and not depend on Spark’s servers? If I can, how do I do it?

1 Like

@ronm, you are correct in that Spark will be releasing their cloud server software some time this summer. :smile:

There are 2 answers to your #2 question. :wink:

  1. There will be a local cloud option available this summer (in the Northern hemisphere), probably late summer rather than early summer.
  2. You can manually disable the cloud connection in your code and then build your own local server running anything you like – web, telnet, whatever you’re comfortable implementing.
2 Likes

Thanks for the replies. Where are the docs for disabling the cloud and accessing via a local server?

To disable the cloud, check out Spark.disconnect() and Spark.connect(). It actually disables the cloud connection after it has connected since user code does not execute until after the cloud connection has been executed. There is another way to set a #define or include a file to disable it, but I am not familiar with it off the top of my head.

Until the local cloud is released, the only way to access via a local server is to use TCPClient and/or TCPServer. It’s also possible to use UDP if that’s what fits your project. Any of those three will allow you to do just about anything you want across the network, but it’s 100% on you to implement your own protocol or use an existing one such as HTTP, telnet, etc.

You can include this line to disable WLAN (and also obviously CLOUD)
#include "spark_disable_wlan.h"

Or you can just disable just the CLOUD but still have WiFi active.
#include "spark_disable_cloud.h"

It’s best to do this with a local build environment so you don’t have to factory reset to get your Core back talking to the Cloud so you can reprogram Over The Air (OTA).

3 Likes

@BDub et al, here is a trick I used with the Message Torch at the Maker Fair since wifi was so unreliable but I still wanted to run the demo:

:smile:

5 Likes

Hey guys,
I have mavericks talking to the spark via telnet! Thanks for the great work on these libraries. I followed you’re examples and everything just worked. Next will be getting raspberian talking to the spark. Telnet will be fine for what I need.
Thanks again,
Ron

2 Likes

Good stuff! Keep us posted on how things go. It’s always cool to see what projects people come up with. I’m still a noob in many ways, but I can sometimes make the old hats like @peekay123 (he’s still young at :heart:) scratch their heads. :wink: