(03.01.2017, 11:26) pid=\2913' Wrote:Here's a short example for how it can work via WebSocket, the problem is that this example requires latest beta firmware and work won't on 2016.09.30.
Code:<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="http://192.168.1.9/apps/js/jquery.js.gz"></script>
<script src="http://192.168.1.9/apps/js/localbus.js.gz"></script>
<script src="http://192.168.1.9/scada/vis/busdecode.js.gz"></script>
</head>
<body>
<script>
$(function() {
// listen to all groupwrite telegrams
localbus.listen('groupwrite', function(event) {
console.log(event);
});
// listen to a single object
localbus.listen('object', '1/1/1', function(value) {
console.log(value);
});
localbus.init('http://192.168.1.9');
});
</script>
</body>
</html>
(28.12.2016, 12:29)ceyhanc Wrote: Can anyone share a Websocket example which is working with same HTTP port ?Can you explain which kind of data do you want to send over websocket?
I need to ask, when localbus.init runs;
1. Does websocket server runs at same ip/port with visualisation ?
2. when we try to listen 1 object; will server push to chaged data or actual data to client ?
3. can we listen multiple objects with [ localbus.listen('object', ] notation ?
We want to take some binary objects true/false values to our native Android/IOS app.
Our aims;
1. We use several alarm objects and get informations of them fastly (like TCP socket communication)
2. We want to server will push to alarm info to client.
3. We want to do all communications with one port. (All LM Visualisation and this information)
4. We dont want to use JSON/XML (It requires reconnect to server for getting informations every 5 sec.)
Thanks
Ceyhan