Running the example program which utilizes the SparkTime library, things don’t work correctly on a Photon.
Problem is in the library.
Symptoms:
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.
as
currentTime = rtc.now();
Serial.println(rtc.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.
yes, thanks. changing the ntp server corrected the problem.
My DNS (4.2.2.2 and 8.8.8.8) succeed for the north-america.pool.ntp.org as in the original.
===============================
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.
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.