iot-edge-v1 icon indicating copy to clipboard operation
iot-edge-v1 copied to clipboard

[V2] Cannot see that there is any discrimination on the messages when having deployed the filterModule with the given routes in the publicity available documentation

Open HenrikBach1 opened this issue 6 years ago • 3 comments

Hi,

I'm following your receipes for developing, deploying and monitoring an IoT Hub Edge device given in:

  1. https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-csharp-module
  2. https://docs.microsoft.com/en-us/azure/iot-edge/how-to-vscode-develop-csharp-module

I cannot see that there is any discrimination on the messages when I've deployed the filterModule with the given routes in the examples.

My deployment.json (taken from the Azure IoT Hub portal) is:

{
  "moduleContent": {
    "$edgeAgent": {
      "properties.desired": {
        "schemaVersion": "1.0",
        "runtime": {
          "type": "docker",
          "settings": {
            "minDockerVersion": "v1.25",
            "loggingOptions": ""
          }
        },
        "systemModules": {
          "edgeAgent": {
            "type": "docker",
            "settings": {
              "image": "microsoft/azureiotedge-agent:1.0-preview",
              "createOptions": "{}"
            }
          },
          "edgeHub": {
            "type": "docker",
            "status": "running",
            "restartPolicy": "always",
            "settings": {
              "image": "microsoft/azureiotedge-hub:1.0-preview",
              "createOptions": "{}"
            }
          }
        },
        "modules": {
          "tempSensor": {
            "version": "1.0",
            "type": "docker",
            "status": "running",
            "restartPolicy": "always",
            "settings": {
              "image": "microsoft/azureiotedge-simulated-temperature-sensor:1.0-preview",
              "createOptions": "{}"
            }
          },
          "filterModule": {
            "version": "1.0",
            "type": "docker",
            "status": "running",
            "restartPolicy": "always",
            "settings": {
              "image": "hebhddauazureiotedgetest1.azurecr.io/filtermodule:latest",
              "createOptions": "{}"
            }
          }
        }
      }
    },
    "$edgeHub": {
      "properties.desired": {
        "schemaVersion": "1.0",
        "routes": {
          "sensorToFilter": "FROM /messages/modules/tempSensor/outputs/temperatureOutput INTO BrokeredEndpoint(\"/modules/filterModule/inputs/input1\")",
          "filterToIoTHub": "FROM /messages/modules/filterModule/outputs/output1 INTO $upstream"
        },
        "storeAndForwardConfiguration": {
          "timeToLiveSecs": 7200
        }
      }
    },
    "filterModule": {
      "properties.desired": {
        "TemperatureThreshold": 250
      }
    }
  }
}

I was only expecting messages with temparatures above 250, after the deployment of the filerModule. However, it seems that there is no discrimination neither in structure of messages or by messages that are filtered away:

...
====================
==== From: 'hebh-iot-edge-dell-test-2' at '2018-03-20T13:50:41.149Z' ====
{
  "machine": {
    "temperature": 140.26965849870774,
    "pressure": 14.587682613776831
  },
  "ambient": {
    "temperature": 20.691094990908677,
    "humidity": 24
  },
  "timeCreated": "2018-03-20T13:50:41.0864799Z"
}
---- application properties ----
{}
====================
...
==== From: 'hebh-iot-edge-dell-test-2' at '2018-03-20T14:02:26.556Z' ====
{
  "machine": {
    "temperature": 146.72764470310756,
    "pressure": 15.323402561113518
  },
  "ambient": {
    "temperature": 21.108797951884938,
    "humidity": 24
  },
  "timeCreated": "2018-03-20T14:02:26.462211Z"
}
---- application properties ----
{}
====================

The output of the edgeAgent log:

$ docker logs -f edgeAgent | less
...
2018-03-20 13:46:09.410 +00:00 [INF] - Plan execution started for deployment 15
2018-03-20 13:46:09.410 +00:00 [INF] - Executing command: "Command Group: (
  [docker pull hebhddauazureiotedgetest1.azurecr.io/filtermodule:latest]
  [docker create --name filterModule hebhddauazureiotedgetest1.azurecr.io/filtermodule:latest]
  [docker start filterModule]
)"
2018-03-20 13:46:09.410 +00:00 [INF] - Executing command: "docker pull hebhddauazureiotedgetest1.azurecr.io/filtermodule:latest"
2018-03-20 13:46:10.322 +00:00 [INF] - Executing command: "docker create --name filterModule hebhddauazureiotedgetest1.azurecr.io/filtermodule:latest"
2018-03-20 13:46:10.479 +00:00 [INF] - Executing command: "docker start filterModule"
2018-03-20 13:46:11.580 +00:00 [INF] - Plan execution ended for deployment 15
2018-03-20 13:46:11.767 +00:00 [INF] - Updated reported properties

What did I do wrong?

/Henrik

HenrikBach1 avatar Mar 20 '18 14:03 HenrikBach1

Hi @HenrikBach1 ,

Is it a completely new device or are you reusing from previous deployment/test?

The reason I'm asking is that these messages that you may be getting can be old messages that are on EventHub from when you had just the TemperatureSensor module.

Did you wait a little bit and checked if you are still receiving messages below 250?

Thanks,

Angelo Ribeiro.

aribeironovaes avatar Mar 20 '18 17:03 aribeironovaes

Hi @aribeironovaes ,

It is a completely new "iotedgectl setup" of an iot edge device on my Windows Dell computer. The device is setup within a newly created IoT Hub instance. Previous instances of any iot edge devices are "iotedgectl uninstalled". Furthermore, I notice that the messages time and dates are what within the expected timeframe, but not their information and behavior, due to the temperature threshold is set very high.

Yes, I waited in about 15 min's from "iotedgectl start" (Timestamps: 2018-03-20 13:46:09.410 and 2018-03-20T14:02:26.462). But, nothing as expected happened, as shown in above logs...

Thank you.

/Henrik

HenrikBach1 avatar Mar 21 '18 09:03 HenrikBach1

Thanks @HenrikBach1 ,

What does the logs on the filter module say?

Can you paste if here and also share (if possible) your filterModule code so we can take a look?

Also, if you check the logs on EdgeHub, did you see the routes property set? (On latest version we are printing the routes of Edge Hub.

Thanks,

Angelo Ribeiro.

aribeironovaes avatar Mar 21 '18 17:03 aribeironovaes