Understanding asset tracker v2 configuration

Hi,

I have a Thingy:91 with asset tracker v2 installed on it, and I am a bit puzzled about the results I see based on the configuration. Let me list some information.

  1. Device: Thingy:91 (purchased late 2024)
  2. SDK: v2.7.0
  3. Zephyr: v3.6.99-ncs2
  4. Modem firmware: mfw_nrf9160_1.3.5
  5. Application: asset tracker v2
  6. Extra overlays: pgps and low-power
  7. Currently evaluating application using NRF cloud and the provided iBasis SIM

See the reported configuration below.

{
  "activeMode": false,
  "locationTimeout": 300,
  "activeWaitTime": 300,
  "movementResolution": 300,
  "movementTimeout": 86400,
  "accThreshAct": 2,
  "accThreshInact": 2,
  "accTimeoutInact": 300,
  "nod": []
}

What I am trying to achieve is roughly the following.

  • When there is no movement (i.e. inactivity), report a data point every 24 hours
  • When there is movement (i.e. activity), report every 5 minutes

I lowered the two threshold values from 4 to 2, otherwise no activity was registered for my use case. I extended the inactivity timeout to 5 minutes with the idea that one more data point would always be sampled after movement stops.

I thought the above configuration would achieve what I just explained. During inactivity, the device seems to behave as expected. During activity, behavior is not what I expected. If I look at the data in NRF cloud during activity, data is sampled every 10-60 seconds (varies between points). I suspect I might be interpreting the thresholds or inactivity timeout incorrectly, but might be something else too. Does someone have an idea what might be going on here and how I would achieve my desired functionality?

Parents
  • Hi,

    Asset Tracker configurations webpage mentions that in passive mode sampling and sending data happens in 2 cases, when timer controlled by Movement Resolution or Movement Timeout expires. Asset Tracker data module specifies configuration options which set movement timeout value (CONFIG_DATA_MOVEMENT_TIMEOUT_SECONDS) and movement resolution timeout value (CONFIG_DATA_MOVEMENT_RESOLUTION_SECONDS). You could try to set mentioned Kconfig options to desired values.

    Best regards,
    Dejan

  • I think I set those Kconfig options to similar values as shown in the reported config. I can recompile and try that again though, just to be sure. Regardless, isn't the live configuration shown above not supposed to override the compile time values?

  • Hi,

    What do you refer to as "live configuration"?

    Best regards,
    Dejan

  • Hi Dejan,

    I am referring to this configuration that I set through the nRF cloud and was also reported back by the device:

    {
      "activeMode": false,
      "locationTimeout": 300,
      "activeWaitTime": 300,
      "movementResolution": 300,
      "movementTimeout": 86400,
      "accThreshAct": 2,
      "accThreshInact": 2,
      "accTimeoutInact": 300,
      "nod": []
    }

    Best,

    Leon

  • Hi Leon,

    Have you tried to set mentioned Kconfig options to desired values and rebuild your project? To which values did you set them and what was the result?

    Can you show you full device shadow?

    Best regards,
    Dejan

  • Hi,

    I am actually traveling at the moment, so I can't recompile and test in the next two weeks. I'll have to get back to you when I'm back.

    Regardless, see the device shadow (with some values zeroed) below.

    {
        "shadow": {
            "reported": {
                "connection": {
                    "status": "connected",
                    "keepalive": 1200,
                    "disconnectReason": null,
                    "clientInitiatedDisconnect": null
    
                },
                "pairing": {
                    "state": "paired",
                    "topics": {
                        "d2c": "...",
                        "c2d": "..."
                    }
                },
                "config": {
                    "activeMode": false,
                    "locationTimeout": 300,
                    "activeWaitTime": 300,
                    "movementResolution": 300,
                    "movementTimeout": 86400,
                    "accThreshAct": 2,
                    "accThreshInact": 2,
                    "accTimeoutInact": 300,
                    "nod": [ ]
                },
                "nrfcloud_mqtt_topic_prefix": "...",
                "control": {
                    "alertsEn": false,
                    "logLvl": 1
                },
                "device": {
                    "deviceInfo": {
                        "appVersion": "0.0.0-development",
                        "modemFirmware": "mfw_nrf9160_1.3.5",
                        "imei": "...",
                        "board": "thingy91",
                        "sdkVer": "v2.7.0",
                        "appName": "asset_tracker_v2",
                        "zephyrVer": "v3.6.99-ncs2",
                        "hwVer": "nRF9160 SICA B1A"
                    },
                    "simInfo": {
                        "uiccMode": 0,
                        "iccid": "...",
                        "imsi": "..."
                    },
                    "connectionInfo": {
                        "protocol": "MQTT",
                        "method": "LTE"
                    },
                    "serviceInfo": {
                        "fota_v2": [ "MODEM", "APP" ]
                    },
                    "networkInfo": {
                        "currentBand": 0,
                        "networkMode": "LTE-M",
                        "rsrp": 0,
                        "areaCode": 0,
                        "mccmnc": 0,
                        "cellID": 0,
                        "ipAddress": "..."
                    }
                }
            },
            "desired": {
                "pairing": {
                    "state": "paired",
                    "topics": {
                        "d2c": "...",
                        "c2d": "..."
                    }
                },
                "nrfcloud_mqtt_topic_prefix": "...",
                "config": {
                    "activeMode": false,
                    "locationTimeout": 300,
                    "activeWaitTime": 300,
                    "movementResolution": 300,
                    "movementTimeout": 86400,
                    "accThreshAct": 2,
                    "accThreshInact": 2,
                    "accTimeoutInact": 300,
                    "nod": [ ]
                }
            },
            "version": 0
        }
    }

    Best,

    Leon

  • Hi Leon,

    Thank you for additional information.

    Could you please add overlay-debug.conf to your build configuration and share your application log?

    Best regards,
    Dejan

Reply Children
  • Hi Dejan,

    Took me a while to get back, and I have to admit, I did not use the debug overlay in the end. That was mostly because the USB connection I would use to capture the logs in realtime seems to interfere with the motion sensor. As a result, the behavior might be different than when the USB connection is not available.

    Regardless, I do think I found out indirectly what is causing the issue. It seems to be the relatively high `accTimeoutInact` value. That value is actually equal to the movement resolution. There seems to be some interference there. I reduced `accTimeoutInact` to 60 seconds (i.e. significantly lower than the movement resolution), and that seems to solve the issue. Reporting now happens at expected intervals. That information can be used by people who experience similar issues and run into this thread.

    Thanks again for your time and support!

Related