Comments (28)
@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.
@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.
@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.
Sure.
from ua-.netstandard.
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.
He's on Twitter: https://twitter.com/solidrevolution
from ua-.netstandard.
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.
Sweet. Please also include me ([email protected]).
from ua-.netstandard.
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.
@solidrevolution hi would also like to get information on how you were able to connect to an OPC UA Server througj Xamarin.android.
from ua-.netstandard.
Hi I would like to get information too to use OPC UA client on Xamarin.Android
from ua-.netstandard.
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.
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.
Thanks @solidrevolution, this is great!
A few comments from my side:
- 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
- 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!
- 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.
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.
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.
from ua-.netstandard.
Where can this client be found?
from ua-.netstandard.
It's not done yet, but when it is, it will be under "Samples".
from ua-.netstandard.
Please post here when it is ready. This would be extremely helpful. Any ideas on the timeline?
from ua-.netstandard.
Great!
from ua-.netstandard.
Any updates on this?
from ua-.netstandard.
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.
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.
To be clear I am still wanting to know if anyone has ideas about why Debug does not work.
from ua-.netstandard.
Blocked by Issue #216
from ua-.netstandard.
#337 is on the way...
from ua-.netstandard.
Please test the new UA Xamarin Client project and provide feedback or even better improvements!
Cheers!
from ua-.netstandard.
Related Issues (20)
- Could not load Configuration file (Implementation as a Windows Service) HOT 1
- Programmatically creation of Macinery Nodeset on Server HOT 2
- <Reprovisioning after OPC UA Server Certificate Revocation> HOT 4
- NullReferenceException in XmlDecoder.ReadExpandedNodeId
- Private key of application certificate must be set to exportable HOT 2
- Object with OpcUaType_NullEventNotifier gives NullReferenceException in opc ua client HOT 1
- Too many messages of "UaPublisher - PublishNetworkMessage, WriterGroupId:{0}; success = {1}" on log file
- Client keeps disconnecting/reconnecting to broker if it runs as publisher and subscriber at the same time HOT 2
- CertificateIdentifier.Find returns null despite of the fact that a certificate exists HOT 2
- Session is not provided by "ClearChangeMasks" when a change is notified
- NullReferenceException after updating from 1.5.374.36 to 1.5.374.54 HOT 3
- A server can not be initialized with a private encodeable factory
- [ECC] If AddAppCertToTrustedStore flag is set to true not all application certificates are copied in the trusted store HOT 1
- BadRequestTimeout on CoreClientUtils.SelectEndpoint after Update of Library from 1.4.371.96 to 1.5.374.36 HOT 1
- Ensure ECC profiles use the new sequence number algorithm
- The constructor of the UA Client subscription which takes a template as input modifies the display name in an undesirable way.
- Exception "Failed to establish tcp listener sockets for Ipv4 and IPv6" after restarting server
- Dependencies between operation limits and other quotas may conflict, and this may result in a BadEncodingLimitsExceeded SRE
- PackageReference System.Security.Cryptography.Cng not required when targeting .NET 6+
- SubscriptionDiagnosticsData is not accessible through the current session. HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ua-.netstandard.