Offline WiFi Communication

My project requires that the core can communicate to an iPhone app and other cores offline. I was hoping to achieve this through WiFi communication through an offline LAN, but I’m not sure how to set that up. I was wondering if anyone has any ideas on what this system will look like and can point me in the right direction, I imagine it would require a router that all devices connect through. I think the cores would all act as TCP servers/clients. The firmware Spark.publish() and Spark.subscribe() is exactly the sort of communication I need between cores, however it needs to be done offline. The iPhone needs to be able to set preference settings to the cores, I imagine this can be done through TCP connection.

Any thoughts on how I should proceed and pointers into the right direction would be appreciated. Is something like this even possible with the spark core?

Hi @gguo,

Great question! That’s easy enough to do using the manual mode here:

http://docs.spark.io/firmware/#advanced-system-modes-manual-mode

Just have your core startup in manual mode, and have it connect to WiFi and not the Spark Cloud. From there you can use something like UDP messages ( http://docs.spark.io/firmware/#communication-udp ) to broadcast out to other cores on the local network, something like “Hey! My IP address is a.b.c.d”, and then have the cores communicate directly with TCPClient / TCPServer, or just using UDP.

I hope that helps!

Thanks,
David

2 Likes