merbanan / rtl_433

Program to decode radio transmissions from devices on the ISM bands (and other frequencies)
GNU General Public License v2.0
6.14k stars 1.33k forks source link

bug in honeywell_cm921.c #2637

Closed aadvanstegeren closed 1 year ago

aadvanstegeren commented 1 year ago

hello,

I'm using honeywell evohome and I receive strange temperatures with 30C9 messages. I only receive distinct temperatures 10.28 , 12.85 , 15.42, 17.99 and 20.56. In hex those temperatures are 0x2828 , 0x3232, 0x3C3C, 0x4646 and 0x5050. It seems that the first and the second byte of the temperature have the same value.

If I look in the code of honeywell_cm921.c at line 238:

233 case 0x30C9: { 234 size_t num_zones = msg->payload_length/3; 235 for (size_t i=0; i < num_zones; i++) { 236 char name[256]; 237 snprintf(name, sizeof(name), "temperature (zone %u)", msg->payload[3i]); 238 int16_t temp = msg->payload[3i+1] << 8 | msg->payload[3*i+1]; 239 data = data_append(data, name, "", DATA_DOUBLE, temp/100.0, NULL); 240 } 241 break; 242 }

The first and the second byte of temp are filled with the same byte. payload[3*i+2] should be used for the second byte :

238 int16_t temp = msg->payload[3i+1] << 8 | msg->payload[3i+2];

regards,

Aad

zuckschwerdt commented 1 year ago

Oh, thanks! Very good find! This has must have been a typo in #1336

zuckschwerdt commented 1 year ago

Fixed, thanks again for testing, finding that bug and providing a fix!