Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom module twin desired values get mixed #7374

Closed
tervoju opened this issue Sep 24, 2024 · 1 comment
Closed

custom module twin desired values get mixed #7374

tervoju opened this issue Sep 24, 2024 · 1 comment

Comments

@tervoju
Copy link

tervoju commented Sep 24, 2024

I have custom module implemented with python. trying to use module twin desired properties from azure portal. Somehow module twin desired properties got mixed. I put simply this

 "desired": {
                "values": {
                    "value1": "1",
                    "value2": "2",
                    "value3": "3"
                }
            },...

somehow it got this and I cannot fix it:

  "desired": {
        "$metadata": {
            "$lastUpdated": "2024-09-24T05:46:21.1086112Z",
            "$lastUpdatedVersion": 10,
            "desired": {
                "$lastUpdated": "2024-09-23T13:55:29.6675232Z",
                "$lastUpdatedVersion": 2,
                "values": {
                    "$lastUpdated": "2024-09-23T13:55:29.6675232Z",
                    "$lastUpdatedVersion": 2,
                    "value1": {
                        "$lastUpdated": "2024-09-23T13:55:29.6675232Z",
                        "$lastUpdatedVersion": 2
                    },
                    "value2": {
                        "$lastUpdated": "2024-09-23T13:55:29.6675232Z",
                        "$lastUpdatedVersion": 2
                    },
                    "value3": {
                        "$lastUpdated": "2024-09-23T13:55:29.6675232Z",
                        "$lastUpdatedVersion": 2
                    }
                }
            },
            "value1": {
                "$lastUpdated": "2024-09-24T05:44:42.7953719Z",
                "$lastUpdatedVersion": 9
            },
            "value2": {
                "$lastUpdated": "2024-09-24T05:44:42.7953719Z",
                "$lastUpdatedVersion": 9
            },
            "value3": {
                "$lastUpdated": "2024-09-24T05:44:42.7953719Z",
                "$lastUpdatedVersion": 9
            },
            "values": {
                "$lastUpdated": "2024-09-24T05:46:21.1086112Z",
                "$lastUpdatedVersion": 10,
                "value1": {
                    "$lastUpdated": "2024-09-24T05:46:21.1086112Z",
                    "$lastUpdatedVersion": 10
                },
                "value2": {
                    "$lastUpdated": "2024-09-24T05:46:21.1086112Z",
                    "$lastUpdatedVersion": 10
                },
                "value3": {
                    "$lastUpdated": "2024-09-24T05:46:21.1086112Z",
                    "$lastUpdatedVersion": 10
                }
            }
        },
        "$version": 10,
        "desired": {
            "values": {
                "value1": "1",
                "value2": "2",
                "value3": "3"
            }
        },
        "value1": "1",
        "value2": "2",
        "value3": "3",
        "values": {
            "value1": "1",
            "value2": "2",
            "value3": "3"
        }
    },

Expected Behavior

Tell us what should happen: simple twin values are there and not multiple times.

Current Behavior

Tell us what happens instead of the expected behavior: values are there multiple times and I cannot fix it

Steps to Reproduce

Provide a detailed set of steps to reproduce the bug.

  1. create custom module
  2. fiddle the module twin values in the portal
  3. desired properties got mixed
  4. cannot fix the values anymore

Context (Environment)

Output of iotedge check

not relevant - this portal issue


### Device Information
not relevant


@ryanwinter
Copy link

hi @tervoju,

To remove properties you don't want, you can set them to null as outlined in the docs: https://learn.microsoft.com/azure/iot-hub/iot-hub-devguide-device-twins#back-end-operations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants