Giter Club home page Giter Club logo

Comments (28)

mregen avatar mregen commented on September 13, 2024

@harpreet-singh-bola Hi, please try the NetCoreConsoleClient sample first. It uses a minimal footprint to get connect to a OPC UA server without configuration files. The Xamarin project now also supports .Net Standard Library -->https://blog.xamarin.com/net-standard-library-support-for-xamarin/.
This is all brand new so we haven't been able to test with Xamarin yet, so please report any issues you may find. Thanks, Martin

from ua-.netstandard.

barnstee avatar barnstee commented on September 13, 2024

@solidrevolution is also working on an Android/Xamarin client and he promised to publish a Xamarin sample client here on GitHub. Perhaps collaborate with him?

from ua-.netstandard.

harpreet-singh-bola avatar harpreet-singh-bola commented on September 13, 2024

@mregen Thank you for the suggestions, I will try and let you know! Thanks again :)

@barnstee I would like to collaborate with him, how can I proceed? Can I contact him directly? Thanks.

HSB

from ua-.netstandard.

barnstee avatar barnstee commented on September 13, 2024

Sure.

from ua-.netstandard.

harpreet-singh-bola avatar harpreet-singh-bola commented on September 13, 2024

How can I contact him? There is no e-mail id exposed on his profile. I will wait until he reads this issue.

from ua-.netstandard.

barnstee avatar barnstee commented on September 13, 2024

He's on Twitter: https://twitter.com/solidrevolution

from ua-.netstandard.

recep-karabicak avatar recep-karabicak commented on September 13, 2024

Hey ^^

Yes we are working on a Xamarin client and managed to deploy to an Android device and connect to some devices. For ios we managed to make it work on simulator but we are having some issues on deploying to devices.

On the contribution part we are having some issues with company policies i am not sure whether we get permission but we will see. In the mean time i can help you if you(@harpreet-singh-bola) plan on starting an implementation. Give me an email address and i will send you a summary of what we did.

Best regards

from ua-.netstandard.

barnstee avatar barnstee commented on September 13, 2024

Sweet. Please also include me ([email protected]).

from ua-.netstandard.

harpreet-singh-bola avatar harpreet-singh-bola commented on September 13, 2024

Hello @solidrevolution ! Yes, I would love to have some point outs on how can I implement some basic functionalities first.

I am really thankful to you, my e-mail is: [email protected].

Regards,
HSB

from ua-.netstandard.

CarlCrol avatar CarlCrol commented on September 13, 2024

@solidrevolution hi would also like to get information on how you were able to connect to an OPC UA Server througj Xamarin.android.

[email protected]

from ua-.netstandard.

keskonriix avatar keskonriix commented on September 13, 2024

Hi I would like to get information too to use OPC UA client on Xamarin.Android

[email protected]

from ua-.netstandard.

danielearrighi avatar danielearrighi commented on September 13, 2024

Hi I would like to have more infos to create a OPC UA client on Xamarin.Android.
Something changed?
[email protected]
Thanks

from ua-.netstandard.

recep-karabicak avatar recep-karabicak commented on September 13, 2024

I tried to summarize the steps we took to make the Xamarin OPC UA client work. I hope it helps.

Convert default template to work as a standard library project

As of today even though the Xamarin platform supports .NET Standard library there is no project template built into the visual studio extension. With a few modifications the cross platform PCL template can be converted to target .NET Standard library. Below i am giving some references that explains the conversion:

https://blog.xamarin.com/net-standard-library-support-for-xamarin/
https://oren.codes/2016/07/09/using-xamarin-forms-with-net-standard/
https://xamarinhelp.com/dot-net-standard-pcl-xamarin-forms/
https://xamarinhelp.com/net-standard-xamarin-forms-gotchas/

But luckily there is no need to do the conversion manually an already converted and running hello world can be found in this repository - https://github.com/onovotny/SampleXamFormsWithNetStandard Just satisfy the requirements below and it should work.

Visual Studio 2015 with Update 3
.NET Core 1.0 for Visual Studio
The latest Xamarin in the stable channel (configured correctly with the Android sdk and stuff)

Add the necessary Opc.Ua dlls to the shared(portable) project

I think the standard library opc ua dlls are not available from nuget instead we downloaded the stack from github and built our own dlls. Since we are after a client application we need the following two dlls

Opc.Ua.Client.dll
Opc.Ua.Core.dll

They can be found under the following folders

UA-.NETStandardLibrary\Stack\Opc.Ua.Core\bin<Debug>\netstandard1.3
UA-.NETStandardLibrary\SampleApplications\SDK\Opc.Ua.Client\bin<Debug>\netstandard1.3

