Making a mesh of cores

So I’m working this year on making a energy monitoring system using a raspberry pi communicating over wifi with a number of cores over several buildings. The cores will record the temperature of the room and if the room isn’t at a adequate temperature they will turn the heating system on to heat the room to the necessary temperature. My question is: Is it possible to make the cores communicate between each other and if so how? I currently have 2 here and a Pi coming tomorrow and I’m attempting to make them talk to each other but I see no code code to do this. I want to avoid using the cloud to make it more compatible with none-spark devices in the future.
Thanks for any help.

Nope, at least not the way I think you mean.

You need to provide WiFi infrastructure to allow the cores to communicate.

If you provide that, then you can write code to have the cores talk to each other and/or the RPi over the WiFI.

They do not do mesh networking like ZigBee.

1 Like

As @AndyW said, the SparkCore do not form a mesh. They can however talk to eachother however the easiest method is to use publish() and subscribe() which both rely on the cloud. There are other methods but they are more complicated. Would publish and subscribe work for you?

If so, here’s a direct link to the docs on the subject: http://docs.spark.io/api/

Are you saying it’s impossible to mesh them like ZigBee or 6LoWPAN then? We have a WiFi infrastructure on site that we can use but it would probably need to be improved. If a WiFi infrastructure was there could I then have them communicating without using the cloud?
Thanks a lot for the help

Ideally I’m trying not to use the cloud but that method looks very easy so I will push for that. What other more complicated methods are there? Do any of them not involve the cloud?
Thanks for your help

I’m not sure if you’ve considered the local cloud? It can be run on a Raspberry Pi, and provides the most flexibility. It should be a lot faster, and you can also run your own code, since it’s open source. It therefor should be future-proof for any non-Spark devices.
If you’d like Core-to-Core-to-other-hardware, you could take a look at the nRF24L01+. They’re really cheap radio transceivers that work with Spark Cores, Arduinos, Raspberries, and a lot of other hardware. Using those, you could in fact create a mesh, although it would be more complicated than connecting a Spark to the Cloud and using its awesome features.

So you’re saying I could make my own cloud using the Pi as a server and still use all the functionality that spark has with the cloud?

I’m focusing around the wifi element rather than radio now as my predecessor in this project already explored low powered radio with very little success.

Thanks alot

Yeah, you can download the “Local Cloud” from Spark, and run it on your own Raspberry (search the forum for “local cloud”). There are quite a few people already doing so. Not only does it give you complete control, but it’s also a lot faster. It’ll also allow you to edit the rate limits for publishing for example. I do believe there is no current implementation of Spark.subscribe on the Local Cloud, but I’m pretty sure that’ll be worked on. Perhaps @kennethlimcp knows more about this(?)

Yeah some features are not available in the local :cloud: but suffice for more cases.

As the others have suggested I think your best bet would be to setup a load “cloud” using a server of some kind and use that but, just as a matter of completeness, you could, although it would be much more complicated, have the cores themselves both host servers (http://docs.spark.io/firmware/#communication-tcpserver) and also connect to other core’s servers which would allow the cores to talk to each other bypassing the cloud. They would still need wifi to transmit the data but would not be reliant on any central server (apart from perhaps a central router routing the packets).