I am looking for a strategy/approach here and not committed to my attempted solution.
Developed code to capture NMEA data on a boat. I used a simulator to capture the data for development but the simulator was on my desktop. Works great. Now I need to put it on the local boat network to capture real-time boat data. Application is developed on an Oracle database. Port connect does not stay open so I do not receive TCP or UDP broadcast data.
The broadcaster is a product called PredictWind Data Hub. It broadcasts both TCP and UDP on ports 11101 and 11102 respectively. The workstation is connected to the hub using port 80.
I now realize accessing this data from a browser may be a challenge. Looking for guidance on best approach/strategy at coming up with a networked solution.
I have validated the data is getting broadcast with other apps that are not browser based.
The same code that works locally cannot open and maintain a connection on the network. I get the following error message in a google chrome console: WebSocket connection to 'wss://10.10.10.1/' failed; I then connect closed event.
I have tried numerous variations including protocal parameters on the Websocket call and different ports.
I AM NOT TIED TO THIS SOLUTION AND OPEN TO OTHER APPROACHED.
Here is my code: function WebSocketTest() {
if ("WebSocket" in window) {
alert("WebSocket is supported by your Browser!");
// Let us open a web socket
var ws = new WebSocket("wss://10.10.10.1:11102");
ws.onopen = function() {
// Web Socket is connected, send data using send()
ws.send("Message to send");
alert("Message is sent...");
};
ws.onmessage = function (evt) {
var received_msg = evt.data;
alert (evt.data);
apex.item( "P316_SOCKET_INPUT" ).setValue (evt.data);
};
ws.onclose = function() {
// websocket is closed.
alert("Connection is closed...");
};
} else {
// The browser doesnt support WebSocket
alert("WebSocket NOT supported by your Browser!");
};