0
votes

I am trying to create a 3 layered architecture which contains an azure IoT Hub, Edge Enable GateWay, and a downstream device. I have successfully created the IoT Hub and Edge-Enabled Gateway and Is able to send data to azure IoT Hub using custom routes. But when I try to connect my downstream device to IoT hub through my gateway using the connection string, I'm unable to connect and send telemetry to my IoT hub.Error which I get is:-

I have been following the following documentation:- https://docs.microsoft.com/en-us/azure/iot-edge/how-to-create-transparent-gateway-linux

1
Is the GateWay running in a Linux VM? If yes, you can refer to this topic. Maybe it is helpful for you.Michael Xu - MSFT
Yes, the gateway is running on a Linux VM. If I use the IP of the host to check the certificates then my gateway verifies the host device but when I use the gateway name to connect to gateway then I'm getting the above error. Also, I'm unable to send telemetry to the azure IoT hub when I use the host IP in the connection string.Arsh Sharma
I did the same and had issues using AMQP together with python sdk (v1). Switching to MQTT solved it for me.HansQ

1 Answers

1
votes

On Linux, make sure you install your CA Certificate generated from the link you pasted: You can install by running this: - sudo cp $CERTDIR/certs/azure-iot-test-only.root.ca.cert.pem /usr/local/share/ca-- - certificates/azure-iot-test-only.root.ca.cert.pem.crt - sudo update-ca-certificates

From your logs, it looks like you are having problems with the certificate.

Make sure you have installed CA Certificate on your device.

In order to test if your edge is good you can use C# Device SDK to test. (Please, use AMQP for this test, since a bug using MQTT was found and fixed, but didn't make the release yet).

How to enable debug logs on iotedged (security daemon)? -bash: sudo systemctl edit iotedge.service -Add: [Service] Environment=IOTEDGE_LOG=edgelet=debug -Restart security Daemon: sudo systemctl cat iotedge.service sudo systemctl daemon-reload sudo systemctl restart iotedge

How to enable debug logs on Modules (So you can get debug on edgeAgent and EdgeHub): On Agent: part of your yaml file configuration on iotedged, replace: env: {} by env: RuntimeLogLevel: debug