Receiving unix/epoch time from time server with atom


#1

Is it possible to use the Helium Atom to connect to a time server - say, time.nist.gov - and retrieve the current unix or epoch time for timstamping purposes? Specifically, in an Arduino environment for an Intel Galileo Gen2 equivalent board. I submitted this question to Helium support and they mentioned an API for time in the Arduino client, but did not give instructions on where to obtain said API.


#2

Hi Chris,

Thanks for the question. Is there a specific Cloud API/end point you’re planning to write the sensor data to once you’ve captured the timestamp?

Mark


#3

Yes. We are sending the data to an Industrial IOT cloud platform. The API we received from them relies on an Ethernet connection to retrieve an NTP packet from a time server, then converts it into epoch time. We will not be using wired connections in our applications, nor do we wish to use WiFi.


#4

@Cdmoral1 If the Atom is on and connected to the network, you can get an ntp based, unix epoch based timestamp straight from it using the Helium.info API:

struct helium_info info;
helium.info(&info);
timestamp = info.time;

Hope that helps!


#5

Yes, that does. Thank you.