I have been using the AwsSendDataOverMQTT and managed to successfully use the template. I am mostly interested in using the accelerometer data and I have some questions on interpreting the output generated (I have attached some results).
Firstly, how can I control the sampling frequency of the accelerometer? What frequency is it currently sampling at? It appears to be writing to the console once every second, however I cannot work out if it is generating an average value over this time period, or some other signal processing metric.
Secondly, what are the units associated with the output? Is it mm/s^2
Thirdly, how does the time stamp work? within the template when open on XDK-Workbench, it says the time stamp will work as shown below
struct tm tm =
.tm_sec = 0, /* Seconds: 0-59 */
.tm_min = 0, /* Minutes: 0-59 */
.tm_hour = 0, /* Hours since midnight: 0-23 */
.tm_mday = 0, /* Day of the month: 1-31 */
.tm_mon = 0, /* Month of the year *since* January : 0-11 */
.tm_year = 0, /* Years since 1900 */
.tm_wday = 0, /* not required */
.tm_yday = 0, /* not required */
.tm_isdst = 0, /* not required */
However, when matching this up with the timestamp that is shown in the attached .xlxs, this does not make any sense
Thankyou for any insight you can provide
Solved! Go to Solution.
The AWS example uses a soft-timed sensing and publishing concept. Only one sample is acquired and the acquisition period is controlled by the constant definition APP_MQTT_DATA_PUBLISH_PERIODICITY .
The default configuration will present the accelerometer sample in integer format in milli-Gs, that is the value 1000 corresponds to 1G or 9.81m/s^2.
The timestamp as provided by the SNTP server will be a unix timestamp, in your case it looks like it has been multiplied with 1000 to achieve a ms granularity.
Thankyou Francisco for your reply! You have been extremely helpful.
Just a follow up question, it seems that all the code is available to set up the example template to trigger from interrupts, where all the information is in the Accelerometer.c file in the example template. How do I modfy the example code to sample based on interrupts, and how can I set the relevant timers?