In my project I want to make sure the time is processed correctly during setup.
WiFi.on(); //Turning the WiFi on. waitUntil(WiFi.ready); //wait until the WiFi is ready. Particle.connect(); //Connect to the Particle Cloud waitUntil(Particle.connected); //Wait until connected to the Particle Cloud. Particle.syncTime(); //Synchronize timer with the Particle Cloud. Particle.process(); //Ensures that data received from the Cloud is actually processed and used. waitUntil(Particle.process()); //Waits until all the data is processed (this ensure time on the Photon is correct). Time.zone(timeZone); //Makes sure the time is correct for our timezone. currTime = Time.local() % 86400; //Sets the current time in seconds from midnight.
waitUntil(Particle.process()) is causing 4 errors:
- void value not ignored as it ought to be (breakbeam.ino:93:31), clearly it does not accept
- could not convert ‘_condition.setup()::__lambda5()’ from ‘void’ to ‘bool’ (…/wiring/inc/spark_wiring_system.h:158:40)
- in argument to unary ! (…/wiring/inc/spark_wiring_system.h:158:28)
- void value not ignored as it ought to be (…/wiring/inc/spark_wiring_system.h:161:27).
The problem with this code is that it actually works in another project. I directly copied it from there, including the declarations of
I work in the Particle Dev IDE, and when I copy the code of the working project directly into this project it gives me errors. However, when I close the IDE, open the IDE with the working project and upload that, it does work!
How is it possible that completely identical code, with identical declarations and usage, yield such a different result? I was thinking, perhaps, I had the wrong firmware, perhaps the usage of
waitUntil() has been changed. But this is impossible because I can upload the working sketch.
So, I’m completely at a loss here. I don’t know if this is a bug. I cannot open spark_wiring_system.h. I expect it is in the cloud.
Can you guys help me figure out how to solve this or perhaps the Particle development team can use this to fix a bug. Whatever helps.