In nodejs using opcua.OPCUAClient how to connect to a Matrikon OPC Simulation server - node-opcua

I have used the code in https://github.com/node-opcua/node-opcua/blob/master/documentation/creating_a_client.md to create a opcclient to read from the sample_server. That worked OK. Now I want to connect to a Matrikon OPC simulation server. So in the node sample_client ,I changed the
var endpointUrl = "opc.tcp://" + require("os").hostname() + ":8080/Matrikon.OPC.Simulation.1";
In the MatrikonOPC Explorer, on the left tab I see
Localhost '\\compname'
Matrikon.OPC.Simulation.1
Group0
on clicking Group0 in the right pane, I have a tag Random.Int1 and the value is continuously changing. In the server Info pane,it says server stare as running.
When I run the node sample_client, it gives no output..it doesn't even give the
"cannot connect to endpoint"
error. It seems like it is stuck in the foll line
client.connect(endpointUrl,function (err) {
Would anybody know why and how I hve to construct the endpoint url.

It seems that the server your trying to connect to is an old OPC classic server (using the DCOM from Microsoft as a communication layer) and not an OPC.UA server (using the new unified architecture standard on TCP).
This is why Matrikon.OPC.Explorer can connect to it.
There is no easy way to connect OPC <=> OPC.UA directly as the two technologies are different unless you use a special bridging software.
see also Difference Between OPC UA and OPC DA? for more info about Classic OPC vs OPC.UA

Related

Connection failure Postgresql on AWS-RDS Instance in a private network from PowerBI Desktop & Service

I have an AWS RDS (PostgreSQL) that is inside a private network - only accessible via a VPN and Bastian Host.
I am able to establish connection from PBI Desktop to "PostgreSQL-RDS Instance." By creating SSH tunneling from my Laptop (localhost) to Bastian Host using ODBC Driver. With this approach all the data is imported onto PBI desktop(import mode).
But our requirement is to establish connection through a direct query to refresh data real time and generate the Reports Dynamically which I am not able to.
I entered the database credentials into the Power BI desktop tool, and it not working correctly in the power bi desktop, getting a Timeout Error.
I must use direct query, I can't use import.
Any help is appreciated.
An exact error that you are getting would help get to the root cause of the issue. However, a few basic troubleshooting steps that I'd suggest are:
Ensure that you have a compatible version of the software installed on your machine such as the Npgsql-4.0.9. AT times the latest version of the software usually causes issues.
Ensure that you remove the semicolon at the end of the query.
Once you get the query running successfully on the desktop version, when you publish it to the web version, the visuals will not be able to connect to the database unless an on-premises data gateway is setup. To do so, more details on setting up a data gateway to automatically refresh the dataset for the power bi web version are here:
Refresh AWS RDS database from Power BI Web you are successfully able to query directly

Power BI connection problem with Postgresql

I'm using Power BI version 2.84 to connect to Postgresql server. In PBI desktop everything works fine, I can connect to the server, import and refresh data smoothly.
However when I publish it to PBI server, I can't refresh it anymore due to 'encrypted connection'. I have checked all of my connection settings and make sure they are not encrypted at all but the problem is still there.
Please let me know if you have any solution for this.
Cheers
I assume you are using direct query?
If you want to use direct query you will need to set up On-Premises data gateway.
on premise gateways
And then you should add gateway cluster in PowerBI web version gateway cluster:
Data gateway
I think everything is quite straightforward here.
But do you need direct query? If you are ok with refreshing your data a few times a day, you could set up a ODBC connection (when importing data, choose ODBC option not postgresql).
You would need to set up ODBC drivers, (Control panel -> Administrative tools -> Data sources) And create a new one (you should download Postgresql ODBC driver if you have none)
Then you also need to create On-Premises data gateway and set up refresh intervals.

Why are my REST methods not even reachable from Postman after moving the app with the REST methods to another machine?

With my app running locally (in Visual Studio), I can hit a REST method within it from Postman using either of these URLs:
http://shannon2.nrbq.ad:21609/api/inventory/sendXML/duckbill/platypus/poisonToe.xml
http://localhost:21609/api/inventory/sendXML/duckbill/platypus/poisonToe.xml
So localhost and the machine name both work.
But since I wasn't able to reach the method when calling it from a handheld device connected to my PC, I thought moving the server (REST) app to another machine on the network would clear up that problem.
However, not only can I not reach the REST method from the handheld, I can't even reach it from Postman! I get a "Could not get any response" response in Postman using any of the following URLs; I've tried, I think, every possible permutation:
https://martienda.nrbq.ad/api/inventory/sendXML/duckbill/platypus/test.xml
https://martienda.nrbq.ad:21609/api/inventory/sendXML/duckbill/platypus/test.xml
https://martienda.nrbq.ad/ccr.api/api/inventory/sendXML/duckbill/platypus/test.xml
https://martienda.nrbq.ad:21609/ccr.api/api/inventory/sendXML/duckbill/platypus/test.xml
https://199.96.39.231/api/inventory/sendXML/duckbill/platypus/test.xml
https:/199.96.39.231:21609/api/inventory/sendXML/duckbill/platypus/test.xml
https://199.96.39.231/ccr.api/api/inventory/sendXML/duckbill/platypus/test.xml
https:/199.96.39.231:21609/ccr.api/api/inventory/sendXML/duckbill/platypus/test.xml
...and none of them work (they all respond with the utterly demoralizing "Could not get any response"). What gives? What takes? Why all the hissing snakes? (apologies to Wm. Blake)
Note: If I use "http" instead of "https", I get a "404 - File not Found" error when using the IP Address (but still get "Could not get any response" when using the machine name).
Note: the REST app I can hit when the REST app is run locally is in CCR.API.Controllers and is decorated thus:
[Route("api/inventory/sendxml/{userId}/{pwd}/{filename}")]
Why has the server gone on strike?
Looking at URLs it seems you are hosting your application in either Visual Studio development web server or IIS express. (not necessarily true though). If its either dev server or IIS express then
With VS Dev server you will not be able to access urls/app from other machine but where it is hosted. See this link
If you are using IIS Express then you need to enable remote access. See this link
If you are hosting it in IIS then check firewall settings.

MySQL Workbench failed to connect

I can't figure this one out. I can't connect to a server using MySQL Workbench, I tried any kind of connection methods. The error message I get is
Failed to Connect to MySQL at AT 127.0.0.1:3306 with user root
Invalid for this platform protocol requested(MYSQL_PROTOCOL_SOCKET)
I ran into the same problem, in my case I originally created the connection with the "Local Socket/Pipe" option selected in the "Connection Method" drop down. Trying to switch back to "Standard (TCP/IP)" did not work and caused the error mentioned by OP. I had to delete the connection and start over by selection "Standard (TCP/IP)" from the start. The connection was successful after that.
To solve this problem you must check the "Others" field in Advanced tab
If you had the connection stored with a socket option you will find a "socket=." (or anything similar)
Delete it
e.g. http://prntscr.com/k63pua
This is a very unusal error message which I haven't seen before, especially on Windows. It has probably to do with how the server is installed. As a newbie it would definitely be the best choice to use the Windows Installer for all required parts. This will install the server properly too.
By using xampp you are on your own to check whether a server is installed and running as a service, as well as the proper configuration. For troubleshooting watch my video on Youtube where I tried to explain most common pitfalls for beginners.
Note: you can open the connection without actually being connected. In that case MySQL Workbench allows to do all those things that don't require a valid server connection, e.g. log file viewing, config file editing, service start/stop etc. Use this to check your server's configuration. Make sure it accepts TCP/IP connections (there's also a short section in the video about this).
Update:
Downvoter, please add a comment why you think my answer is bad.
Re-reading the error message I got another idea: could it be that you used local socket/named pipe for the connection? If so try with normal TCP/IP.

Using Entity Framework with Informix

I've been trying for quite some time to use Entity Framework with our IBM Informix databases. Hours of searching has pointed me towards installing the IBM .NET Data Server Provider, which I have installed, however when I attempt to add a new Entity Model to my project I only have the Microsoft SQL Server Data Providers listed. Am I missing a step? Is this even possible?
I am not an expert on Windows or .NET; treat any comments I make with due caution.
Installing the .NET Data Server Provider is an important first step. You now have to make sure that you can use it to connect to the Informix databases you want to manipulate. There are several things you'll need to check here:
Is the server (meaning the Informix instance) configured to allow DRDA connections?
By default, it probably isn't.
If you're the DBSA (database system administrator), you'll need to check that you've enabled 'drsoctcp' connections on the system, and configured a server alias to use that connection.
If you're not the DBSA, you'll need to chat with your DBSA to get the relevant information.
Assuming that you have DRDA connectivity enabled at the server side, you then need to ensure you have an appropriately configured ... DSN? Your client code needs to be able to connect to the server.
There is no reason I'm aware of why it cannot be done. However, I don't know exactly how to guide you step-by-step through any of the above.
You might need to seek assistance from IBM Technical Support.
You would help everyone if you clarified which version of Informix (the DBMS) you have, along with the version information for the platform where it is running (whether Windows or Unix, and the o/s version information) - and which version of the Data Server Provider you are using (and which variant of Windows you are using it on).