General Questions on Asset_tracker_v2 application

Hi, I'm just experimenting with my nRF9160 DK and have run into some questions regarding the default asset_tracker_v2 program and how some of it works. I have read the documentation regarding the asset_tracker_v2 application at: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.8.0/nrf/applications/asset_tracker_v2/doc/asset_tracker_v2_description.html#configuration

I have the following questions:

1. In the nRF Cloud Terminal interface, there perodically appears a "Received" message with fields such as appID, messageType, data, and ts. I'm curious as to where the "appId" field is defined within the asset tracker source code?

2. I've tried to append some test values to the payload that is sent to the nRF Cloud, but they don't seem to be sent to nRF Cloud. As an example, I've tried to append a field called "newvalue1" with an integer value of 10 to be sent every time the battery voltage data is sent to nRF Cloud. After updating the structure definitions as appropriate, I added "modem_module_event->data.bat.newvalue1 = 10;" after the timestamp line within the battery_data_get() function within modem_module.c.

I have additionally added ".bat_newvalue = msg->module.modem.data.bat.newvalue1" to the if (IS_EVENT(msg, modem, MODEM_EVT_BATTERY_DATA_READY)) part of data_module.c and updated the cloud_data_battery definitions as appropriate. However, no additional data appears to be sent to nRF Cloud beyond the battery voltage and timestamp. I was wondering if there are any additional fields that I need to update in order for the data to send correctly?

3.I've been trying to implement functionality for the switches that are available on the nRF9160 DK, but am having some trouble with modifying the code such that it will respond to a change in state of the switches. A topic reply on another topic suggests referring to the http_update sample program, which has lent some insight into defining GPIO pins and reading them, but I was curious as to how this is handled within the asset_tracker_v2 program, as none of the modules seem to have explicit definition of the mappings of the buttons to physical GPIO pins. Thus, I was wondering if someone can explain where the pins are defined within this program, or maybe provide some more information regarding how to trigger an event when a switch is flipped as opposed to a button being pressed.

Thanks in advance to anyone who can offer any help!

Related