TCP Server and Client Example Socket Programs "D7-ON" please

Correct, that is what I was referring to.
Basically you are assigning events or function calls on spark api to your own functions I think… Just not sure why.

Just tried it. It works great but I did leave out a major step. The Photon needs to be activated first to receive the websocket calls. So you have to activate the “connect” function before the Photon will receive information from the NodeJS server. I will put a dedicated webpage on the github site. Youi will need your CoreID and Access_Code for the page to work. You could also use the Client to activate the function.

Note D7 will show you that the activation worked, with a quick flash.

The new webpage is called activation.html and is now on the github site. Very sorry for the confusion.

https://github.com/hpssjellis/Particle-Spark-Core-Photon-Websocket-Hack/blob/master/activation.html

Here is what the activation.html webpage looks like

Note: It can be on your computer and does not have to be a live webpage.

Come to think of it I don’t think that step is needed except that the websocket will probably go to sleep if it isn’t used for 20 seconds or so. You could probably make a loop to activate the socket if it isn’t being used.

I was just trying to prove that the thing worked, so my code is probably not very efficient. Have fun. Hope it works for you.

THx