Open ikivela opened 1 year ago
@ikivela the usual reason for this sort of error message is that Azure IoT Hub device ids are case sensitive.
Double check DevceID "dragino1" in you IoT Hub
I also just noticed in the code this could occur if the Azure IoT Hub connection string "_azureIoTSettings.IoTHub.IoTHubConnectionString" was missing/invalid.
Will patch and test later this AM currently NZT (UTC+13)
@KiwiBryn
@ikivela
Ran code up in debugger, I'm caching the Azure IoT Hub DeviceClients and the failure is getting cached.
If you could look in the logging there should have been a failure the first time the LoRaWAN device uplinked. That will tell you what went wrong. In application Insights try searching
"no TTI Application settings configured" "no TTI API Key configured" "no TTI Webhook ID configured" "Application settings not configured" "Unknown DeviceID"
Most probably the last one.
I will have a think about to handle this better.
@KiwiBryn
@ikivela
Have a look at Stop-Caching-of-nulls-so-that-recovery-from-failure works branch.
I'm working the fix there need todo some more testing next couple of days then will release
@KiwiBryn
@ikivela
Fixes to uplink function checked in branch. Considering same approach for other functions
Will test some more. then merge back into master.
Also planning to do .NET 6 upgrade
Blog post at https://blog.devmobile.co.nz to follow about going back to application code (had been running reliably for ages and not touched it) after so long.
@KiwiBryn
@KiwiBryn thanks for debugging
Did you already push another branch to git? I can't see it.
Hi
Pushed now, had forgotten
@@.***>
From: Ilkka Kivelä @.> Sent: Tuesday, 15 November 2022 12:22 AM To: KiwiBryn/TTIV3AzureIoTConnector @.> Cc: Bryn Lewis @.>; Mention @.> Subject: Re: [KiwiBryn/TTIV3AzureIoTConnector] Problem with IoT Hub (Issue #1)
@KiwiBrynhttps://github.com/KiwiBryn thanks for debugging
Did you already push another branch to git? I can't see it.
— Reply to this email directly, view it on GitHubhttps://github.com/KiwiBryn/TTIV3AzureIoTConnector/issues/1#issuecomment-1313527567, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADB7JOLZQA7JMY5REKRE5FLWIIOD3ANCNFSM6AAAAAAR5S7IOE. You are receiving this because you were mentioned.Message ID: @.**@.>>
I found out that the problem is with this setting
Uplink-ApplicationID:scip IoTHub Application settings not configured
How this variable should be configured? There no explanation of it hackster guide.
@ikivela I'm assuming your settings file looks something like this
"AzureIoT": {
"DeviceClientCacheSlidingExpiration": "P2H30M",
"IoTHub": {
"IoTHubConnectionString": "HostName=tti...KQ=",
}
}
If "scip" is is your TTN application id try adding
"AzureIoT": {
"DeviceClientCacheSlidingExpiration": "P2H30M",
"IoTHub": {
"IoTHubConnectionString": "HostName=tti...KQ=",
"Applications": {
"scip":{
"DtdlModelId": ""
},
},
},
}
It was added so a DTDL model ID could be configured for an application. Will make more "optional"
@KiwiBryn
@KiwiBryn
Thanks for your help. The problem was that I didn't add variable DtdlModelId
. After adding, it worked fine.
I have to admit this was my first C# deployment ever, so it took a while figure out things...I.e. the lazycache was caching the device, and because of that I saw warnings only after restarting the function.
For wider adaptation, you could maybe write step-by-step guide. Anyway, thanks for publishing this repo!
@ikivela it's great you're up and running now.
The code was still evolving a bit after I wrote the Hackster post so not 100% upto date
I started writing a blog post but ran out of steam, should finish it
@KiwiBryn
@ikivela was just wondering how you were going?
Have done a .NET 6 upgrade so solution on an LTS version. This forced an upgrade to V4 functions runtime which I'm testing.
If my Uplink message processing is okay i'll do a merge then the .NET version updates
@KiwiBryn
I have problem getting started...I tried to follow your hackster.io guide, created azure functions, iot hub, but ttn webhook receives error code 422.
I followed the logs from TTIV3WebHookAzureIoTHubIntegration1. It seems that there is no error, but connection to IoT Hub is broken? How can debug this?