Hello @Axiom Works ,
Symptom 1
Devices disconnect randomly, and you see 404104 DeviceConnectionClosedRemotely in IoT Hub resource logs.
Symptom 2:
Devices disconnect at a regular interval (every 65 minutes, for example) and you see 404104 DeviceConnectionClosedRemotely in IoT Hub resource logs. Sometimes, you also see 401003 IoTHubUnauthorized and a successful device connection event less than a minute later.
Cause 1
The SAS token used to connect to IoT Hub expired, which causes IoT Hub to disconnect the device. The connection is re-established when the token is refreshed by the device. For example, the SAS token expires every hour by default for C SDK, which can lead to regular disconnects.
Cause 2
The device lost underlying network connectivity longer than the MQTT keep-alive,
The device sent a TCP/IP-level reset but didn't send an application-level MQTT DISCONNECT.
The device side application crashed.
Cause 3
IoT Hub might be experiencing a transient issue.
Solution 1
See 401003 IoTHubUnauthorized solution 1
Solution 2
Make sure the device has good connectivity to IoT Hub by testing the connection. If the network is unreliable or intermittent, we don't recommend increasing the keep-alive value because it could result in detection (via Azure Monitor alerts, for example) taking longer.
Use the latest versions of the IoT SDKs.
Solution 3
See solutions to IoT Hub internal server errors.
For more information, please refer to this documentation 404104 DeviceConnectionClosedRemotely.
Please comment below to get more help on your query.