bifravst / cat-tracker-fw

Cat Tracker Firmware
https://bifravst.github.io/
3 stars 3 forks source link

Device should report cfg after boot #37

Closed coderbyheart closed 4 years ago

coderbyheart commented 4 years ago

If a device is new, and there is no desired configuration, it will not report it's default configuration:

{
  "reported": {
    "dev": {
      "v": {
        "band": 3,
        "nw": "NB-IoT GPS",
        "iccid": "89450421180216254864",
        "modV": "mfw_nrf9160_1.0.1",
        "brdV": "nrf9160_pca10090",
        "appV": "v0.31.0"
      },
      "ts": 1573730967322
    },
    "roam": {
      "v": {
        "rsrp": 61,
        "area": 3305,
        "mccmnc": 24202,
        "cell": 34237203,
        "ip": "10.81.186.121"
      },
      "ts": 1573730967322
    },
    "bat": {
      "v": 5063,
      "ts": 1573731680594
    }
  }
}

This should be done nevertheless, since different firmware version might have different default values and it would be good to know what the device has as defaults.

coderbyheart commented 4 years ago

@simensrostad How was this fixed?

simensrostad commented 4 years ago

At some point the function that publishes the device configurations was added to the routine that is executed upon a CONNACK. Before that this function was only executed upon received data from AWS. So in the case of not receiving a desired config(empty shadow) the device would not send its config. I recently tested this with an empty shadow and observed the expected behaviour and closed the issue. I simply forgot to close the issue with an explaining commit message.