# Photon and syncTime

**URL:** <https://community.particle.io/t/photon-and-synctime/12056>\
**Category:** Troubleshooting\
**Created:** [May 24, 2015, 6:19pm UTC](https://community.particle.io/t/photon-and-synctime/12056 "2015-05-24T18:19:55Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![bpr](https://avatars.discourse-cdn.com/v4/letter/b/8797f3/32.png) [@bpr](https://community.particle.io/u/bpr)\
**Post date:** [May 24, 2015, 6:19pm UTC](https://community.particle.io/t/photon-and-synctime/12056/1 "2015-05-24T18:19:55Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [May 24, 2015, 11:05pm UTC](https://community.particle.io/t/photon-and-synctime/12056/2 "2015-05-24T23:05:11Z")

</div>

Seems like some issue with the photon side. Opened an issue here: [https://github.com/spark/firmware/issues/426](https://github.com/spark/firmware/issues/426)

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [May 25, 2015, 4:36am UTC](https://community.particle.io/t/photon-and-synctime/12056/3 "2015-05-25T04:36:07Z")

</div>

Looks like we have a fix soon: [https://github.com/spark/firmware/commit/82c2fccc1e9f5907c03c6adcda1cca9038f026f4](https://github.com/spark/firmware/commit/82c2fccc1e9f5907c03c6adcda1cca9038f026f4)

---

<div class="post-metadata">

**Author:** ![tjp](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/tjp/32/5613_2.png) [@tjp](https://community.particle.io/u/tjp)\
**Post date:** [June 5, 2015, 8:10pm UTC](https://community.particle.io/t/photon-and-synctime/12056/4 "2015-06-05T20:10:33Z")

</div>

I get the following error when trying to use Spark.syncTime() in my Photon project:

```
undefined reference to 'spark_protocol_send_time_request'
spark_wiring_cloud.h:103:0
```

---

<div class="post-metadata">

**Author:** ![bko](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bko/32/20704_2.png) [@bko](https://community.particle.io/u/bko)\
**Post date:** [June 5, 2015, 8:11pm UTC](https://community.particle.io/t/photon-and-synctime/12056/5 "2015-06-05T20:11:26Z")

</div>

Hi @tjp

I moved your post over here. The github issue is one post up by @kennethlimcp

Bottom line: fixed soon.

---

<div class="post-metadata">

**Author:** ![tjp](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/tjp/32/5613_2.png) [@tjp](https://community.particle.io/u/tjp)\
**Post date:** [June 5, 2015, 8:35pm UTC](https://community.particle.io/t/photon-and-synctime/12056/6 "2015-06-05T20:35:06Z")

</div>

Sorry, I guess I missed this post :-/

---

<div class="post-metadata">

**Author:** ![jrodas](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@jrodas](https://community.particle.io/u/jrodas)\
**Post date:** [July 10, 2015, 7:39pm UTC](https://community.particle.io/t/photon-and-synctime/12056/7 "2015-07-10T19:39:38Z")

</div>

Hi, the problem still persists. Web IDE & Spark.syncTime() tested (and not working) on July 9, 2015 with a Photon.

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [July 11, 2015, 12:30am UTC](https://community.particle.io/t/photon-and-synctime/12056/8 "2015-07-11T00:30:21Z")

</div>

Please wait for the release of 0.4.3 for photon which has the fix

---

<div class="post-metadata">

**Author:** ![Kevin](https://avatars.discourse-cdn.com/v4/letter/k/2acd7d/32.png) [@Kevin](https://community.particle.io/u/Kevin)\
**Post date:** [July 11, 2015, 3:55pm UTC](https://community.particle.io/t/photon-and-synctime/12056/9 "2015-07-11T15:55:36Z")

</div>

Hi  
Any timelines for this release (I have the same issue).

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [July 11, 2015, 4:15pm UTC](https://community.particle.io/t/photon-and-synctime/12056/10 "2015-07-11T16:15:42Z")

</div>

@Kevin, within the next two weeks 😄

---

<div class="post-metadata">

**Author:** ![sasi](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@sasi](https://community.particle.io/u/sasi)\
**Post date:** [July 21, 2015, 10:08pm UTC](https://community.particle.io/t/photon-and-synctime/12056/11 "2015-07-21T22:08:29Z")

</div>

@peekay123, any update on this issue. Looks like this has been open for almost a month. For me time does not seem to sync at bootup either

---

<div class="post-metadata">

**Author:** ![Moors7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/moors7/32/588_2.png) [@Moors7](https://community.particle.io/u/Moors7)\
**Post date:** [July 21, 2015, 10:15pm UTC](https://community.particle.io/t/photon-and-synctime/12056/12 "2015-07-21T22:15:44Z")

</div>

Have you tried upgrading to 0.4.3, which should contain the fix according to @kennethlimcp? Steps to do so can be found here: [https://github.com/spark/firmware/releases/tag/0.4.3-rc2](https://github.com/spark/firmware/releases/tag/0.4.3-rc2)  
The auto update feature is planned to be released shortly, so that should make it easier 😄

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [July 21, 2015, 10:36pm UTC](https://community.particle.io/t/photon-and-synctime/12056/13 "2015-07-21T22:36:07Z")

</div>

@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!).

---

<div class="post-metadata">

**Author:** ![neo12ibraheem](https://avatars.discourse-cdn.com/v4/letter/n/da6949/32.png) [@neo12ibraheem](https://community.particle.io/u/neo12ibraheem)\
**Post date:** [July 22, 2015, 3:48pm UTC](https://community.particle.io/t/photon-and-synctime/12056/14 "2015-07-22T15:48:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [July 22, 2015, 3:50pm UTC](https://community.particle.io/t/photon-and-synctime/12056/15 "2015-07-22T15:50:41Z")

</div>

- V0.3.4. is only for the Core
- currently version for Photon is V0.4.1 so yup… V0.4.3 is not updated yet.

Building locally for now will work 😄

---

<div class="post-metadata">

**Author:** ![neo12ibraheem](https://avatars.discourse-cdn.com/v4/letter/n/da6949/32.png) [@neo12ibraheem](https://community.particle.io/u/neo12ibraheem)\
**Post date:** [July 22, 2015, 4:01pm UTC](https://community.particle.io/t/photon-and-synctime/12056/16 "2015-07-22T16:01:47Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [July 22, 2015, 4:03pm UTC](https://community.particle.io/t/photon-and-synctime/12056/17 "2015-07-22T16:03:20Z")

</div>

Particle CLI is _not_ local compiling as it still uses the Build farm. 😃

There’s currently no option to switch versions 😉

---

<div class="post-metadata">

**Author:** ![Moors7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/moors7/32/588_2.png) [@Moors7](https://community.particle.io/u/Moors7)\
**Post date:** [July 22, 2015, 4:09pm UTC](https://community.particle.io/t/photon-and-synctime/12056/18 "2015-07-22T16:09:21Z")

</div>

> [@neo12ibraheem](#):
>
> I'm probably using the wrong tool!

This should give you the right tools:

> [@Toolchain for Windows Installer](https://community.particle.io/t/toolchain-for-windows-installer/13217/32):
>
> Welp. Sourceforge finally is back up (mainly), so I made some improvements. It now will install the toolchain, Netbeans for development, the Particle CLI, and all the assorted requirements for those things. It also includes a Netbeans project, so after setup, you should just be able to run Netbeans and click Build, and you’re good to go. See more info [here](https://github.com/mumblepins/ParticleToolchainInstaller), get it [here](https://github.com/mumblepins/ParticleToolchainInstaller/releases/tag/v0.4.3a). Tested on Win7, with nothing else really installed, and it seems to work fine. Let me know of any issues!

---

<div class="post-metadata">

**Author:** ![neo12ibraheem](https://avatars.discourse-cdn.com/v4/letter/n/da6949/32.png) [@neo12ibraheem](https://community.particle.io/u/neo12ibraheem)\
**Post date:** [July 22, 2015, 7:12pm UTC](https://community.particle.io/t/photon-and-synctime/12056/19 "2015-07-22T19:12:36Z")

</div>

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:

```
particle flash YOUR_DEVICE_NAME system-part1-0.4.3-photon.bin
particle flash YOUR_DEVICE_NAME system-part2-0.4.3-photon.bin

```

To install the toolchain, I downloaded and ran the installer (today) from [here](https://github.com/mumblepins/ParticleToolchainInstaller/releases/tag/v0.4.3a) and followed the instructions from [here](https://github.com/mumblepins/ParticleToolchainInstaller).

---

<div class="post-metadata">

**Author:** ![mdma](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mdma/32/1924_2.png) [@mdma](https://community.particle.io/u/mdma)\
**Post date:** [July 22, 2015, 7:15pm UTC](https://community.particle.io/t/photon-and-synctime/12056/20 "2015-07-22T19:15:44Z")

</div>

Could you send me your user-part.bin binary and I’ll take a look. (And some details of how I know that it’s working!) Thanks 🙂

[Next page](https://community.particle.io/t/photon-and-synctime/12056.md?page=2)
