... | ... | @@ -23,7 +23,7 @@ Because C# is similar to Java in some ways, the [BaSyx .NET SDK](https://github. |
|
|
|
|
|
I never used C#, so for me, it was a difficult task.
|
|
|
|
|
|
The documentation on this SDK is not great, but there are [examples](https://github.com/eclipse-basyx/basyx-dotnet-examples) I can use for my sake.
|
|
|
The documentation on this SDK is basically non-existent, but there are [examples](https://github.com/eclipse-basyx/basyx-dotnet-examples) I can use for my sake.
|
|
|
The example [HelloAssetAdministrationShell](https://github.com/eclipse-basyx/basyx-dotnet-examples/tree/main/HelloAssetAdministrationShell) was a good starting point.
|
|
|
|
|
|
Using it, I implemented the [GreenLight asset](https://gitlab.hrz.tu-chemnitz.de/vws-demo/vws-spielwiese/-/blob/main/basyx.lichterkette/src/main/java/de/olipar/basyx/lichterkette/GreenLight.java) from the existing project.
|
... | ... | @@ -34,17 +34,27 @@ One of the best things about this SDK is that the webserver which hosts the AAS |
|
|
You can test calls and update properties as you wish.
|
|
|
Even without any prior knowledge of C#, it took not long to implement the asset.
|
|
|
|
|
|
The hardest challenge was to register the asset and submodels to the registry.
|
|
|
No example used an external registry so no documentation was given.
|
|
|
The hardest challenge was to register the asset and submodels to the registry and the AAS server.
|
|
|
No example used an remote registry or server so no documentation was given.
|
|
|
|
|
|
After a lot of trial and error (mostly error), I found out that the dependencies of this project not only use packages from the [BaSyx .NET SDK](https://github.com/eclipse-basyx/basyx-dotnet-sdk) but also the [BaSyx .NET components](https://github.com/eclipse-basyx/basyx-dotnet-components) which is similar to the Java implementation.
|
|
|
In the components repository I found what I was looking for: `BaSyx.Registry.Client.Http`.
|
|
|
|
|
|
By only using this package the AAS service acquired a new method called `RegisterAssetAdministrationShell`.
|
|
|
But it has no way to unregister the AAS so I still needed the `RegistryHttpClient` nonetheless.
|
|
|
|
|
|
After that everything worked flawlessly.
|
|
|
As the existing project operates normally which blinking lights, the new implementation logs when the light turns on or off.
|
|
|
But it has no way to unregister the AAS so I still needed the `RegistryHttpClient` nonetheless which can do both.
|
|
|
|
|
|
Now I just needed to upload the AAS to the server.
|
|
|
Should be easy, another HTTP Client, another few calls, done, right?
|
|
|
Nope.
|
|
|
In C# the AAS server is called repository.
|
|
|
And while there is a repository server component there is no client to be found.
|
|
|
**After hours of reading source code I think it's just not possible/implemented in the framework.**
|
|
|
So I gave up on that.
|
|
|
(But first I opened an [issue](https://github.com/eclipse-basyx/basyx-dotnet-components/issues/6) so maybe we get an answer to that.)
|
|
|
|
|
|
The final project now has a beautiful frontend (by default exposed on port 4000) where the light can be turned on and off.
|
|
|
It will however not work together with the light controller as the light controller needs the AAS uploaded to the server to make calls.
|
|
|
The project is also fully dockerized.
|
|
|
|
|
|
## Additional hints
|
|
|
### Missing NuGet source
|
... | ... | |