More sensors to ATT

Follow the steps in: Send temperature and humidity to All Things Talk

Add two more assets

  1. my pressure, integer
  2. my gps, object

In object go to the tab “advanced” and change it to:

{
 "type": "object",
 "properties": {
 "latitude": {
 "type": "number"
 },
 "longitude": {
 "type": "number"
 },
 "altitude": {
 "type": "number"
 },
 "timestamp": {
 "type": "number"
 }
 }
}

The “latitude” and “longitude” are required. “altitude” and “timestamp” are optional.
Save the asset settings.

 

Update “Data decoding”

{
  "sense": [
    {
      "asset": "my_temperature",
      "value": {
        "byte": 0,
        "bytelength": 2,
        "type": "integer",
        "calculation": "val / 100"
      }
    },
    {
      "asset": "my_humidity",
      "value": {
        "byte": 2,
        "bytelength": 2,
        "type": "integer",
        "calculation": "val / 100"
      }
    },
    {
      "asset": "my_pressure",
      "value": {
        "byte": 4,
        "bytelength": 2,
        "type": "integer"
      }
    },
    {
      "asset": "my_gps",
      "value": {
        "latitude": {
          "byte": 6,
          "bytelength": 4,
          "type": "integer",
          "calculation": "val / 100000"
        },
        "longitude": {
          "byte": 10,
          "bytelength": 4,
          "type": "integer",
          "calculation": "val / 100000"
        }
      }
    }
  ]
}

Open  the example sketch “nbIOT_Shield_AllThingTalk”
Arduino IDE → File → Examples → Sodaq_nbIOT → nbIOT_Shield_AllThingTalk

Upload the sketch to your board, when you have a valid GPS position or the timeout of two minutes is passed the values are send.

All 4 values should look like:

Pinboard

The pinboard is graphical representation of your data.