I'm trying to connect a downstream device (not edge) to an IoT Edge gateway using the transparent gateway model. My gateway is an Azure virtual machine, Debian. I've installed Edge and tried to configure it. The VM is connecting to IoT Central (notice, not hub, but Central).
When following these instructions https://learn.microsoft.com/en-us/azure/iot-edge/how-to-connect-downstream-device?view=iotedge-2020-11 the command to test MQTT fails. This one specifically
openssl s_client -connect <vm-ip-address>:8883 -CAfile <CERTDIR>/certs/azure-iot-test-only.root.ca.cert.pem -showcerts
Response is:
connect: Connection refused
connect:errno=61
I get a connection refused. Why?
I have allowed port 8883 in Azure. I did not find any firewall on the VM, is there something I could check on that end?
I get this status info from iotedge
> sudo iotedge system status
System services:
aziot-edged Running
aziot-identityd Running
aziot-keyd Running
aziot-certd Running
aziot-tpmd Ready
Should I see IoT Hub running as well?
I'm struggling to find non bloated examples of valid manifests files for gateways, maybe I have not configured that properly. Please point me to any examples.
Edit: more output
> sudo iotedge list
NAME STATUS DESCRIPTION CONFIG
edgeAgent failed Failed (1) 44 seconds ago mcr.microsoft.com/azureiotedge-agent:1.2
Logs repeat this:
Apr 27 12:26:08 mygateway aziot-edged[11270]: 2022-04-27T12:26:08Z [INFO] - Checking edge runtime status
Apr 27 12:26:08 mygateway aziot-edged[11270]: 2022-04-27T12:26:08Z [INFO] - Edge runtime status is failed, starting module now...
Apr 27 12:26:08 mygateway aziot-edged[11270]: 2022-04-27T12:26:08Z [INFO] - Starting module edgeAgent...
Apr 27 12:26:08 mygateway aziot-edged[11270]: 2022-04-27T12:26:08Z [INFO] - Starting new listener for module edgeAgent
Apr 27 12:26:08 mygateway aziot-edged[11270]: 2022-04-27T12:26:08Z [INFO] - Listener edgeAgent already started, removing old listener
Apr 27 12:26:08 mygateway aziot-certd[11288]: 2022-04-27T12:26:08Z [INFO] - <-- GET /certificates/aziot-edged-ca?api-version=2020-09-01 {"host": "2f72756e2f617a696f742f63657274642e736f636b:0"}
Apr 27 12:26:08 mygateway aziot-certd[11288]: 2022-04-27T12:26:08Z [INFO] - --> 200 {"content-type": "application/json"}
Apr 27 12:26:08 mygateway aziot-edged[11270]: 2022-04-27T12:26:08Z [INFO] - Listening on unix:///var/lib/aziot/edged/mnt/edgeAgent.sock with 1 thread for workload API.
Apr 27 12:26:09 mygateway aziot-edged[11270]: 2022-04-27T12:26:09Z [INFO] - Successfully started module edgeAgent
There's also this coming from 'iotedge logs edgeAgent'.
2022-04-27 12:46:09 Starting Edge Agent
2022-04-27 12:46:09 Changing ownership of management socket: /var/run/iotedge/mgmt.sock
su: setuid: Operation not permitted