With normal Xamarin, one needs to add same references to all the project types but with standard this is not the case. Our current application references the opc dlls only on shared(portable) project

Satisfy dependencies for Opc.Ua

Opc.Ua itself depends on some other libraries and since we are not using nuget we should satisfy them manually. We added the following dependencies using nuget to the shared(portable) project

Microsoft.AspNetCore.Server.Kestrel
Microsoft.AspNetCore.Server.Kestrel.Https
Newtonsoft.Json

Write the code

At this point the application should be buildable and deployable without problems. Now comes the part where the actual opc ua code is written. We used the NetCoreConsoleClient and the samples from the non standard library(https://github.com/OPCFoundation/UA-.NET) implementation to come up with our code.

From this point onwards it is lots of debugging/trying to overcome network/firewall issues. We used https://www.kepware.com/products/kepserverex/ as a opc ua server until we read simple values. It helps to disable security options.

Another important point is to do opc related stuff in a background task since doing it in main ui thread causes problems.

from ua-.netstandard.

barnstee avatar barnstee commented on September 13, 2024

Thanks @solidrevolution, this is great!
A few comments from my side:

  1. You can use NuGet packages instead of having to find the DLLs for the OPC UA stack and SDK. See here for an example: https://github.com/Azure/iot-gateway-opc-ua/blob/master/src/Opc.Ua.Client.Module/project.json
  2. Don't turn off security! Or if you do, make sure you re-enable it again. I've seen too may examples of clients and servers with no secuirty because at some stage it was turned off for "easy debugging" but then never turned on again. If your client or server doesn't work with all security settings, this is a bug!
  3. The sampels from the old .Net stack are all ported to the .Net Standard stack and in the Samples folder, no need to go back and forth.

from ua-.netstandard.

johnn82 avatar johnn82 commented on September 13, 2024

Hi, I'm trying to use this library to run a simple test app on iOS with Xamarin.iOS. Does anyboady makes it work with Xamarin.iOS?

from ua-.netstandard.

barnstee avatar barnstee commented on September 13, 2024

We've decided to contribute a Xamarin client since there is a lot of interest for it. The reason why security doesn't work is because of a limitation of Mono, used in Xamarin. We're in discussions with the Xamarin team on how to resolve this.

from ua-.netstandard.

harpreet-singh-bola avatar harpreet-singh-bola commented on September 13, 2024

from ua-.netstandard.

KmanViel avatar KmanViel commented on September 13, 2024

Where can this client be found?

from ua-.netstandard.

barnstee avatar barnstee commented on September 13, 2024

It's not done yet, but when it is, it will be under "Samples".

from ua-.netstandard.

KmanViel avatar KmanViel commented on September 13, 2024

Please post here when it is ready. This would be extremely helpful. Any ideas on the timeline?

from ua-.netstandard.

philipperequile avatar philipperequile commented on September 13, 2024

Great!

from ua-.netstandard.

KmanViel avatar KmanViel commented on September 13, 2024

Any updates on this?

from ua-.netstandard.

KmanViel avatar KmanViel commented on September 13, 2024

I have Xamarin Forms code which works with UWP but does not work with Android. The code builds but the following error happens during debug.

08-21 12:02:31.645 D/Mono ( 6677): Assembly Loader probing location: 'System.Security.Principal.Windows'.
08-21 12:02:31.645 F/monodroid-assembly( 6677): Could not load assembly 'System.Security.Principal.Windows' during startup registration.
08-21 12:02:31.645 F/monodroid-assembly( 6677): This might be due to an invalid debug installation.
08-21 12:02:31.645 F/monodroid-assembly( 6677): A common cause is to 'adb install' the app directly instead of doing from the IDE.

Any ideas?

from ua-.netstandard.

KmanViel avatar KmanViel commented on September 13, 2024

It does work in Release but not in Debug. The good news is that the program does read from and write to a UA Server using Android!

from ua-.netstandard.

KmanViel avatar KmanViel commented on September 13, 2024

To be clear I am still wanting to know if anyone has ideas about why Debug does not work.

from ua-.netstandard.

mregen avatar mregen commented on September 13, 2024

Blocked by Issue #216

from ua-.netstandard.

mregen avatar mregen commented on September 13, 2024

#337 is on the way...

from ua-.netstandard.

mregen avatar mregen commented on September 13, 2024

Please test the new UA Xamarin Client project and provide feedback or even better improvements!
Cheers!

from ua-.netstandard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.