Azure / azure-iot-explorer

Cross-platform UI for interacting with devices attached to Azure IoT Hub. This tool is meant for learning and testing, not for production environment.
MIT License
223 stars 74 forks source link

Telemetry Interval less than 1 second #562

Closed sergiosolorzano closed 1 year ago

sergiosolorzano commented 2 years ago

We track movement from mxchip iot device and telem interval<1s in ms would be instrumental to capture tracking.

Describe the solution you'd like Telemetry Interval less than 1 second in ms

Describe alternatives you've considered hard code mxchip firmware but need to rebuild each time to alter and we have device twin and DT mistmach

YingXue commented 1 year ago

This is not a common request, and we suggest following the instructions below and build your own app:

  1. Run the app locally or event build it yourself https://github.com/Azure/azure-iot-explorer#run-it-locally-and-build-it-yourself
  2. Change line 39's LOADING_LOCK from 8000 to below 1000 (1000 ms which is 1 second) to suit your use case https://github.com/Azure/azure-iot-explorer/blob/main/src/app/devices/deviceEvents/components/deviceEvents.tsx#L39
YingXue commented 1 year ago

We made a new release with updated Event Hub SDK: https://github.com/Azure/azure-iot-explorer/releases/tag/v0.15.2

sergiosolorzano commented 1 year ago

Hi @YingXue thanks a bunch for the great work in getting a new release out !

This 0.15.2 release seems to address this post for which our team is really grateful. However when trying it how can I enter telemetry interval <1 second in the UI? I tried 0.1 but "." is not permitted so I can only enter 01 or 1 second.

question
YingXue commented 1 year ago

Hi @sergiosolorzano It looks like you've modeled the schema of this command body to be an integer, which is why 0.1 is not allowed. If you change integer to double or float (please refer to the dtdl document for more details), the tool should allow decimals to be entered.

sergiosolorzano commented 1 year ago

Hi @YingXue thank you for your guidance. I have validated (DTDL tool) and updated the model (for both device and digital twin just in case they're connected) (I didn't change the path to the local model repo path) to telemetryInterval double type, restarted the explorer but issue persists and can't use ".":

explorer explorer2

I then tested this with float type , restarted explorer but the problem persists:

explorer3 explorer4
YingXue commented 1 year ago

Hi @sergiosolorzano do you mind open a new issue separately for the pnp modeling part? It will help prevent the issue being lost in track.

YingXue commented 1 year ago

@sergiosolorzano Also, I wanted to let you know that there is workaround for this decimal issue. You can enter 01 in the textbox, and then add the decimal. Zero value is giving us a lot of headache in many dtdl related forms. We will need some time to get to the bottom of it judging there won't be much active development/support around plug and play for a while.

sergiosolorzano commented 1 year ago

Thank you for your notes @YingXue , I appreciate the challenges involved.

I just raised the issue as requested. From your last note may I please clarify this means we can set interval such as 01.2 means 1.2 seconds? Thank you for your help.

YingXue commented 1 year ago

@sergiosolorzano the only tricky case if for any value less than one. If you need to input 0.2, please enter 02 and add the dot in between. Any value greater than 1 should work as is. 1.2 can be entered fine.