Tutorial: Spark Variable and Function on One Web Page

If you want to update a variable on the device side, you need to register a Particle.function() (or Particle.subscribe()) as target for your POST request (or event in case of Particle.subscribe()).

Your code does only register Particle.variable() and they can only be requested (read but never set remotely) via GET.

1 Like