Azure / iotedge-lorawan-starterkit

Sample implementation of LoRaWAN components to connect LoRaWAN antenna gateway running IoT Edge directly with Azure IoT.
https://azure.github.io/iotedge-lorawan-starterkit/2.2.1
Other
184 stars 61 forks source link

Device connection failed to LoRaWan Network due to "cloud proxy for client" issues #1806

Closed adcoly closed 1 year ago

adcoly commented 2 years ago

Expected Behavior

When our LNS accept a join request, the sensor should stop sending new join requests.

Current Behavior

We have 2 sensors in US 915 that does not manage to connect to our LoRaWan Network even if their Join requests are accepted. On the same LNS, we have other sensors that works well.

Context (Environment)

Device (Host) Operating System

Windows Server 2019 Datacenter (Eflow) Version: 17763.2458 Virtual Machine: VM Ware virtual machine

Architecture

x64

Container Operating System

Linux containers (Eflow)

LoRaWAN Module Version

LoRaWANNetworkSrvModule 2.0.0

Docker

19.03.15+azure

Logs

LNS logs:

"DevEUI" join request received
"DevEUI" Start processing HTTP request GET "FunctionAppAddress"?code="Code"&GateWayId="GatewayID"&DevEUI="DevEUI"&DevNonce="DevNonce"
"DevEUI" Sending HTTP request GET "FunctionAppAddress"?code="Code"&GateWayId="GatewayID"&DevEUI="DevEUI"&DevNonce="DevNonce"
"DevEUI" Received HTTP response headers after 295.0569ms - 200
"DevEUI" End processing HTTP request after 295.2037ms - 200
"DevEUI" the provided RX2DataRate is not valid
"DevEUI" join accepted
"DevEUI" join request received
"DevEUI" Start processing HTTP request GET "FunctionAppAddress"?code="Code"&GateWayId="GatewayID"&DevEUI="DevEUI"&DevNonce="DevNonce"
"DevEUI" Sending HTTP request GET "FunctionAppAddress"?code="Code"&GateWayId="GatewayID"&DevEUI="DevEUI"&DevNonce="DevNonce"
"DevEUI" Received HTTP response headers after 158.4397ms - 200
"DevEUI" End processing HTTP request after 158.6782ms - 200
"DevEUI" the provided RX2DataRate is not valid
"DevEUI" join accepted
"DevEUI" join request received
...(repeating previous lines)...

EdgeHub logs:

<3> 2022-08-03 15:00:38.002 +00:00 [ERR] - Error creating or updating the cloud proxy for client <DeviceID>
System.TimeoutException: Operation timed out
at Microsoft.Azure.Devices.Edge.Util.TaskEx.TimeoutAfter(Task task, TimeSpan timeout) in /home/vsts/work/1/s/edge-util/src/Microsoft.Azure.Devices.Edge.Util/TaskEx.cs:line 144
at Microsoft.Azure.Devices.Edge.Hub.CloudProxy.DeviceClientWrapper.OpenAsync() in /home/vsts/work/1/s/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.CloudProxy/DeviceClientWrapper.cs:line 59
at Microsoft.Azure.Devices.Edge.Hub.CloudProxy.ConnectivityAwareClient.<>c__DisplayClass30_0.<<InvokeFunc>b__0>d.MoveNext() in /home/vsts/work/1/s/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.CloudProxy/ConnectivityAwareClient.cs:line 195
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Azure.Devices.Edge.Hub.CloudProxy.ConnectivityAwareClient.InvokeFunc[T](Func`1 func, String operation, Boolean useForConnectivityCheck) in /home/vsts/work/1/s/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.CloudProxy/ConnectivityAwareClient.cs:line 188
at Microsoft.Azure.Devices.Edge.Hub.CloudProxy.ConnectivityAwareClient.InvokeFunc[T](Func`1 func, String operation, Boolean useForConnectivityCheck) in /home/vsts/work/1/s/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.CloudProxy/ConnectivityAwareClient.cs:line 188
at Microsoft.Azure.Devices.Edge.Hub.CloudProxy.ConnectivityAwareClient.OpenAsync() in /home/vsts/work/1/s/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.CloudProxy/ConnectivityAwareClient.cs:line 64
at Microsoft.Azure.Devices.Edge.Hub.CloudProxy.CloudConnection.ConnectToIoTHub(ITokenProvider newTokenProvider) in /home/vsts/work/1/s/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.CloudProxy/CloudConnection.cs:line 134
at Microsoft.Azure.Devices.Edge.Hub.CloudProxy.CloudConnection.CreateNewCloudProxyAsync(ITokenProvider newTokenProvider) in /home/vsts/work/1/s/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.CloudProxy/CloudConnection.cs:line 117
at Microsoft.Azure.Devices.Edge.Hub.CloudProxy.ClientTokenCloudConnection.UpdateTokenAsync(ITokenCredentials newTokenCredentials) in /home/vsts/work/1/s/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.CloudProxy/ClientTokenCloudConnection.cs:line 166
Mandur commented 2 years ago

Hello @Adcoly,

Thanks for submitting the issue, would it be possible to reproduce this error while setting the log_level of the LNS to debug? (LOG_LEVEL environment variable to 1)

Mandur commented 2 years ago

@adcoly I think this issue has been solved, could you please let us know if you are still experiencing it

adcoly commented 1 year ago

Yes sorry for the delay, we don't have this issue anymore on our US915 installation.