markopraakly, I had the same problem! The Spark RTC code works well but does not include cloud synchronization yet. Part of the reason your Spark flashes red is that your code (+ the firmware) is exceeding the (current) 16KB memory boundary since 4KB of the 20KB available is dedicated to buffers and such. To get things working, I had to do a few things:
- Clean up my code by removing any unnecessary globals variables
- Using local variables where possible in functions so they use stack/heap space instead of RAM
- Declaring “const” types for constants so they are stored in flash
- NOT using TCPclient and UDP at the same time since I found they are memory hogs. Instead, I use Spark.variable/Spark.publish/Spark.function to get my data out.
I then wrote a getUDPtime() based on bko’s excellent library to get the time in epoch format and use that to do a Time.setTime(udptime). I also set the timezone using Time.zone().
If you think it might help, I can post the getUDPtime() code.