I have just started working with TTN nodes and I am using arduino with LoRa Shield. I am sending some sensor data to TTN and storing the bulky audio on a SD card. I want to fetch time from TTN so that I can properly timestamp my data on SD card. Since I will be writing every few hours, the accuracy of time stamp is not an issue at all. I can see the time on metadata of packets received from my node, but how can I use the java script to fetch it and send it as data to my node to be used as a time stamp?
It is quite a basic question and I spent a lot of time searching for an answer on different forums but didn’t find anything. A little help here will be really appreciated.
It is definitely an option to use RTC module but I think it will be an overkill just for time-stamping the data. It is going to eat up pins and space on my prototype. I have quite a large number of sensors to interface so I will avoid anything which can be avoided. I will be surprised if there is no possible means to fetch time despite having a connection to TTN.
It’s not quite what you asked for, but should be a pointer even if you’re not using aruino-lmic (mcci-catena in this case, I’ve not looked to see if it’s directly supported on the original code).
Thanks for sharing the example. I switched the library as mine did not have these functions. I was hopeful that it will work, but unfortunately it didn’t. The problem is here on line 215 of example you shared.
if (flagSuccess != 1) {
Serial.println(F("USER CALLBACK: Not a success"));
return;
}
The success flag is never 1. The communication with TTN is working without any problem though. I will see if I can ask for help at the github repo.
Any other help in the meanwhile will be appreciated.