{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/iotedge/issues/331","repository_url":"https://api.github.com/repos/Azure/iotedge","labels_url":"https://api.github.com/repos/Azure/iotedge/issues/331/labels{/name}","comments_url":"https://api.github.com/repos/Azure/iotedge/issues/331/comments","events_url":"https://api.github.com/repos/Azure/iotedge/issues/331/events","html_url":"https://github.com/Azure/iotedge/issues/331","id":362300740,"node_id":"MDU6SXNzdWUzNjIzMDA3NDA=","number":331,"title":"Sending Messages from Leaf or Downstream device not being handled by IoT Edge running at Transparent Gateway","user":{"login":"chrislangston","id":16180977,"node_id":"MDQ6VXNlcjE2MTgwOTc3","avatar_url":"https://avatars1.githubusercontent.com/u/16180977?v=4","gravatar_id":"","url":"https://api.github.com/users/chrislangston","html_url":"https://github.com/chrislangston","followers_url":"https://api.github.com/users/chrislangston/followers","following_url":"https://api.github.com/users/chrislangston/following{/other_user}","gists_url":"https://api.github.com/users/chrislangston/gists{/gist_id}","starred_url":"https://api.github.com/users/chrislangston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrislangston/subscriptions","organizations_url":"https://api.github.com/users/chrislangston/orgs","repos_url":"https://api.github.com/users/chrislangston/repos","events_url":"https://api.github.com/users/chrislangston/events{/privacy}","received_events_url":"https://api.github.com/users/chrislangston/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-09-20T18:05:03Z","updated_at":"2018-09-21T17:46:55Z","closed_at":null,"author_association":"NONE","body":"My Downstream Leaf device is using the NodeJS SDK to send Messages.  I'm unable to get the messages to flow through the IoT Edge Transparent Gateway.  If I Remove GatewayHostName from the connection string, the messages show up directly in IoT Hub.\r\n\r\n## Expected Behavior\r\nIoT Edge should receive message from downstream devices and route to IoT Hub and to other Modules running in IoT Edge that have properly routing rules configured.\r\n\r\nI expect my Function Module to be triggered along with a generic/debugging route that sends all messages directly to IoT Hub to be invoked.\r\n\r\n## Current Behavior\r\nThe IoT Edge is not receiving and/or processing messages from the Downstream Device.\r\n\r\n## Steps to Reproduce\r\nI have followed all the instruction for setting up a \"Downstream Device\" to send messages through IoT Edge running in Transparent Gateway.  \r\n\r\nThese are the instruction I've followed:\r\nhttps://docs.microsoft.com/en-us/azure/iot-edge/how-to-create-transparent-gateway-linux\r\n\r\n1.  IoT Edge Transparent Gateway VM is configured with all the certs properly setup, configured and verified.  I've been able to using the openssl tool as follows: \r\n\r\nopenssl s_client -connect {my-gateway-machine-name-dns-name}.centralus.cloudapp.azure.com:8883 -CAfile /certs/certs/azure-iot-test-only.root.ca.cert.pem -showcerts\r\n\r\n2.  Downstream device running on Linux VM with Certs installed and verified.  My connection string is as follows:\r\n\r\nHostName={IoTHubName}.azure-devices.net;DeviceId=TC51_EdgeDownStreamDevice01;SharedAccessKey={My-Shared-Access-Key};GatewayHostName={my-gateway-machine-name-dns-name}.centralus.cloudapp.azure.com\r\n\r\na. I have verified I get a successful verification of the SSL cert using the openssl tool.\r\nb. I'm using the the following in my downstream device for my connection using the NodeJS SDK\r\n\r\nvar client = DeviceClient.fromConnectionString(connectionString, Mqtt);\r\n\r\nThese are the routing rules:\r\n\r\n\"$edgeHub\": {\r\n      \"properties.desired\": {\r\n        \"schemaVersion\": \"1.0\",\r\n        \"routes\": {\r\n          \"sensorToBatteryDataFunctionModule\": \"FROM /messages/modules/tempSensor/outputs/temperatureOutput INTO BrokeredEndpoint(\\\"/modules/BatteryDataFunctionModule/inputs/input1\\\")\",\r\n          \"debuggingRoute\": \"FROM /* WHERE NOT IS_DEFINED($connectionModuleId) INTO $upstream\",\r\n          \"downstreamBatterySensorToBatteryDataFunctionInput1\": \"FROM /* WHERE NOT IS_DEFINED($connectionModuleId) INTO BrokeredEndpoint(\\\"/modules/BatteryDataFunctionModule/inputs/input1\\\")\",\r\n          \"BatteryDataFunctionModuleToIoTHub\": \"FROM /messages/modules/BatteryDataFunctionModule/outputs/* INTO $upstream\",\r\n          \"MicrogatewayModuleToIoTHub\": \"FROM /messages/modules/MicrogatewayModule/outputs/* INTO $upstream\"\r\n        },\r\n        \"storeAndForwardConfiguration\": {\r\n          \"timeToLiveSecs\": 7200\r\n        }\r\n      }\r\n    },\r\n\r\n3.  In IoT Hub I have the \"TC51_EdgeDownStreamDevice01\" Downstream Device registered.\r\n4.  In IoT Hub I have an IoTEdge Device configured.\r\n\r\n## Context (Environment)\r\n\r\n### Device (Host) Operating System\r\n(Ubuntu 16.04.5) for both VMs hosted in Azure.\r\n\r\n### Architecture\r\namd64\r\n\r\n### Container Operating System\r\nLinux containers\r\n\r\n### Runtime Versions\r\n\r\n#### iotedged\r\niotedge 1.0.1 (6e5e86dcf0c9a3732fc72a64d9ec9b0fcb2d6fad)\r\n\r\n#### Edge Agent\r\nmcr.microsoft.com/azureiotedge-agent:1.0\r\n\r\n#### Edge Hub\r\nmcr.microsoft.com/azureiotedge-hub:1.0\r\n\r\n#### Docker\r\nDocker version 18.06.0-dev, build daf021fe\r\n\r\n## Logs\r\nedgeHub logs:  https://gist.github.com/chrislangston/49536ce00b734435d526f4ce140112fe\r\n\r\n## Additional Information\r\nIf I use the sample out-of-the-box tempSensor Module running in IoT Edge, my \"BatteryDataFunctionModule\" is triggered.  However, my use case it to have 100's of Downstream devices sending their data through the IoT Edge device."},"comment":{"url":"https://api.github.com/repos/Azure/iotedge/issues/comments/423618979","html_url":"https://github.com/Azure/iotedge/issues/331#issuecomment-423618979","issue_url":"https://api.github.com/repos/Azure/iotedge/issues/331","id":423618979,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzYxODk3OQ==","user":{"login":"mrohera","id":22642794,"node_id":"MDQ6VXNlcjIyNjQyNzk0","avatar_url":"https://avatars2.githubusercontent.com/u/22642794?v=4","gravatar_id":"","url":"https://api.github.com/users/mrohera","html_url":"https://github.com/mrohera","followers_url":"https://api.github.com/users/mrohera/followers","following_url":"https://api.github.com/users/mrohera/following{/other_user}","gists_url":"https://api.github.com/users/mrohera/gists{/gist_id}","starred_url":"https://api.github.com/users/mrohera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrohera/subscriptions","organizations_url":"https://api.github.com/users/mrohera/orgs","repos_url":"https://api.github.com/users/mrohera/repos","events_url":"https://api.github.com/users/mrohera/events{/privacy}","received_events_url":"https://api.github.com/users/mrohera/received_events","type":"User","site_admin":false},"created_at":"2018-09-21T17:46:55Z","updated_at":"2018-09-21T17:46:55Z","author_association":"MEMBER","body":"@myagley you are correct the azure-iot-test-only.root.ca.cert.pem would need to be set as part of the client issue.\r\n\r\nIn the sample, this file is passed in via this variable\r\n// Path to the Edge \"owner\" root CA certificate\r\nvar edge_ca_cert_path = '[Path to Edge CA certificate]';\r\n\r\nAnother item needed is the the connection string:\r\n//  \"HostName=<iothub_host_name>;DeviceId=<device_id>;SharedAccessKey=<device_key>;GatewayHostName=<edge device hostname>\"\r\nvar connectionString = '[Downstream device IoT Edge connection string]';\r\n\r\nIf these are set correctly, this works. \r\n\r\nThe only thing to watch out for is the system time on the downstream device and the Edge device as well. This is critical to note and can fail quite subtly. Certificates have a validity period. One would want to ensure that when a device connects to the Edge the certificates are valid."}}
{"actor":{"display_login":"mrohera"}}