In attempting to compile a MQTT sketch in the Web IDE, I get:
../../../build/target/user/platform-6/libuser.a(mqttsender.o): In function `CloudClass::syncTime()':
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-private/user/../wiring/inc/spark_wiring_cloud.h:103: undefined reference to `spark_protocol_send_time_request'
collect2: error: ld returned 1 exit status
make: *** [/spark/compile_service/shared/workspace/6_hal_12_0/firmware-priva461a74c6cafc0dc90054fea5bf282765cadc00bb3a70b793f0f710caa581.elf] Error 1
The sketch compiles and works fine on the Spark core but compilation fails for the Photon as above. Any fix available?
EDIT: removing Spark.syncTime(); did the trick and so far seems unnecessary as it seemed for Spark core. Is synchTime gone for Photon?
@sasi, as @Moors7 said, the problem (FreeRTOS resetting the RTC) was fixed in the latest release. As for the synched time vs NIST time, I flagged the issue with @Dave and he is looking into a solution (I think!).
I’m having the same issue, building using the Web IDE. I’ve updated the Photon to 0.4.3 OTA using particle-cli, but the build is still failing with error:
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-private/user/../wiring/inc/spark_wiring_cloud.h:103: undefined reference to `spark_protocol_send_time_request'
The Web IDE settings page shows “you are building with spark firmware v0.3.4” but there is no other option to select the latest firmware. I’ve refreshed the page and disconnected/reconnected the Photon but v0.4.3 does not show as an option in the Web IDE. I’m guessing v0.4.3 is not supported yet in the Web IDE? I’ll try to build locally for now.
Thanks @kennethlimcp, I’m trying to compile using particle-cli, but getting the same error. How do I set which version to compile against? Can’t seem to work it out using the cli options?
Edit: ok I think the cli actually uses the cloud to compile(?), so I’m probably using the wrong tool!
Thanks guys, I’ve installed the toolchain, amended the application.cpp file slightly and built the new firmware. I located the user-part.bin file and attempted to flash it OTA using the particle-cli:
particle flash photon1 user-part.bin
The cli responds with “update started” status and I can see the Photon LED status flash magenta to indicate a firmware update, then reboot and re-connect to the cloud.
But it appears the firmware isn’t actually updated. It appears the last firmware flashed through the web IDE is still running (LED blink app). So I just flashed a different app through the web IDE and that was successful. Tried again to flash the user-part.bin using the cli and it appears again to go through the flashing process but not actually flash the new firmware. I’m guessing the new firmware is being rejected at the installation stage on the device? Perhaps the versions are incompatible, although I believe I’m using all v0.4.3 code?
Before doing the above, I updated the system firmware to v0.4.3 using: