Particle.syncTimePending not a member


#1

Hi I am writing some firmware for a new device and am trying to setup our time synchronization routines. I tried this code from the documentation:

       void loop()
        {
          // Request time synchronization from the Particle Device Cloud
          Particle.syncTime();
          // Wait until Photon receives time from Particle Device Cloud (or 
        connection to Particle Device Cloud is lost)
          while(Particle.syncTimePending())
          {
         //
         // Do something else
         //

        Particle.process();
       }
      // Print current time
      Serial1.println(Time.timeStr());
    }

I get the error

‘class CloudClass’ has no member named ‘syncTimePending’

It seems like I am using the wrong namespace or need to include something. I get this error in the local IDE and in the web IDE.

Tyler


#2

Hi @smokedsalmonbagel

That was added about 2 years ago 0.6.1 but it is possible you are still running 0.5.3. Can you check in the web IDE what version you are targeting?


#3

You don’t want to call Particle.syncTime() on every iteration of loop().


#4

Thanks - I was not aware their was a system firmware upgrade process.

Tyler


#5

@ScruffR - thanks - I was just using the sample code to test compile the code. The actual firmware source is quite long.