tim-hellhake / azure-iot-bridge

Mozilla Public License 2.0
5 stars 1 forks source link

Addon issues with the latest gateway build #12

Open jcherrabi opened 3 years ago

jcherrabi commented 3 years ago

Hello Tim, i just cloned the new gateway and tried to add the Azure addon which was added fine but when i went to it's config, nothing showed up, just a blue page with no inputs.. it seems as if the new gateway is no longer compatible with the addon manifest or something..

i'm running Webthingio gateway source version 1.1.0

cheers, Jay

jcherrabi commented 2 years ago

i'm still having this issue with the latest build of the gateway from Master branch... the config page of the Azure IoT addon shows nothing... image

shows this: image

and the log shows this:

image

i would appreciate a fix...

gateway version: image

jcherrabi commented 2 years ago

i tracked the issue to this part of the manifest.json: "devices": { "type": "object", "patternProperties": { ".*": { "type": "object", "required": [ "primaryKey" ], "properties": { "primaryKey": { "type": "string" } } } } }

ben-digitalhive commented 2 years ago

I am also having this same issue BUT I am on version 1.0.0

jcherrabi commented 2 years ago

i'm working on a new addon for Azure Iot Hub, i'll share it once its ready hopefully by end of this week.

cheers, Jay

ben-digitalhive commented 2 years ago

Hi Jay,

That sounds really great as I am very interested in getting this up and running.  Unfortunately I dont know enough to assist but if you have a patreon or something I would happily contribute to your development time.

I have looked at the MQTT integration for Azure but im still floundering a little bit.  My use case is to run WebThings with Zigbee2MQTT addon and then pump the data to Azure for visualisation and PowerBI reporting

Regards Ben

---- On Tue, 09 Nov 2021 09:36:40 +1300 jcherrabi @.***> wrote ----

i'm working on a new addon for Azure Iot Hub, i'll share it once its ready hopefully by end of this week.

cheers, Jay — You are receiving this because you commented. Reply to this email directly, https://github.com/tim-hellhake/azure-iot-bridge/issues/12#issuecomment-963552096, or https://github.com/notifications/unsubscribe-auth/AL6EPZ5MCFWRGD2DVRYWEETULAYFRANCNFSM5EIAN6AA. Triage notifications on the go with GitHub Mobile for https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

tim-hellhake commented 2 years ago

@jcherrabi Sorry, I already found a solution for this but forgot to release a new update. The config page was not able to display the device list. I changed the structure of the config object to fix the problem.

i'm working on a new addon for Azure Iot Hub

What features are you missing? I think it would be better to add them here since two addons for the Azure IoT Hub would be a bit confusing.

ben-digitalhive commented 2 years ago

Hi Tim,

I see version has updated on github but hasnt yet updated on Webthings in my gateway - Is there a way to force this or does it just take time?

Ben

---- On Sun, 14 Nov 2021 08:08:41 +1300 Tim Hellhake @.***> wrote ----

https://github.com/jcherrabi Sorry, I already found a solution for this but forgot to release a new update. The config page was not able to display the device list. I changed the structure of the config object to fix the problem. i'm working on a new addon for Azure Iot Hub

What features are you missing? I think it would be better to add them here since two addons for the Azure IoT Hub would be a bit confusing. — You are receiving this because you commented. Reply to this email directly, https://github.com/tim-hellhake/azure-iot-bridge/issues/12#issuecomment-968119939, or https://github.com/notifications/unsubscribe-auth/AL6EPZ3PECWUCH6ZGQTCVOTUL2ZTTANCNFSM5EIAN6AA. Triage notifications on the go with GitHub Mobile for https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

tim-hellhake commented 2 years ago

I see version has updated on github but hasnt yet updated on Webthings in my gateway - Is there a way to force this or does it just take time?

The built wasn't finished yet. I'll release the update in a few moments.

tim-hellhake commented 2 years ago

Looks like I need to start a new built. As soon as it's finished I release the new version.

jcherrabi commented 2 years ago

@jcherrabi Sorry, I already found a solution for this but forgot to release a new update. The config page was not able to display the device list. I changed the structure of the config object to fix the problem.

i'm working on a new addon for Azure Iot Hub

What features are you missing? I think it would be better to add them here since two addons for the Azure IoT Hub would be a bit confusing.

Hi Tim, thanks for the updates, much appreciate it, as for the reasons why i think we need a newer version:

  1. i didn't want you to have you to take on the Burdon and recreate the addon yourself as i know you have a lot to do.
  2. AzureIoTHub sdk changed in how it works, and your addon seems to break down after a while, the issue is related to how you are generating the primary keys for the devices yourself which is no longer recommended with the current IOTHUB SDK, as I've read somewhere in the doc once should avoid doing so and as Azure generates those during the device creation process.
  3. when using the addon for a while i get authorization failure for some devices where the keys do not match and requires a manual addon restart to wok which is related to the above and causes update failure on the device.
  4. also when someone removes a device or all devices from AzureIoT hub they do not get recreated unless the addon restarted. this should be handled better in the update process by catching the errors.
  5. creating this addon helped me better understand how to use the addons in webthings and a better understanding of AzureIoT hub :)
jcherrabi commented 2 years ago

Hello tim, i've published my version of the azureIothub here: https://github.com/jaychub/fot-azureiothub for your eyes, as this version uses a different approach.

  1. it creates the devices on Azure IoThub when they are actually connected in the gateways dashboard meaning when their state changes to connected which avoids adding disabled or off devices on the gateway. (which will be created automatically once online)
  2. this approach hooks to the connected state of the devices on the dashboard so if a device is removed from the gateway it will be automatically removed from AzureIoT hub. (to be added, should be simple enough)
  3. updating the changes of the things is better synchronized and avoids most of the current errors for example if someone deletes the devices in AzureIoThub this addon will recreates them automatically without having to restart the addon as in your current version.
  4. also fixed those warning generated by the gateway about using the old way of accessing the manifest.

i'm no expert at this but i would recommend you visit my code and update yours using this approach as it's much robust.

cheers and thank you for your help as always.

ben-digitalhive commented 2 years ago

Hello tim, i've published my version of the azureIothub here: https://github.com/jaychub/fot-azureiothub for your eyes, as this version uses a different approach.

  1. it creates the devices on Azure IoThub when they are actually connected in the gateways dashboard meaning when their state changes to connected which avoids adding disabled or off devices on the gateway. (which will be created automatically once online)
  2. this approach hooks to the connected state of the devices on the dashboard so if a device is removed from the gateway it will be automatically removed from AzureIoT hub. (to be added, should be simple enough)
  3. updating the changes of the things is better synchronized and avoids most of the current errors for example if someone deletes the devices in AzureIoThub this addon will recreates them automatically without having to restart the addon as in your current version.
  4. also fixed those warning generated by the gateway about using the old way of accessing the manifest.

i'm no expert at this but i would recommend you visit my code and update yours using this approach as it's much robust.

cheers and thank you for your help as always.

@jcherrabi - how would I go about installing your version? Is it published to the Gateway repository?