Asset Tracker v2 - How to monitor the On/Off state of the sliding switches: sw1 and sw2 reported every minute from the nRF9160DK device to a topic of the AWS IoT Core?

I have built and run the application: Asset Tracker v2 using Segger IDE with nRF Connect SDK 1.8.0 , and my nRF9160DK device communicates with the  AWS IoT Core topics.

I can see the battery voltage data (with its time stamp) reported every minute from my nRF9160DK device to the shadow topics of the AWS IoT Core and I can also see the button-pressed data reported (when a button is pressed) from my nRF9160DK device to the AWS IoT Core topic: <IMEI>/messages.

As a next step, I would like to see the On/Off state of the sliding switches: sw1 and sw2 reported every minute from my nRF9160DK device to a topic on the AWS IoT Core.

How can this be done? 

Parents
  • Hi,

    I retained in the payload sent from my nRF9160DK device to the AWS IoT Core all items that were originally a part of that payload for this application, including:

    1. the modem battery voltage value and its time stamp, reported every 2 min by the modem_module.

    2. the button1 and buton2 press messages, reported by the button handler in the ui_module upon pressing of each button.

    In addition, I added two items - sw1 and sw2, representing the state of the sliding switches sw1 and sw2 - to the data reported by the modem_module as a part of the info related to the modem battery voltage "bat", that showed in the Device Shadow State as follows:

    {

    "state":{

         "reported": {

               "bat": {

                   "v": 5070,

                   "ts": 16428634511720,

                   "sw1":  99'

                   "sw2":  77,

    And this data, including my newly added items: sw1 and sw2 used to be successfully transmitted from my nRF9160DK device to the AWS IoT Core only a few days ago.

    However, the problem started when I tried to add yet another two items to the data that was to be sent by the modem_module as a part of the modem battery voltage "bat".

    When I saw that my attempt to add yet another two items to the payload already reported by the modem_module was unsuccessful, I removed all changes that I introduced to the src files for this application in order to add yet another two items of data to the payload already reported by the modem_module. (I retained the items sw1 and sw2 in the payload, as they used to be transmitted to ASW IoT Core without a problem in the past).

    However, despite me removing all recent changes that I made to the src files for this application, the problem still persist.

    Regards,

    JM

Reply
  • Hi,

    I retained in the payload sent from my nRF9160DK device to the AWS IoT Core all items that were originally a part of that payload for this application, including:

    1. the modem battery voltage value and its time stamp, reported every 2 min by the modem_module.

    2. the button1 and buton2 press messages, reported by the button handler in the ui_module upon pressing of each button.

    In addition, I added two items - sw1 and sw2, representing the state of the sliding switches sw1 and sw2 - to the data reported by the modem_module as a part of the info related to the modem battery voltage "bat", that showed in the Device Shadow State as follows:

    {

    "state":{

         "reported": {

               "bat": {

                   "v": 5070,

                   "ts": 16428634511720,

                   "sw1":  99'

                   "sw2":  77,

    And this data, including my newly added items: sw1 and sw2 used to be successfully transmitted from my nRF9160DK device to the AWS IoT Core only a few days ago.

    However, the problem started when I tried to add yet another two items to the data that was to be sent by the modem_module as a part of the modem battery voltage "bat".

    When I saw that my attempt to add yet another two items to the payload already reported by the modem_module was unsuccessful, I removed all changes that I introduced to the src files for this application in order to add yet another two items of data to the payload already reported by the modem_module. (I retained the items sw1 and sw2 in the payload, as they used to be transmitted to ASW IoT Core without a problem in the past).

    However, despite me removing all recent changes that I made to the src files for this application, the problem still persist.

    Regards,

    JM

Children
Related