Library: "SparkTime" issue w/Photon

Running the example program which utilizes the SparkTime library, things don’t work correctly on a Photon.
Problem is in the library.

Example program starts up and prints the zulu time for the 50 second point within the minute.
nothing more prints. There should be repeating every minute at 10 seconds and other marks, a different time string format.
I added a print of the library’s value for ‘sec’ each time loop is called which seems to be about once a second.
currentTime =;

The number printed is always 50.

Anyone else able to run this example program properly? I have a stock Photon, unmodified example code and library.

On-line IDE. Windows 7.

I will look into this and get back to you.

great. thanks.

Hi @stevech

I am able to run the example from the library with one minor edit:

Change this line to:

  rtc.begin(&UDPClient, "");

Things have changed at and something is going wrong in DNS with “” address.

Can you try that and report back?

One other point: your Photon needs to be running at least system firmware 0.4.4 for UDP which is used by NTP to work.

yes, thanks. changing the ntp server corrected the problem.
My DNS ( and succeed for the as in the original.

> C:\Users\steve>nslookup
> Server:
> Address:

> Non-authoritative answer:
> Name:
> Addresses:

Also wondering… in the library, the source (local) port is 2309. Shouldn’t the port number be in the proper ephemeral range (e.g., 50,000 to 65535)? That 2309 might conflict in some larger LANs.

Thanks again

HI @stevech

Glad that worked for you. I think something is wrong with DNS for long host names on Photon, but it needs more investigation. The North-American alias works for me on regular hosts too.

As to the port, I think I used the same one as the Arduino library. It is not a well-known port that is used by any service, so I think it will be fine. I did create a github issue so I won’t forget next time I am in there updating.