Skip to content

Commit

Permalink
v3.5 Correction of moisture readings for SHT4x sensors.
Browse files Browse the repository at this point in the history
  • Loading branch information
pvvx committed Dec 12, 2021
1 parent 0103a84 commit 6a1831b
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 6 deletions.
Binary file renamed ATC_V34d.bin → ATC_V35.bin
Binary file not shown.
Binary file renamed CGG1_v34c.bin → CGG1_v35.bin
Binary file not shown.
Binary file renamed MHO_C401_v34c.bin → MHO_C401_v35.bin
Binary file not shown.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions firmware.json
Original file line number Diff line number Diff line change
@@ -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"]}
2 changes: 1 addition & 1 deletion src/app_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion src/sensors.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
2 changes: 1 addition & 1 deletion test_adv_cust.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test_adv_key.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit 6a1831b

Please sign in to comment.