Developer Portal Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 
    SOLVED

    Questions on AwsSendDataOverMQTT

    Stallion
    Member

    Questions on AwsSendDataOverMQTT

    Hi all,

    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

     

    2 REPLIES 2
    LlobetAtWork
    Long-established Member

    Re: Questions on AwsSendDataOverMQTT

    Hi Stallion,

    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.

    Best regards,

    Francisco Llobet

    Stallion
    Member

    Re: Questions on AwsSendDataOverMQTT

    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?

     

    Stallion

    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist