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

AVNET model not compatible? #2

Open
stefan-hudelmaier opened this issue Aug 23, 2021 · 5 comments
Open

AVNET model not compatible? #2

stefan-hudelmaier opened this issue Aug 23, 2021 · 5 comments

Comments

@stefan-hudelmaier
Copy link

Hi Jon,

I just stumbled over your project. I think it's a great idea to use DTDL for data simulators!

I tried it using the ./DTDLModels/thermostat.json model. It worked fine. I then wanted to use https://raw.githubusercontent.com/Azure/iot-plugandplay-models/main/dtmi/avnet/mt3620starterkit-1.json model (for the Azure Sphere AVNET Device). Unfortunately, no telemetry data was generated (but no error message was output either).

The output just stops at:

dbug: IoT.Simulator.Services.DeviceSimulationService[0]
      08/23/2021 16:30:41::logType:c2dmessages::simulated-device::Device listening to cloud to device messages.

When I strip the mt3620starterkit-1.json to a bare minimum:

{
  "@id": "dtmi:avnet:mt3620Starterkit;1",
  "@type": "Interface",
  "displayName": "StarterKitOutOfBoxExample",
  "@context": "dtmi:dtdl:context;2",
  "description": "Implements the interface for the Avnet Azure Sphere Starter Kit Out of Box example",
  "contents": [
    {
      "@type": "Telemetry",
      "description": "WiFi Received Signal Strength",
      "displayName": "WiFi Received Signal Strength",
      "name": "rssi",
      "schema": "double"
    }]
}

It works and produces telemetry data. However, if the original value of the @type property is used in the minimal example above (i.e. ["Telemetry"] as an array), it does not work and shows the above behavior.

I guess this type notation is not supported in your simulator yet?

@jonmikeli
Copy link
Owner

Hi Stefan,

Thanks for your message. Mmmm......let me take some time to debug what you mention properly.
I will give you news quite soon ;).

@jonmikeli
Copy link
Owner

Hi Stefan,

Just pushed an evolution to take into account the notation with arrays (which is linked to semantics and units).
Details here.

The set of unit tests and non-regression tests are ok but I will add more tests in the upcoming days (for instance, using the DTDL you provided). I will keep you posted.

Additionally, I will check with Microsoft if there is a "best practice" in terms of notations and/or if we should use the "array" notation all the time.

Feel free to reach out or report any other issue/feedback.

@stefan-hudelmaier
Copy link
Author

Hi Jon,

I did a quick test with and without the array notation. Currently, the behavior seems to be as before: it works without the array and does not work with the array.

Looking forward to the next updates, thanks again for working on this.

From the examples that I looked at and the manufacturer-submitted models in the iot-plugandplay-models repo, it seems that the array notation is quite wide-spread.

@jonmikeli
Copy link
Owner

Hi @stefan-hudelmaier,

Sorry it took me some time to write you back.
Thank you for your answer.

There were actually many things involved in the issue after my last release. Telemetries with semantic and units were covered in the release of last week; the errors you encountered were due to other sources (commands with "rich" payloads (type object)).

The new version should solve all the mentioned issues.
New tests will be added (mainly to properties) but I already wanted to write you some updates.

@stefan-hudelmaier
Copy link
Author

Hi @jonmikeli ,

I just tested your new release and it worked like a charm! Thank you so much for your swift fixes and improvements!

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