MLopezJ / nRF-Asset-Tracker-through-Coiote-flow

Module and data flow of the nRF Asset Tracker by its integration with Coiote from AVSystem
0 stars 0 forks source link

Find missing firmware definition for nRF Asset Tracker values #2

Open MLopezJ opened 1 year ago

MLopezJ commented 1 year ago

The nRF Asset Tracker app define its expected input in this schema.

So far its been not possible to find the equivalent value in asset-tracker-cloud-firmware-azure for some values from the schema and it is required.

MLopezJ commented 1 year ago

Missing values

Missing firmware definition documented in json format.

/**
 * It is required to found the LwM2M definition and firmware's equivalent var name for the following variables.
 *
 * Object is a representation of required input in nRF Asset Tracker
 * @see https://github.com/NordicSemiconductor/asset-tracker-cloud-docs/blob/saga/docs/cloud-protocol/state.reported.schema.json
 *
 *
 */
const missingValues = {
  cfg: {
    /**
     * About: List of modules which should be disabled when sampling data
     * @see https://github.com/NordicSemiconductor/asset-tracker-cloud-docs/blob/saga/docs/cloud-protocol/cfg.schema.json#L61
     */
    nod: "???????", // ***** Value is required in nRF Asset Tracker and equivalent definition was not found in firmware *****
  },
  bat: {
    /**
     * About: Timestamp as Unix epoch with millisecond precision (UTC)
     * @see https://github.com/NordicSemiconductor/asset-tracker-cloud-docs/blob/saga/docs/cloud-protocol/state.reported.schema.json#L21
     */
    ts: "???????", // ***** Value is required in nRF Asset Tracker and equivalent definition was not found in firmware *****
  },
  env: {},
  gnss: {
    v: {
      /**
       * About: Heading of movement in degrees
       * @see https://github.com/NordicSemiconductor/asset-tracker-cloud-docs/blob/saga/docs/cloud-protocol/state.reported.schema.json#L95
       */
      hdg: "???????", // ***** Value is required in nRF Asset Tracker and equivalent definition was not found in firmware *****
    },
  },
  dev: {
    v: {
      /**
       * About: SIM ICCID
       * @see https://github.com/NordicSemiconductor/asset-tracker-cloud-docs/blob/saga/docs/cloud-protocol/state.reported.schema.json#L126
       */
      iccid: "??????????, MODEM_ICCID", // ***** Value is required in nRF Asset Tracker and equivalent definition was not found in firmware *****

      /**
       * About: Board Version
       * @see https://github.com/NordicSemiconductor/asset-tracker-cloud-docs/blob/saga/docs/cloud-protocol/state.reported.schema.json#L139
       */
      brdV: "??????????, MODEM_BOARD", // ***** Value is required in nRF Asset Tracker and equivalent definition was not found in firmware *****
    },
  },
  roam: {
    v: {
      /**
       * About: band
       * @see https://github.com/NordicSemiconductor/asset-tracker-cloud-docs/blob/saga/docs/cloud-protocol/state.reported.schema.json#L163
       */
      band: "???????", // ***** Value is required in nRF Asset Tracker and equivalent definition was not found in firmware *****

      /**
       * About: Network mode
       * @see https://github.com/NordicSemiconductor/asset-tracker-cloud-docs/blob/saga/docs/cloud-protocol/state.reported.schema.json#L169
       */
      nw: "???????", // ***** Value is required in nRF Asset Tracker and equivalent definition was not found in firmware *****

      /**
       * About: The %CONEVAL AT command returns amongst other data the energy estimate: Relative estimated energy consumption of data transmission
       * compared to nominal consumption. A higher value means smaller energy consumption. 5: Difficulties in setting up connections. Maximum number
       * of repetitions might be needed for data. 6: Poor conditions. Setting up a connection might require retries and a higher number of repetitions
       * for data. 7: Normal conditions for cIoT device. No repetitions for data or only a few repetitions in the worst case. 8: Good conditions.
       * Possibly very good conditions for small amounts of data. 9: Very good conditions. Efficient data transfer estimated also for larger amounts of data.
       * @see https://github.com/NordicSemiconductor/asset-tracker-cloud-docs/blob/saga/docs/cloud-protocol/state.reported.schema.json#L211
       */
      eest: "???????", // ***** Value is required in nRF Asset Tracker and equivalent definition was not found in firmware *****
    },
  },
};
MLopezJ commented 1 year ago

After a meeting with Simen the following values were found:

object prop LwM2M value
roam nw 4.0
dev brdV 3.0

