diff --git a/ATC_V34d.bin b/ATC_V35.bin similarity index 66% rename from ATC_V34d.bin rename to ATC_V35.bin index d3b09bb3..64d2f955 100644 Binary files a/ATC_V34d.bin and b/ATC_V35.bin differ diff --git a/CGG1_v34c.bin b/CGG1_v35.bin similarity index 67% rename from CGG1_v34c.bin rename to CGG1_v35.bin index d830d26d..7d945c0f 100644 Binary files a/CGG1_v34c.bin and b/CGG1_v35.bin differ diff --git a/MHO_C401_v34c.bin b/MHO_C401_v35.bin similarity index 66% rename from MHO_C401_v34c.bin rename to MHO_C401_v35.bin index e1bd105e..983c2ef5 100644 Binary files a/MHO_C401_v34c.bin and b/MHO_C401_v35.bin differ diff --git a/README.md b/README.md index 615bf675..6ac3f7d5 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,7 @@ In case you want to go back to the original firmware, you can download them here | 3.2 | Added [new encrypted beacon formats](https://github.com/pvvx/ATC_MiThermometer/issues/94#issuecomment-846984018), reed switch maintenance | 3.3 | Added autodetection for [LYWSD03MMC hardware versions B1.6 and B1.9](https://github.com/pvvx/ATC_MiThermometer/issues/125). For CGG1-M and MHO-C401 - autodetection of SHTV3 or SHT4x sensors | 3.4 | Correct Hardware Version Setting for [LYWSD03MMC B1.7](https://github.com/pvvx/ATC_MiThermometer/issues/145) +| 3.5 | Correction of moisture readings for SHT4x sensors. ## Applications diff --git a/firmware.json b/firmware.json index 63219f5d..cdbca838 100644 --- a/firmware.json +++ b/firmware.json @@ -1,3 +1,3 @@ -{"version": 52, -"custom":["ATC_V34d.bin", "MHO_C401_v34c.bin", "CGG1_v34c.bin", "ATC_V34d.bin", "ATC_V34d.bin", "ATC_V34d.bin"], +{"version": 53, +"custom":["ATC_V35.bin", "MHO_C401_v35.bin", "CGG1_v35.bin", "ATC_V35.bin", "ATC_V35.bin", "ATC_V35.bin"], "original":["Original_OTA_Xiaomi_LYWSD03MMC_v1.0.0_0130.bin","Original_OTA_Xiaomi_MHO_C401_v1.0.0_0010.bin","Original_OTA_CGG1_v1.0.1_0093.bin","Original_OTA_Xiaomi_LYWSD03MMC_v1.0.0_0130.bin","Original_OTA_Xiaomi_LYWSD03MMC_v1.0.0_0130.bin","Original_OTA_Xiaomi_LYWSD03MMC_v1.0.0_0130.bin"]} \ No newline at end of file diff --git a/src/app_config.h b/src/app_config.h index d2b6724d..58fa1647 100644 --- a/src/app_config.h +++ b/src/app_config.h @@ -4,7 +4,7 @@ extern "C" { #endif -#define VERSION 0x34 // BCD format (0x34 -> '3.4') +#define VERSION 0x35 // BCD format (0x34 -> '3.4') #define EEP_SUP_VER 0x09 // EEP data minimum supported version #define DEVICE_LYWSD03MMC 0x055B // LCD display LYWSD03MMC diff --git a/src/sensors.c b/src/sensors.c index dc6308c1..d6ccfea3 100644 --- a/src/sensors.c +++ b/src/sensors.c @@ -136,7 +136,10 @@ _attribute_ram_code_ __attribute__((optimize("-Os"))) int read_sensor_cb(void) { while(reg_i2c_status & FLD_I2C_CMD_BUSY); if(crc == data && _temp != 0xffff) { measured_data.temp = ((int32_t)(17500*_temp) >> 16) - 4500 + cfg.temp_offset * 10; // x 0.01 C - measured_data.humi = ((uint32_t)(10000*_humi) >> 16) + cfg.humi_offset * 10; // x 0.01 % + if(sensor_i2c_addr == (SHTC3_I2C_ADDR << 1)) + measured_data.humi = ((uint32_t)(10000*_humi) >> 16) + cfg.humi_offset * 10; // x 0.01 % + else + measured_data.humi = ((uint32_t)(12500*_humi) >> 16) - 600 + cfg.humi_offset * 10; // x 0.01 % if(measured_data.humi < 0) measured_data.humi = 0; else if(measured_data.humi > 9999) measured_data.humi = 9999; measured_data.count++; diff --git a/test_adv_cust.py b/test_adv_cust.py index 39868181..952d9ae5 100644 --- a/test_adv_cust.py +++ b/test_adv_cust.py @@ -1,7 +1,7 @@ import asyncio import struct import binascii -from Crypto.Cipher import AES +from Crypto.Cipher import AES #pip install pycryptodome def parse_value(hexvalue): vlength = len(hexvalue) diff --git a/test_adv_key.py b/test_adv_key.py index 54cc511a..81a8d60c 100644 --- a/test_adv_key.py +++ b/test_adv_key.py @@ -1,7 +1,7 @@ import asyncio import struct import binascii -from Crypto.Cipher import AES +from Crypto.Cipher import AES #pip install pycryptodome def parse_value(hexvalue, typecode): vlength = len(hexvalue)