[Solved] Photon disconnects after values update

Actually you need the SparkCorePolledTimer.

Look through this thread Virtual pins need a timer for Particle and ensure you call the timer in loop().