0
votes

I want to add a timestamp with the data I am collecting in Contiki. When I am adding time.h from c library, it is showing that the associated files are missing. Can someone show to add the time stamp either using standard C files or using Contiki library?

3

3 Answers

0
votes

You might want to have a look at core/sys/clock.h. It might not provide a date and time but at least you will get the seconds since startup.

0
votes

it is better to output the data to python and there it is possible to add timestamp(month and date)

0
votes

I had a similar requirement in my project. I did the following.

  1. Use microcontroller RTC to get date and time
  2. Convert that into Unix timestamp. If you just google you can find simple C code for converting date and time into Unix timestamp.
  3. Send timestamp with payload, my payload is in json format so I use a key to distinguish from other data.

Hope this helps.