How stable send UDP message?
Posted: 02 Jun 2015 14:01
Dear Sirs,
I would like to ask you for advice, if it would be possible.
Let me please describe it:
It is all about the RaZberry system, version 2.0.1-rc33 and the module Z-wave.
My goal is to get the UDP communication working. After I have added an external java script file (see enclosure) through SmartHome GUI, the communication started and is working ever since.
The problem is though that whenever I restart or disconnect the RaspberryPi from charger, the UDP communication does not start. The only way to get the RaZberry to send UDP messages is to stop Z-wave-server and restart it again. If this does not help, restart the Z-wave-server once again and it should start working.
Please be so kind and advice, how to solve this? I need the external java script file launch to be reliable, without disconnections and other problems when restarted etc.
Thank you for your time and looking forward to your reply I remain with best regards,
J.
I would like to ask you for advice, if it would be possible.
Let me please describe it:
It is all about the RaZberry system, version 2.0.1-rc33 and the module Z-wave.
My goal is to get the UDP communication working. After I have added an external java script file (see enclosure) through SmartHome GUI, the communication started and is working ever since.
The problem is though that whenever I restart or disconnect the RaspberryPi from charger, the UDP communication does not start. The only way to get the RaZberry to send UDP messages is to stop Z-wave-server and restart it again. If this does not help, restart the Z-wave-server once again and it should start working.
Please be so kind and advice, how to solve this? I need the external java script file launch to be reliable, without disconnections and other problems when restarted etc.
Thank you for your time and looking forward to your reply I remain with best regards,
J.
Code: Select all
var sock = new sockets.udp();
sock.connect("192.168.10.140", 9091); //Adresa
this.bindFunc1 = function (zwayName) {
if (zwayName != "zway")
return; // you want to bind to default zway instance
var devices = global.ZWave[zwayName].zway.devices;
//Dimmer
devices[5].SwitchMultilevel.data.level.bind(function () {
var status = this.value;
sock.send("Dimmer=" + status);});
// End of your devices
};
global.controller.on("ZWave.register", this.bindFunc1);