RTC example wont compile on Particle Photon

Hello to all.

Trying to use the RTC example

Particle IDE gives Compile error
TimeLib.h: No such file or directory

Below is the error shown in Particle Web IDE:

Processing rtc-test.ino
Checking library blynk…
Installing library blynk 0.6.4 to lib/blynk …
Library blynk 0.6.4 installed.
make -C …/modules/photon/user-part all
make[1]: Entering directory ‘/firmware/modules/photon/user-part’
make -C …/…/…/user
make[2]: Entering directory ‘/firmware/user’
Building cpp file: src/rtc-test.cpp
Invoking: ARM GCC CPP Compiler
mkdir -p …/build/target/user/platform-6-msrc/
arm-none-eabi-gcc -DSTM32_DEVICE -DSTM32F2XX -DPLATFORM_THREADING=1 -DPLATFORM_ID=6 -DPLATFORM_NAME=photon -DPLATFORM_GEN=2 -DUSBD_VID_SPARK=0x2B04 -DUSBD_PID_DFU=0xD006 -DUSBD_PID_CDC=0xC006 -DSPARK_PLATFORM -g3 -gdwarf-2 -Os -mcpu=cortex-m3 -mthumb --specs=nano.specs -DINCLUDE_PLATFORM=1 -DPRODUCT_ID=6 -DPRODUCT_FIRMWARE_VERSION=65535 -DUSE_STDPERIPH_DRIVER -DDFU_BUILD_ENABLE -DSYSTEM_VERSION_STRING=2.0.1 -DRELEASE_BUILD -I./inc -I…/wiring/inc -I…/system/inc -I…/services/inc -I…/third_party/nanopb/nanopb -I…/communication/inc -I…/hal/inc -I…/hal/shared -I…/hal/src/photon -I…/hal/src/stm32f2xx -I…/hal/src/stm32 -I…/hal/network/util -I…/hal/network -I…/hal/src/photon/api -I…/hal/src/photon/include -I…/hal/src/photon/wiced/security/BESL/host/WICED/ -I…/hal/src/photon/wiced/security/BESL/include -I…/hal/src/photon/wiced/security/BESL -I…/hal/src/photon/wiced/security/BESL/crypto -I…/hal/src/photon/wiced/WWD/include/ -I…/hal/src/photon/wiced/platform/include/ -I…/hal/src/photon/wiced/platform/GCC/ -I…/hal/src/photon/wiced/security/BESL/supplicant/ -I…/hal/src/photon/libraries/crypto -I…/hal/src/photon/libraries/daemons/DNS_redirect -I…/third_party/miniz/miniz -I…/platform/shared/inc -I…/platform/MCU/STM32F2xx/STM32_USB_Host_Driver/inc -I…/platform/MCU/STM32F2xx/STM32_USB_OTG_Driver/inc -I…/platform/MCU/STM32F2xx/STM32_StdPeriph_Driver/inc -I…/platform/MCU/STM32F2xx/STM32_USB_Device_Driver/inc -I…/platform/MCU/STM32F2xx/SPARK_Firmware_Driver/inc -I…/platform/MCU/shared/STM32/inc -I…/platform/MCU/STM32F2xx/CMSIS/Include -I…/platform/MCU/STM32F2xx/CMSIS/Device/ST/Include -I…/dynalib/inc -Isrc -I./libraries -Ilib/blynk/src -I. -MD -MP -MF …/build/target/user/platform-6-msrc/rtc-test.o.d -ffunction-sections -fdata-sections -Wall -Wno-switch -Wno-error=deprecated-declarations -fmessage-length=0 -fno-strict-aliasing -DSPARK=1 -DPARTICLE=1 -Wundef -DSTART_DFU_FLASHER_SERIAL_SPEED=14400 -DSTART_YMODEM_FLASHER_SERIAL_SPEED=28800 -DBOOTLOADER_SDK_3_3_0_PARTICLE -DPARTICLE_DCT_COMPATIBILITY -DSPARK_PLATFORM_NET=BCM9WCDUSI09 -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc -DLOG_INCLUDE_SOURCE_INFO=1 -DPARTICLE_USER_MODULE -DUSER_FIRMWARE_IMAGE_SIZE=0x20000 -DUSER_FIRMWARE_IMAGE_LOCATION=0x80A0000 -DMODULAR_FIRMWARE=1 -DMODULE_VERSION=6 -DMODULE_FUNCTION=5 -DMODULE_INDEX=1 -DMODULE_DEPENDENCY=4,2,2011 -DMODULE_DEPENDENCY2=0,0,0 -D_GNU_SOURCE -DLOG_MODULE_CATEGORY="“app”" -fno-exceptions -fno-rtti -fcheck-new -std=gnu++14 -c -o …/build/target/user/platform-6-msrc/rtc-test.o src/rtc-test.cpp
rtc-test.ino:43:10: fatal error: TimeLib.h: No such file or directory
compilation terminated.
…/build/module.mk:274: recipe for target ‘…/build/target/user/platform-6-msrc/rtc-test.o’ failed
make[2]: *** […/build/target/user/platform-6-msrc/rtc-test.o] Error 1
make[2]: Leaving directory ‘/firmware/user’
…/…/…/build/recurse.mk:11: recipe for target ‘user’ failed
make[1]: *** [user] Error 2
make[1]: Leaving directory ‘/firmware/modules/photon/user-part’
…/build/recurse.mk:11: recipe for target ‘modules/photon/user-part’ failed
make: *** [modules/photon/user-part] Error 2

Have you tried installing the Time library?

Pete.

Can’t see it being available @PeteKnight

WARNING :
For this example you’ll need Time keeping library:
GitHub - PaulStoffregen/Time: Time library for Arduino

This code is based on an example from the Time library:
https://github.com/PaulStoffregen/Time/blob/master/examples/TimeSerial/TimeSerial.ino
*************************************************************/

Pete.

Sorry @PeteKnight.
I’m lost!

That lib isn’t available through Particle webide.
Should I download and add it as a. cpp. h
Does the code example remain the same?

No idea! Maybe a question for the Particle forum?

Pete.

Check this out for RTC on the Particle Photon.

https://docs.particle.io/reference/device-os/firmware/#time

Thanks for that @BianchiRider
But how would this help with the RTC example by Blynk?

I thought you wanted to get the time on your Particle Photon for your Blynk application. This is how I do it on my Photon that has Blynk. RTC is ‘built’ into the firmware of the Particle Photon.

I actually wanted to get the time from Blynk server.
That’s why I was trying to use the example first from Blynk.

Time library already installed?

Libraries are added through Particle Web ide.
The particular libs in the Blynk example can’t be added.