Channel report is corrupted while transferred from zuno to controller

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
knst08
Posts: 28
Joined: 15 Oct 2017 20:14

Channel report is corrupted while transferred from zuno to controller

Post by knst08 »

I have ds18b20 connected to z-uno and sketch that reports temperature each 30s. Temperature rounded to have one fractional digit (21,86 is reported as 21.9). CRC from ds18b20 is checked and if does not match value is not reported.

z-uno is connected to fibaro hc2. Occasionally hc2 gets wrong values e.g. 0,34 while temperature is about 21 degree.
sketch can not produce value 0,34 event if it measures it will report 0,3. It happens 1-2 times per day.

I've connected z-uno to usb, logged each getter call to serial and stored the full log to file (redirected output from serial to file).
In log file there is correct value 2080 for report that is seen by HC2 as v

chart from hc2:
Image

log for the same period

Code: Select all

        Line 129357: Thu Apr 12 02:33:53 MSK 2018 : getterHeaterLowTemperature 2090
	Line 129425: Thu Apr 12 02:34:23 MSK 2018 : getterHeaterLowTemperature 2090
	Line 129493: Thu Apr 12 02:34:53 MSK 2018 : getterHeaterLowTemperature 2080
	Line 129561: Thu Apr 12 02:35:23 MSK 2018 : getterHeaterLowTemperature 2080
	Line 129629: Thu Apr 12 02:35:54 MSK 2018 : getterHeaterLowTemperature 2080
	Line 129697: Thu Apr 12 02:36:24 MSK 2018 : getterHeaterLowTemperature 2080
	Line 129765: Thu Apr 12 02:36:54 MSK 2018 : getterHeaterLowTemperature 2080
	Line 129766: Thu Apr 12 02:36:54 MSK 2018 : getterHeaterLowTemperature 2080
	Line 129767: Thu Apr 12 02:36:54 MSK 2018 : getterHeaterLowTemperature 2080
	Line 129772: Thu Apr 12 02:36:54 MSK 2018 : getterHeaterLowTemperature 2080
	Line 129842: Thu Apr 12 02:37:25 MSK 2018 : getterHeaterLowTemperature 2080
	Line 129910: Thu Apr 12 02:37:55 MSK 2018 : getterHeaterLowTemperature 2080
	Line 129978: Thu Apr 12 02:38:25 MSK 2018 : getterHeaterLowTemperature 2080
	Line 130046: Thu Apr 12 02:38:56 MSK 2018 : getterHeaterLowTemperature 2090
	Line 130114: Thu Apr 12 02:39:26 MSK 2018 : getterHeaterLowTemperature 2090
	Line 130182: Thu Apr 12 02:39:56 MSK 2018 : getterHeaterLowTemperature 2090
	Line 130250: Thu Apr 12 02:40:27 MSK 2018 : getterHeaterLowTemperature 2090
	Line 130318: Thu Apr 12 02:40:57 MSK 2018 : getterHeaterLowTemperature 2090
	Line 130386: Thu Apr 12 02:41:27 MSK 2018 : getterHeaterLowTemperature 2090
	Line 130454: Thu Apr 12 02:41:58 MSK 2018 : getterHeaterLowTemperature 2090
	Line 130522: Thu Apr 12 02:42:28 MSK 2018 : getterHeaterLowTemperature 2090
	Line 130590: Thu Apr 12 02:42:58 MSK 2018 : getterHeaterLowTemperature 2090
	Line 130658: Thu Apr 12 02:43:28 MSK 2018 : getterHeaterLowTemperature 2090
	Line 130726: Thu Apr 12 02:43:59 MSK 2018 : getterHeaterLowTemperature 2090
	Line 130794: Thu Apr 12 02:44:29 MSK 2018 : getterHeaterLowTemperature 2090
	Line 130862: Thu Apr 12 02:44:59 MSK 2018 : getterHeaterLowTemperature 2080
	Line 130930: Thu Apr 12 02:45:30 MSK 2018 : getterHeaterLowTemperature 2080
getter code:

Code: Select all

word getterHeaterLowTemperature() {
#ifdef DEBUG_OUTPUT
    Serial.print("getterHeaterLowTemperature ");  
    Serial.println(heaterLowTemperature);  
#endif   
    return heaterLowTemperature ;
}
channel definition

Code: Select all

   //Heater low temperature
   ZUNO_SENSOR_MULTILEVEL(ZUNO_SENSOR_MULTILEVEL_TYPE_TEMPERATURE, 
                          SENSOR_MULTILEVEL_SCALE_CELSIUS, 
                          SENSOR_MULTILEVEL_SIZE_TWO_BYTES, 
                          SENSOR_MULTILEVEL_PRECISION_TWO_DECIMALS,
                          getterHeaterLowTemperature)
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

Re: Channel report is corrupted while transferred from zuno to controller

Post by PoltoS »

Might it be a CRC error? it happens (but rare) that packet get corrupted on its way. If corruption keeps CRC same, the receiver will accept such a packet.

Ways to solve it:
- use 5th gen controller (in this case CRC16 is used insteaf)
- use Security
knst08
Posts: 28
Joined: 15 Oct 2017 20:14

Re: Channel report is corrupted while transferred from zuno to controller

Post by knst08 »

Thx.

Changing controller is not an option for me. But security is a good point will try it.
knst08
Posts: 28
Joined: 15 Oct 2017 20:14

Re: Channel report is corrupted while transferred from zuno to controller

Post by knst08 »

Tried to enable security - s2 does not work for mw since it leaves only 6K for sketch while it is 21K size. With s0 enabled, z-uno just hangs after some time (may be stack issue , sketch is big enough)
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

Re: Channel report is corrupted while transferred from zuno to controller

Post by PoltoS »

A sketch of 21kB size might be a result of a non-optimal code. Please optimize your code and you will see how it will get smaller to about 5kB.

You can share the code (or part of it with user p0lyg0n1 or with me to get recommendations). Or if you are ok, publish it here.
Post Reply