The nod prop from cfg object is from the custom object Configuration (50009) and it stands to no data list.


    /* If a flag in the no_data structure is set to true the corresponding JSON entry is
     * added to the no data array configuration.
     */
    if (data->no_data.gnss) {
        cJSON *gnss_str = cJSON_CreateString(CONFIG_NO_DATA_LIST_GNSS);

        if (gnss_str == NULL) {
            cJSON_Delete(nod_list);
            err = -ENOMEM;
            goto exit;
        }

        json_add_obj_array(nod_list, gnss_str);
    }

    if (data->no_data.neighbor_cell) {
        cJSON *ncell_str = cJSON_CreateString(CONFIG_NO_DATA_LIST_NEIGHBOR_CELL);

        if (ncell_str == NULL) {
            cJSON_Delete(nod_list);
            err = -ENOMEM;
            goto exit;
        }

        json_add_obj_array(nod_list, ncell_str);
    }

    if (data->no_data.wifi) {
        cJSON *wifi_str = cJSON_CreateString(CONFIG_NO_DATA_LIST_WIFI);

        if (wifi_str == NULL) {
            cJSON_Delete(nod_list);
            err = -ENOMEM;
            goto exit;
        }

        json_add_obj_array(nod_list, wifi_str);
    }

    /* If there are no flag set in the no_data structure, an empty array is encoded. */
    json_add_obj(config_obj, CONFIG_NO_DATA_LIST, nod_list);
    json_add_obj(parent, object_label, config_obj);

    return 0;

There is no a definition for this prop in the XML definition, but value will be an array. And could looks like the following cases:

There is still missing values.

MLopezJ commented 1 year ago

Found values

data transition

Missing values

Missing firmware definition documented in json format.

/**
 * It is required to found the LwM2M definition and firmware's equivalent var name for the following variables.
 *
 * Object is a representation of required input in nRF Asset Tracker
 * @see https://github.com/NordicSemiconductor/asset-tracker-cloud-docs/blob/saga/docs/cloud-protocol/state.reported.schema.json
 *
 *
 */
 const missingValues = {
    cfg: {},
    bat: {},
    env: {},
    gnss: {
      v: {
        /**
         * About: Heading of movement in degrees
         * @see https://github.com/NordicSemiconductor/asset-tracker-cloud-docs/blob/saga/docs/cloud-protocol/state.reported.schema.json#L95
         */
        hdg: "???????", // ***** Value is required in nRF Asset Tracker and equivalent definition was not found in firmware *****
      },
    },
    dev: {
      v: {
        /**
         * About: SIM ICCID
         * @see https://github.com/NordicSemiconductor/asset-tracker-cloud-docs/blob/saga/docs/cloud-protocol/state.reported.schema.json#L126
         */
        iccid: "??????????, MODEM_ICCID", // ***** Value is required in nRF Asset Tracker and equivalent definition was not found in firmware *****
      },
    },
    roam: {
      v: {
        /**
         * About: band
         * @see https://github.com/NordicSemiconductor/asset-tracker-cloud-docs/blob/saga/docs/cloud-protocol/state.reported.schema.json#L163
         */
        band: "???????", // ***** Value is required in nRF Asset Tracker and equivalent definition was not found in firmware *****

        /**
         * About: The %CONEVAL AT command returns amongst other data the energy estimate: Relative estimated energy consumption of data transmission
         * compared to nominal consumption. A higher value means smaller energy consumption. 5: Difficulties in setting up connections. Maximum number
         * of repetitions might be needed for data. 6: Poor conditions. Setting up a connection might require retries and a higher number of repetitions
         * for data. 7: Normal conditions for cIoT device. No repetitions for data or only a few repetitions in the worst case. 8: Good conditions.
         * Possibly very good conditions for small amounts of data. 9: Very good conditions. Efficient data transfer estimated also for larger amounts of data.
         * @see https://github.com/NordicSemiconductor/asset-tracker-cloud-docs/blob/saga/docs/cloud-protocol/state.reported.schema.json#L211
         */
        eest: "???????", // ***** Value is required in nRF Asset Tracker and equivalent definition was not found in firmware *****
      },
    },
  };
MLopezJ commented 1 year ago

hdg

It is not possible to find the equivalent LwM2M specification for this value.

It seems to be related to Location, which in the firmware it refers to object 6 in LwM2M. But object 6 does not contain any value related to heading.

There is another object with "Location" as the name in LwM2M, which is id 3336. This object contains a prop which can be related to heading but it does not contains props related to altitud, which is required in nRF Asset Tracker as well.

Full situation:

SeppoTakalo commented 1 year ago

LwM2M Location object have a resource called "velocity".

The velocity of the LwM2M Client, as defined in [3GPP-TS_23.032].

That spec defines Velocity as a speed and bearing. Screenshot from 2023-03-01 13-11-09 And because they use north as a reference of bearing, it is the same as heading.

SeppoTakalo commented 1 year ago

Band number might be able to be decoded from ECID-Signal Measurement Information

SeppoTakalo commented 1 year ago

For AT%CONEVAL we could use the Generic Sensor object to deliver the data.