Module twin read without update

Athira Gopinath(UST,IN) 96 Reputation points
2022-08-04T04:55:47.607+00:00

Hi,
We have tried to test a custom(sensing) CModules based on the tutorial "Develop a C IoT Edge module using Linux containers "tutorial-c-module". Raspberry PI 4B arm32v7 is used as an environment for the testing purposes.
We are using azure iot sdk _c and edge version 1.1
Our goal is to sense the temperature and compare it with a predefined threshold. Predefined threshold can be fetched from the module twin. Using Module twin callback function, we are able to receive the module twin.
We observed that after the device restarts, the module twin receives as null instead of the threshold sets over there. Also it is noted that ,module twin is receiving a callback only when a desired property is updated.
Please help us to understand how can we get the module twin call backs during a device restart or start up when there is no update, as we don't have provision to save the read values, to reuse .

Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
548 questions
Azure IoT SDK
Azure IoT SDK
An Azure software development kit that facilitates building applications that connect to Azure IoT services.
209 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Sander van de Velde 29,856 Reputation points MVP
    2022-08-04T07:31:15.023+00:00

    Hello

    I observed this behavior too while using the C# SDK.

    When a module receives a twin update, a copy of the module twin is kept by the EdgeHub.

    So, you are able to request your 'last' module twin on startup, even if the device is not connected to the cloud anymore.

    As seen here, I actively read the module twin from the edgeHub:

    227928-image.png

    Can you try this using your SDK too?