Problem with connecting to IoT hub via MqttWs #504
Replies: 1 comment
-
Hi. You might already know some of the following facts, but I will state them as a baseline for thread readers and to avoid any gaps in mental models. Except in the case of a leaf device communicating to an EdgeHub parent device as if that were the IoT Hub, OSConfig does not use EdgeHub or other edge components for data communication with IoT Hub. OSConfig only uses the Identity Service portion of Edge to obtain a module identity token, from there it connects directly to IoT Hub using the protocol specified in /etc/osconfig/osconfig.json. The first step I would take is to ensure that your protocol preference is reflected there, in which case the value should be 2. It is possible that this is what you meant already when discussing "MqttWs" above, but I couldn't be certain. If the protocol choice from osconfig.json doesn't seem to be taking effect, my next steps would be to use the following steps to get a full set of detailed diagnostic artifacts (if the tenant is able): https://learn.microsoft.com/en-us/azure/osconfig/howto-troubleshoot#how-to-get-detailed-diagnostic-logs . |
Beta Was this translation helpful? Give feedback.
-
We are facing an issue with one of our clients VM. Unfortunately we don’t have direct access to VM to troubleshoot but we managed to receive some logs from them. So edgeAgent/Hub and all other modules are working flawlessly. Upstream protocol has been set to MqttWs and we receive data from modules. Twins also get updated regularly. However, osconfig module can’t communicate with IoT hub and update twin. See attached the logs. Also see below the screenshot of firewall logs we got from client. We can clearly see that the edge (particularly osconfig) tries to communicate with IoT hub via Mqtt 8883 port, which is strange. I also checked the osconfig settings and it states “MqttWs” for upstream protocol. So the first question is why osconfig can’t communicate with hub via MqttWs 443 when edgeAgent and edgeHub can. Also, seems like there is a fallback strategy in osconfig that switches to 8883 when for any reason it can’t go though 443. Would appreciate if you can shed some lights.
osconfig.txt
Beta Was this translation helpful? Give feedback.
All reactions