Page 1 of 1

How stable send UDP message?

Posted: 02 Jun 2015 14:01
by jiri.homolka22
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.

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);

Re: How stable send UDP message?

Posted: 02 Jun 2015 21:05
by pz1
I did a quick update to RC35 on my production system. My UDP (see: viewtopic.php?f=3424&t=20849) module seems to run fine after a reboot, or Z-Way restart. I do have to do some more testing before I can say this for sure.

Re: How stable send UDP message?

Posted: 03 Jun 2015 08:57
by jiri.homolka22
I also updated to version 2.0.1-RC35, but the problem continues. For the first time, everything turned on, but the second problem reappeared. So far, neither version worked. Can you think of anything I could still try?

Re: How stable send UDP message?

Posted: 03 Jun 2015 15:42
by pz1
Don't see anything wrong in your script if I compare with the recipe. A few things that come to mind:
  • Did you register your scriptfile in file automation/.syscommands ?
    Be reminded that with every update of Z-Way, you have to check the .syscommands and edit if needed
  • What is the manufacturer and type of your dimmer?

Re: How stable send UDP message?

Posted: 03 Jun 2015 17:05
by jiri.homolka22
I have Fibaro Dimmer FGD211 ... It is possible that the error could be that udp accept messages through the Loxone and not through OpenRemote? I am trying to break in only the sending of raspberry B+. With a set .syscommands I did nothing .. could you tell me what should be the shape?

Thank you for your time
J.

Re: How stable send UDP message?

Posted: 03 Jun 2015 17:38
by pz1
I don't have any dimmers, so I can't test it for you. I think Fibaro Dimmer FGD211 should work.
I have no knowledge of Loxone. Is that a front end from where you do control the z-wave devices on your Pi? Afaik there is no flow-control in UDP. It is just a stream that is being sent whenever you move the slider.

Does your Z-way-server always automatically start after you connect the raspberry to its power supply?

(Sorry, I confused you with that syscommands thing. That was necessary for the old system where we did not yet have UDP sockets but used a bash script. Forget it.)

Re: How stable send UDP message?

Posted: 03 Jun 2015 18:21
by jiri.homolka22
I have Fibaro multisensory and Fibaro wall plug. Creating the JavaScript file is not a problem and even ZWave connected devices. Yes, the service-of-way server with desert after startup, but often does not start and you need to restart it.

Adding the script after the start RaZberry that two consecutive restarts from-way-server probability that RaZberry runs properly increased, but still often occur problems.

Re: How stable send UDP message?

Posted: 03 Jun 2015 18:22
by jiri.homolka22
Script after start RaspberryPi

Code: Select all

#!/bin/bash

clear

echo "Zastavovani sluzby z-way-server ......"
sleep 10
sudo service z-way-server stop
sleep 10

echo "Spousteni sluzby z-way-server ......"
sleep 10
sudo service z-way-server start
sleep 10