Setting up a P2P network for Particle devices
Out of the box, Particle boards run the stock firmware which integrates with the Particle cloud; thus, Particle devices are in the client-server mode when you buy them. It is not possible to set up a P2P network with the stock firmware shipped with Particle boards, and hence we need to flash a custom firmware onto the device, that supports the P2P protocol. VoodooSpark (https://github.com/voodootikigod/voodoospark) is a customized firmware build for Particle devices, which allows remote access of the firmware API using a TCP connection.
Flash the VoodooSpark firmware
The VoodooSpark firmware can be deployed very easily using the Web IDE at Particle Build (https://build.particle.io). Copy and paste the code available at https://raw.githubusercontent.com/voodootikigod/voodoospark/master/firmware/voodoospark.cpp in your Web IDE editor window, and click the Flash button (). This will burn the custom firmware onto your Particle Photon.