Photon to smartphone connection tcp server/client no cloud

Hello!

i’m a noob about particle. I’ve just bought a particle photon and i’m starting to develope some simple code.

i’ve write a code that blink a led over the internet and also whit a physical button wired to a digital input. The code was based on the tutorial code “Control LEDs over the 'net” that i found on particle documentation. I added to the code a SYSTEM_THREAD (ENABLED) just to run the code and blink the led by the manual button also when the connection to the cloud is lost.

Now i want try to blink the led also with the smartphone directly using the local wi-fi without any connection to the cloud (no internet connetion). I would set the photon as a server and the smartphone as a client.

Can you suggest me some simple “getting started” code example to use for start developing the code and understand the basic of tcp server/client trasmission?
Alternatively i can also start to learn to establish a diret communication to pc instead of a smartphone if this task is more easy.

thank you!

The simple way would be to create a tiny webpage on the photon with a button, then it is irrelevant whether that page is loaded by a phone or a PC. You can find plenty of examples of that if you google it/check the projects link at the top. You can also look at examples for Arduino/NodeMCU (as long they are are using the Arduino code not Lua) as they willl be very similar.