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

when azure iot device is disabled sometimes report properties twin to cloud will success #1193

Open
AiHaibara opened this issue Jun 28, 2023 · 3 comments
Labels
bug IoTSDK tracks all IoT SDK issues across the board

Comments

@AiHaibara
Copy link

AiHaibara commented Jun 28, 2023

Context

  • OS and version used: <Windows 11>
  • Node.js version: <18.10.0>
  • pnpm version: <8.4.0>
  • list of installed packages: < "azure-iot-device": "^1.18.2","azure-iot-device-amqp": "^1.14.2",>

Description of the issue

when i using api to disable a azure iot device, the azure portal show Enable connection to IoT Hub is disable, it can still report properties twin to cloud using amqpws
and I want to retry reconnect every 30s, if the device is enabled.
but before I enabled it, it will always trigger both the connected and disconnected event and sometimes report properties twin to cloud will success even after 5 minutes or restart program.
does the reported success is designed or issue?
if that how can i distinguish is disabled or not?

Usage

Enable connection to IoT Hub is disable
this.client?._transport.updateTwinReportedProperties every 30s

Result

the twin is success reported

@AiHaibara AiHaibara added the bug label Jun 28, 2023
@github-actions github-actions bot added the IoTSDK tracks all IoT SDK issues across the board label Jun 28, 2023
@AiHaibara
Copy link
Author

I got a work around now, each time after client open and before report, try to send a event message for any test connect, then report if disable it will not report success when every 30s.

@vishnureddy17
Copy link
Member

when i using api to disable a azure iot device, the azure portal show Enable connection to IoT Hub is disable, it can still report properties twin to cloud using amqpws

Which of the two is happening?

  1. you try to set a reported property, SDK indicates success, and the reported property IS reflected in the device twin on the service
  2. you try to set a reported property, SDK indicates success, and the reported property IS NOT reflected on the device twin on the service (silent failure on the SDK)

Or is it neither?

@AiHaibara
Copy link
Author

AiHaibara commented Jun 28, 2023

when i using api to disable a azure iot device, the azure portal show Enable connection to IoT Hub is disable, it can still report properties twin to cloud using amqpws

Which of the two is happening?

  1. you try to set a reported property, SDK indicates success, and the reported property IS reflected in the device twin on the service
  2. you try to set a reported property, SDK indicates success, and the reported property IS NOT reflected on the device twin on the service (silent failure on the SDK)

Or is it neither?

I tried this again.

  1. the reported property is reflected in the device twin on the service can be seen in azure portal.
    this maybe not each time will report success, many times retry or recreate the client sometimes will succeed.

    "status": "disabled",
    "statusUpdateTime": "2023-06-28T15:58:49.3568541Z",

    from $metadata
    "lastcommunicationLocal": {
    "$lastUpdated": "2023-06-28T16:08:29.5170912Z"
    },
    we can see the "$lastUpdated": "2023-06-28T16:08:29.5170912Z" is later than statusUpdateTime": "2023-06-28T15:58:49.3568541Z"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug IoTSDK tracks all IoT SDK issues across the board
Projects
None yet
Development

No branches or pull requests

2 participants