open62541 Client is disconnect from OPC-UA Server - opc-ua

first thanks to read this question
I have some problem about open62541 disconnect issue
I checked that the connection is lost every same cycle.
cycle time is 12min 40sec.
I checked connect status from this code
UA_ReadResponse response = UA_Client_Service_read(client, request);
if (response.responseHeader.serviceResult != UA_STATUSCODE_GOOD)
{
return 0;
}
response.responseHeader.serviceResult isn't UA_STATUS_GOOD
response.responseHeader.serviceResult is UA_STATUS_GOOD before 12min 40sec
I added a temporary reconnection process and noticed that a message like the picture
below occurs every 12 min and 40 sec.
And i check OPC-UA Sever
I used to B&R PLC.
The OPC-UA server role is played by B & R PLC and the settings are as shown below.
I suspect that I have nothing to do with setting up and disconnecting from B & R.
I want to find a solution or suspected part of this problem.
Please provide any additional information or estimates that may be needed for review.
Thanks

I solve this problem myself
I tested other open62541 version.
It is work. Just changed open62541

Related

Problem using signalr for chat application flutter

I had made a whole chat application using signalr as a socket with the online and offline facility. I am facing a few problems,
Signalr connection is always time out after some time, to overcome that I had condition if hubconnection is not connected then create new hubconnection (onResume app), but still it get hubconnection._callback got increased when sending message and not moving to server side socket. Again need to refresh whole app.
Can someone tell me whether this is problem because there are lot of operations going on and so signalr loses its connection as flutter is single thread and it cannot handle much? or should I use Isolate or inherit widget.
Summary problem:
I cannot send message in chat after sometime. It stores all message in hubconnection._callback and not going for server.
Is anything better solution to keep alive in both Android+iOS.
I had used https://pub.dev/packages/signalr_netcore package.
Please do not mention about firebase.
Any other logic suggestion is appreciable.
Thank you.
I've been using a different package, https://pub.dev/packages/signalr_core, which works fine without any particular issues what I have observed at the moment.
I'm only running about 10 listeners simultaneously, not sure if that is more or less than you. In the package I'm running you can establish connection with automatic reconnect. It looks like this:
HubConnectionBuilder().withAutomaticReconnect().withUrl(....)
It seems like your package have the same functionality... Have you tried that?

Rule to send mail when device (thing) is disconnected from AWS IoT

I am working on an IoT based project, where I get data from raspberryPi and send it to AWS IoT cloud.
I have created a couple of rules to save data in DynamoDB and send emails on certain conditions. But I am struggling with how to send an email if the device gets DISCONNECTED.
Basically I was wondering if there is any way to get the eventType: disconnected
Screenshot and perform an action upon this event.
Any kind of help would be greatly appreciated.
Thank you !
I found the solution, basically you have to create a rule that gets executed when the disconnected lifecycle event is triggered.
In my case its like this
For more reference you can follow this link:
http://docs.aws.amazon.com/iot/latest/developerguide/life-cycle-events.html
You need to make a rule that periodically attempts to connect with your device and, in the instance of a failure, sends you an email. Your device is not going to send a message as it disconnects because that would require it to know in advance that it was going to disconnect.
Pseudo code:
Run every x amount of time:
if connectionTest == false
sendEmail()
To clarify - you will not get an event type "disconnected" because if your device is disconnected it will not be able to return an event object. You will instead get an error which you will have to catch.

Bonjour Avahi daemon TXTRecord

I try to use txt-records to share information between multiple devices. Therefore I am using bonjour/avahi. The server-side works fine as wireshark proofs. Information is added to the txt-record and sent out using MDNS.
The problem occurs on the client side, where the daemon/service does not seem to get the information change all the time. It is stuck with information that is already outdated and does not automatically update it when I try to resolve the service again.
On the client side I am using DNSServiceResolve in combination with a callback function where I call TXTRecordContainsKey and TXTRecordGetValuePtr to make sure the data is available before use. This all works fine except that, as already mentioned, the information is not always updated.
Am I missing something, or are there any additional API-function calls that I can use to force the daemon to update its record except DNSServiceResolve?
Thank you in advance.
Solved, always make sure you deaktivate your firewall when dealing with such strange problems...
This completely solved my issue.

Silly WebSphere MQ questions

I have two very basic questions on WebSphere MQ - given that I had been kind of administrating it for past few months I tend to think that these are silly questions
Is there a way to "deactivate" a
queue ? (for example through a
runmqsc command or through the
explorer interface) - I think not. I
think what I can do is just delete
it.
What will happen if I create a
remote queue definition if the real
remote queue is not in place? Will
it cause any issues on the queue
manager? - I think not. I think all
I will have are error messages in
the logs.
Please let me know your thoughts.
Thanks!
1 Is there a way to "deactivate" a
queue?
Yes. You can change the queue attributes like so:
ALTER Q(QUEUE_NAME) PUT(DISABLED) GET(DISABLED)
Any connected applications will receive a return code on the next API call telling them that the queue is no longer available for PUT/GET. If these are well-behaved programs they will then report the error and either end or go into a retry loop.
2 What will happen if I create a
remote queue definition if the real
remote queue is not in place?
The QRemote definition will resolve to a transmit queue. If the message can successfully be placed there your application will receive a return code of zero. (Any unsuccessful PUT will be due to hitting MAXDEPTH or other local problem not connected to the fact that the remote definition does not exist.)
The problem will be visible when the channel tries to deliver the message. If the remote QMgr has a Dead Letter Queue, the message will go there. If not, it will be backed out onto the local XMitQ and the channel will stop.

Reconnect logic with connectivity notifications

Say I have an application that wants a persistent connection to a server. How do I implement connection/re-connection logic so that I'm not wasting resources (power/bandwidth) and I have fast reconnect time when connectivity appears/improves? If I only use connectivity notifications, I can get stuck on problems not related to the local network.
Bonus if you could show me the C# version.
­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
This is a very "huge" question. I can say that we use an O/R Mapper and each "query" to the database needs an object called PersistenceBroker. This class is in charge of all the DB Stuff related to connecting, authenticating etc.
We've written a PersistenceBrokerFactory.GetCurrentBroker() which returns the "working" broker. If the DB suddenly fails (for whatever reason), the CONN object will "timeout()" after 30secs (or whatever you define). If that happens, we show the user that he/she is offline and display a reconnect button.
On the other hand, to provide a visual indication that the user has connectivity, we have a thread running in the background, that checks for Internet connectivity every 15 seconds. We do 1 ping to google.com. ;) If that fails, we assume Internet is somehow broken, and we update a status bar.
I could show you all that code for the network health monitor if you wanted. I took some bits from google and other I made myself :)