Skip to content

Commit

Permalink
https://github.com/pvvx/ATC_MiThermometer/issues/163
Browse files Browse the repository at this point in the history
  • Loading branch information
pvvx committed Dec 12, 2021
1 parent 0eae389 commit 7304570
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
Binary file renamed ATC_V35.bin → ATC_V35a.bin
Binary file not shown.
Binary file renamed CGG1_v35.bin → CGG1_v35a.bin
Binary file not shown.
Binary file renamed MHO_C401_v35.bin → MHO_C401_v35a.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +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.
| 3.5 | Correction of moisture readings for SHT4x sensors. [Rounding off sensor values on display.](https://github.com/pvvx/ATC_MiThermometer/issues/163)


## Applications
Expand Down
2 changes: 1 addition & 1 deletion firmware.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{"version": 53,
"custom":["ATC_V35.bin", "MHO_C401_v35.bin", "CGG1_v35.bin", "ATC_V35.bin", "ATC_V35.bin", "ATC_V35.bin"],
"custom":["ATC_V35a.bin", "MHO_C401_v35a.bin", "CGG1_v35a.bin", "ATC_V35a.bin", "ATC_V35a.bin", "ATC_V35a.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"]}
6 changes: 3 additions & 3 deletions src/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ _attribute_ram_code_ void WakeupLowPowerCb(int par) {
rds_input_on();
#endif
if(read_sensor_cb()) {
last_temp = measured_data.temp / 10;
last_humi = measured_data.humi / 100;
last_temp = (measured_data.temp + 5)/ 10;
last_humi = (measured_data.humi + 50)/ 100;
#if USE_TRIGGER_OUT
set_trigger_out();
#endif
Expand Down Expand Up @@ -435,7 +435,7 @@ _attribute_ram_code_ __attribute__((optimize("-Os"))) void lcd(void) {
if (set_small_number_and_bat) {
#if DEVICE_TYPE == DEVICE_CGG1
show_battery_symbol(!cfg.flg.show_batt_enabled);
show_small_number(measured_data.humi / 10, 1);
show_small_number((measured_data.humi + 5) / 10, 1);
#else
show_battery_symbol(0);
show_small_number(last_humi, 1);
Expand Down
2 changes: 1 addition & 1 deletion src/ble.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ void set_adv_data() {
p->data_id = XIAOMI_DATA_ID_TempAndHumidity & 0xff; // (lo byte XIAOMI_DATA_ID)
p->t0d.len = 0x04;
p->t0d.temperature = last_temp; // x0.1 C
p->t0d.humidity = measured_data.humi / 10; // x0.1 %
p->t0d.humidity = (measured_data.humi + 5) / 10; // x0.1 %
} else {
p->data_id = XIAOMI_DATA_ID_Power & 0xff; // (lo byte XIAOMI_DATA_ID)
p->t0a.len1 = 1;
Expand Down
4 changes: 2 additions & 2 deletions src/mi_beacon.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ void atc_encrypt_beacon(uint32_t cnt) {
p->head.uid = GAP_ADTYPE_SERVICE_DATA_UUID_16BIT; // 16-bit UUID
p->head.UUID = ADV_CUSTOM_UUID16; // GATT Service 0x181A Environmental Sensing (little-endian) (or 0x181C 'User Data'?)
p->head.counter = (uint8_t)cnt;
data.temp = measured_data.temp / 50 + 4000 / 50;
data.humi = measured_data.humi / 50;
data.temp = (measured_data.temp + 25) / 50 + 4000 / 50;
data.humi = (measured_data.humi + 25) / 50;
data.bat = battery_level | ((trg.flg.trigger_on)? 0x80 : 0);

memcpy(&cbn.MAC, mac_public, sizeof(cbn.MAC));
Expand Down

0 comments on commit 7304570

Please sign in to comment.