Giter VIP home page Giter VIP logo

atc_mithermometer's Introduction

ATC_MiThermometer

Custom firmware for the Xiaomi Thermometer LYWSD03MMC and Telink Flasher via USB to Serial converter.

Hardware revision B1.4, B1.6 and B1.9 is now fully compatible

This repo is made together with this explanation video:(click on it)

YoutubeVideo

Victor @pvvx did some very nice refinings of this custom firmare so i really suggest on cheking it out and even use his version as it offers many more functions including non-volatile storage and a better low power management https://github.com/pvvx/ATC_MiThermometer

It is possible to update the Firmware of the Xiaomi Thermometer OTA with this WEB Tool I wrote: https://atc1441.github.io/TelinkFlasher.html

The web flasher works for many devices that uses the Telink TLSR82** MCUs and it can also be used to reflash the Stock firmware back to the device.

You can support my work via PayPal: https://paypal.me/hoverboard1 this keeps projects like this coming.

Tutorial in spanish: https://domoticaencasa.es/tutorial-custom-firmware-termohigrometro-xiaomi-lywsd03mmc Thanks to Eduardo Ruiz

OTA

How to flash the custom firmware:

  • Download the ATC_Thermometer.bin file from the latest release assets and open the Web Flasher.
  • Connect to the Xiaomi thermometer; searching may take a while as it broadcasts not so often for better battery life.
  • After the connection is successful click on "Do Activation" to Authorize the Connection. While it's doing so you can already select the firmware file. Be careful to select the right one as it's not possible to check the firmware further.
  • Click on start flashing to flash the new firmware to the Thermometer.

After the flashing is done, the device should reboot. If the screen stays off, pull the battery out for a short amount of time.

To flash the stock firmware back to the Thermometer, just open the corresponding file (link in the section "Stock firmware" at the bottom of this document) for flashing.

USB to UART

How to flash the custom firmware or unbrick the device:

To flash a new firmware via an standard USB to UART adapter, simply connect the Thermometer as seen in the picture Mi_SWS_Connection.jpg to the USB to UART converter and run the ATCtelink.py tool with the first parameter being the name of the file you want to flash.

Example: "python3 ATCtelink.py ATC_Thermometer.bin"

If the flashing fails or no valid COM port can be found, you can edit it in the Python script. Also try to increase the ResetTime, I will try to make that nicer in the future! So far it turned out that flashing via MAC does not work correctly. I think it's because the data will not get pushed out in real time so the Emulated SWS protocol gets interrupted.

The UART flasher software uses code base from https://github.com/pvvx/TlsrComSwireWriter. Thanks to pvvx for the awesome work on this!

Custom firmware:

  • To build the custom firmware on your own, follow this guide to get a working TC32 Compiler environment ready where you can add the Custom Mi firmware.

Original guide in Chinese: https://github.com/Ai-Thinker-Open/Telink_825X_SDK

Guide translated to English with Google Translate: https://translate.google.com/translate?sl=auto&tl=en&u=https://github.com/Ai-Thinker-Open/Telink_825X_SDK

  • Try to "make" the blink example included in the SDK once to see if the compiling works as it should.
  • You can then copy the folder "ATC_Thermometer" into the example folder and go into that with the terminal.
  • Now do a "make" and it will build the custom firmware.
  • The newly created .bin file can then simply be flashed by either the Web Flasher or the USB to UART method.

Because of the OTA dual bank update method a firmware can be maximum 256kB in size.

The MCU used in the Thermometer is the TLSR8251 the datasheet can be found here: http://wiki.telink-semi.cn/doc/ds/DS_TLSR8251-E_Datasheet%20for%20Telink%20BLE+IEEE802.15.4%20Multi-Standard%20Wireless%20SoC%20TLSR8251.pdf

Getting the MAC of your Thermometer:

On boot the custom firmware will show the last three bytes of the MAC Address in the humidity display part on the LCD for 2 seconds each, the first three bytes are always the same (A4:C1:38) so not shown. Also the BLE name will include the last three bytes of the MAC Address.

Settings in custom firmware:

The following settings can be sent to the RxTx Characteristics 0x1F10/0x1f1f

These settings can be stored in the device by clicking the "Save current settings in flash" button or can be reset to default by clicking the "Reset settings to default" button.

The default value is denoted by the option being written in bold

Show battery level in LCD :

Will show Battery % (when the battery symbol is displayed at the bottom of the screen) or Humidity % (when the battery symbol is NOT displayed at the bottom of the screen) alternatively every 5~6 seconds.

0xB1 = Enabled

0xB0 = Disabled

Change display to °F or °C:

0xFF = Temperature in °F

0xCC = Temperature in °C

Blinking smiley:

0xA0 = Smiley off

0xA1 = Smiley happy

0xA2 = Smiley sad

0xA3 = Comfort Indicator

0xAB = Smiley blinking

Advertising type:

0xAE = Custom

0xAF = Mi Like

New measurement interval (How often the Temperature reading changes in the BLE Advertising data) Does not influence the battery uasge.

byte0 0xFE

byte1 0x06 - value times 10 seconds = interval 60 seconds default.

Temp and Humi offset

byte0 0xFA = Temp offset

byte0 0xFB = Humi offset

byte1 as an int8_t

so Temp = range -12,8 - + 12,8 °C offset Humi = range -50 - +50 % offset

Temp or Humi instant advertising

When the temp or Humidity changes too fast between the main loop (5 seconds interval), the Advertising will be instant for that one.

byte0 0xFC = temp_alarm_point // value divided by 10 for temp in °C

byte0 0xFD = humi_alarm_point

byte1 as int8_t

Temp alarm from 0,1°C to 25,5°C Range <- 0,5°C Default

Humi alarm from 1% to 50% Range <- 5% Default

Advertising format of the custom firmware:

The custom firmware sends every minute an update of advertising data on the UUID 0x181A with the Tempereature, Humidity and Battery data.

The format of the advertising data is as follow:

  • Byte 5-10 MAC in correct order

  • Byte 11-12 Temperature in int16

  • Byte 13 Humidity in percent

  • Byte 14 Battery in percent

  • Byte 15-16 Battery in mV uint16_t

  • Byte 17 frame packet counter

Example: 0x0e, 0x16, 0x1a, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa, 0xbb, 0xcc, 0xdd, 0xdd, 0x00

Using custom firmware with ESPHome

The LYWSD03MMC sensors work out of the box with ESPHome. There are three ways to use them:

  • With the original firmware by using the xiaomi_lywsd03mmc sensor platform. For this, you need to obtain the bindkey.
  • With the custom firmware from this project, either by
    • using platform: atc_mithermometer in ESPHome when the firmware is configured to an advertising type of “custom” (the default) or
    • setting the firmware to “Mi Like” advertisement and using platform: xiaomi_lywsd03mmc with 32 arbitrary hex digits as the bindkey, e.g. eef418daf699a0c188f3bfd17e4565d9. (This works because the values in the broadcast are not encrypted when using this firmware, but bindkey is still a required parameter.)

platform: xiaomi_lywsd03mmc is available since ESPHome 1.15, platform: atc_mithermometer since 1.16.

Using custom firmware with OpenMQTTGateway

The LYWSD03MMC sensors work out of the box with OpenMQTTGateway. You can directly upload OMG to the ESP32 from your web browser here, choose esp32dev-ble or esp32dev-ble-cont (for continuous scanning).

  • With the original LYWSD03MMC firmware, OMG will connect to the sensor so as to retrieve the sensors values and publish to MQTT.
  • With the custom LYWSD03MMC firmware from this project, OMG will detect automatically the sensor and publish to MQTT. In both cases the sensor will be auto discovered in Home Assistant per default (no configuration needed if you are already using the MQTT integration with auto discovery). You can also follow this tutorial(https://1technophile.blogspot.com/2021/08/get-your-ble-sensors-data-into-home.html) for the Home Assistant integration. You can also integrate to OpenHAB or other MQTT compatible controllers

Stock firmware:

This .zip file contains the stock firmware to go back: https://github.com/pvvx/ATC_MiThermometer/files/7300157/LYWSD03MMC_0130_upd_miaomiaoce.sensor_ht.t2.zip

Building manual for docker:

https://github.com/AlmightyFrog/BuildEnvironmentATCMiThermometer

Many thanks to:

@danielkucera https://github.com/danielkucera/mi-standardauth/blob/master/provision.py

@romanhosek https://twitter.com/romanhosek https://github.com/hosek

atc_mithermometer's People

Contributors

1technophile avatar atc1441 avatar cabalist avatar clach04 avatar cricri-pingouin avatar forceu avatar ghoost82 avatar haraldkubota avatar hypfer avatar jmav avatar lvela avatar marcv81 avatar martonmiklos avatar michapr avatar pilatomic avatar popsodav avatar rvben avatar scy avatar skaldo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

atc_mithermometer's Issues

Immediately ADV-data updates in case of too fast values changing.

Thanks to your efforts, this device became absolutely perfect, imo! One more suggestion: please implement the immediate message sending in case of temp/humi change hit some threshold in a certain period of time. I mean, something like this: if temp changed for 0.5C (adjustable by user), or humi changed for 5% (adjustable too) since the last sensor read - ADV-message buffer updates immediately, regardless of the timer state. I know that it could be done easily with ESPHome in conjunction with a pretty short set timer, but maybe other smart home system integrations can't do this, so internal hardware implementation would be useful.

Make 0xAF = Mi Like default

I am setting these sensors up in home assistant using the blue HACS add in. It expects the sensors to broadcast using the Mi Like format. I can change the sensors to transmit using the Mi Like format but this will reset to the custom format when I change the battery. Can you consider making the Mi Like format the default? Thank you for your excellent work.

Scanner doesn't show any devices

I got very interested in this project as I have 4 of these Xiaomi devices and would like to integrate them in my home automation system. So I downloaded the firmware and used the Chrome app to got the TelinkFlasher page and started scanning and then nothing... The log says Searching Devices. I read that this can take some time but after half an hour I gave up. I checked with a BLE scanner on my iPhone and all 4 devices show up. I then used my iPad and laptop (running Ubuntu 20.04), results are consistent, nothing happens. I noticed in the video that hitting the Connect button opens a Bluetooth connection screen but that doesn't happen in my case. On iOS devices Chrome doesn't throw a Bluetooth access dialog and I can't find a way to do this manually in settings. Can someone enlighten me how to set this up on iOS 13 (or Ubuntu) or is this Android only?

Parameters non-volatile storage

Would be nice to store offsets, advertising type, smiley preference etc during battery replacements.
I've failed to find flash addressing, so tried from tiny_Flash lib example:
tinyFlash_Init(0x70000,0x4000); in main, then
tinyFlash_Write(1, &temp_offset, 1); tinyFlash_Write(2, &humi_offset, 1); in cmd_parser and
tinyFlash_Read(1, &temp_offset, 1); tinyFlash_Read(2, &humi_offset, 1); in void user_init_normal(void)
but after setting humidity offset and reboot device is bricked (stuck at startup screen), will try to flash it via USB-Serial method.
@atc1441 have you worked with tiny_Flash lib?

MHO-C401 just web log

...
Log:
04:37:00: Searching for devices
04:37:03: TypeError: device.watchAdvertisements is not a function
04:37:03: Reconnect 1 from 5
04:37:05: Detected Mi Thermometer
04:37:05: Connected
04:37:21: Activating now, please wait...
04:37:25: Activation successfull
04:37:26: Received device infos are correct
04:37:26: Login successfull
...

Device known id:
blt.3.129v87p7vBATC

Mi Token:
6f6faa84c6b69c2d9c1fd0c7

Mi Bind Key:
fc683bbbc65eceeb9d0ce9dd9ec68ebd

Dont work in esphome, neither MiHome now xD

"Verification failed"

20200924_044419

Automatic smiley changing like on stock firmware

First of all, thanks for your awesome work!

Would be nice to add automatic changing smileys like in stock firmware in reference to temperature and humidity.
Right now default option with blinking smiley require stay few second and wait when smile will appear.
Thank you in advance.

Differences in humidity reading

I would like to report that after flashing custom firmware humidity reading are 4-5 % lower than on stock firmware. I tested it on 3 pcs and each had this issue.
Is this intentional behaviour or bug?

Support other models like CGG1

First of all, wow, this looks amazing 🎉
I didn't know that custom firmware for this device was possible, thanks to you, now I know it is 🙂

I'd like to ask if it would be possible to support other devices, like CGG1?
There are multiple issues with it. Especially the advertising time.
It would be awesome if it could be set to one min and if the device could send all three parameters each time (now the battery isn't send too often).

A custom firmware could solve all the issues.

I'm not sure what MCU is used, but maybe similar.
Here are the materials I found: https://fccid.io/2AQ3F-CGG1/Internal-Photos/Internal-Photos-3990168
I can take my sensor apart and make some detailed pictures if needed.

What is the differences?

Can you tell me what the differences are between these two screens?
image
image
Both got the same temperature. The display without the smiley is/should be humidity. What is the other?

Advertising interval

Hi,

how to understand the "Advertising interval:"?

I have changed it via web flasher, but cannot see a difference - advertising values will be received every minute about.

Then have changed in code (app.c):
RAM uint8_t advertising_interval = 6;//multiply by 10 for value

to

RAM uint8_t advertising_interval = 36;//multiply by 10 for value

but no difference too (other values like smiley, battery will be accepted in code and web flasher as expected)

I want to change the enable sensor time for saving battery, as sample to 3 minutes.

Thanks!
Michael

Update readme: add guide for ESPHome config

The custom firmware has been updated by @atc1441 to support "Mi like" advertising. When enabled, the LYWSD03MMC sensors work directly in ESPHome with the xiaomi_lywsd03mmc component. The bindkey is not necessary any more as the payload is not encrypted in the custom firmware. However, since the bindkey is a mandatory parameter, you still need to give it a fake one in the config file. It can be anything though, as long as it is formatted like a real one.

esphome/feature-requests#552 (comment)

Added pull request: #39

Help with Sensor instant Advertising

I pushed the FC01 value to my device, but I can't see any difference when reading values from home assistant.
The value seems to update every 5 minutes even if there is 0.1° change in temperature
Can you help me?

LCD going off after some time / when under a specific Temperature

Hi,

I try to flash LYWSD03MMC with following firmware: ATC_Thermometer_custom.bin. However after some time (like 60 seconds) LCD is going off - it is still possible to connect/send firmware using TelinkFlasher.

With ATC_Thermometer LCD is on only on "bootup" process then it goes off and doesn't show temperature.

With stock firmware LCD is on and shows temperature all the time...

Please advise.

Best Regards

INK screen devices support

Hello,

I have two type of devices with inc screen:

  • clear glass CGG1
  • xiaomi MHO-C401

and I wonder if any work/progress/plans to have custom fw for this devices?

also can I activate/get token using web flash of this devices?

thanks

Mi-like advertising data structure.

Won't it break your concept too much, if ADV-data will be structured as for an MI-like device? I mean using 0x95, 0xFE UUID, some device identification and predefined data points?

Is this supposed to work from IOS?

Hi
Do you know whether the flasher works from iOS?
when I push the connect button on mig iphone, it writes "searching for devices” in the log and nothing more happens.

Flexible ADV-timers.

First of all - thank you for your efforts, awesome work! Please, could you make ADV-timers more flexible to reduce battery drain? For instance, if temp/humi changed more than 1 degree/ 5 percent - send data every 1 min per change, and every 10 minutes otherwise (from the last send).

TypeError: device.watchAdvertisements is not a function

I received my Xiaomi sensors today. I flashed the first device with help of the YouTube video. After flashing the device itself presented its MAC address, but when I connect from the TelinkFlasher the log said "TypeError: device.watchAdvertisements is not a function". After that it will try to reconnect. It also detects the custom firmware. The flasher page does not show any Temp/Humi data anymore

Did i made a mistake? I tried flashing it again, same procedure with the same result.

Also, my OpenMQTTGateway ESP32 doesn't pick up a temperature and humidity. It does get detected with
{"id":"a4:c1:38:90:29:62","rssi":-85,"distance":15.12852,"servicedata":"a4c13890296201052c570bb001","servicedatauuid":"0000181a-0000-1000-8000-00805f9b34fb"}

Connection problems - again

Hello atc1411

just downloaded the new firmware and flashed the device, but now I get this:

Log:
17:59:01: Searching for devices
17:59:23: Connecting to: LYWSD03MMC
17:59:33: Detected Mi Thermometer
17:59:33: Connected
17:59:44: Disconnected.
17:59:44: Searching for devices
18:00:08: Connecting to: LYWSD03MMC
18:00:38: Detected Mi Thermometer
18:00:38: Connected
18:02:07: Activating now, please wait...
18:02:10: Activation successfull
18:02:11: Received device infos are correct
18:02:11: Login successfull
18:03:03: File was selected, size: 61452 bytes
18:03:03: Count: 3841
18:03:11: Start DFU
18:04:07: Update done after 55.577 seconds
18:04:14: Disconnected.
18:04:21: Searching for devices
18:04:43: Connecting to: LYWSD03MMC
18:05:06: Detected Mi Thermometer
18:05:06: NotSupportedError: GATT operation failed for unknown reason.
18:05:06: Reconnect 1 from 5
18:05:06: Detected Mi Thermometer
18:05:06: NotSupportedError: GATT operation failed for unknown reason.
18:05:06: Reconnect 2 from 5
18:05:06: Detected Mi Thermometer
18:05:06: NotSupportedError: GATT operation failed for unknown reason.
18:05:06: Reconnect 3 from 5
18:05:06: Detected Mi Thermometer
18:05:06: NotSupportedError: GATT operation failed for unknown reason.
18:05:06: Reconnect 4 from 5
18:05:06: Detected Mi Thermometer
18:05:06: NotSupportedError: GATT operation failed for unknown reason.
18:05:06: Reconnect 5 from 5
18:05:06: Detected Mi Thermometer
18:05:06: NotSupportedError: GATT operation failed for unknown reason.
18:05:06: Something went wrong, to many reconnect's

Great that you implemented the new features to calibrate, but how can these be set, what kind of application is required, or di I misunderstood something here and it need to be set in the firmware (which I do not believe):

Settings in custom firmware:
The following settings can be send to the RxTx Characteristics 0x1F10/0x1f1f These settings will not get saved on power loss, maybe that will change in future but normaly the battery will be in there for a while

Change display to °F or °C:
0xFF = Lcd in °F

0xCC = Lcd in °C <- Default

Blinking smiley:
0xA0 = Smiley off

0xA1 = Smiley happy

0xA2 = Smiley sad

0xAB = Smiley bliking <- Default

Advertising interval
byte0 0xFE

byte1 0x06 - value times 10 seconds = interval 60 seconds default.

Temp and Humi offset
byte0 0xFA = Temp offset

byte0 0xFB = Humi offset

byte1 as an int8_t

so Temp = range -12,5 - + 12,5 °C offset Humi = range -50 - +50 % offset

The offset will be parsed as int_8 so an 0x80 would be -12,5°C something.

Cache Memory recorded values

Quick question, does the new custom firmware also save and record measured values ?

How can they be accessed and retrieved ?

Two devices, two different TX/RX behavior

First of all, thanks for your awesome work - this is amazing.
I have two LYWSD03MMC sensors - both flashed with your provided .bin build in master branch. I am using it in combination with the OpenMQTTGateway project on an ESP32. One sensor is behaving perfectly fine. The other one only works if it is placed within a circle with an radius of approximately 1.5m centered at the ESP32. I tried flashing the sensor over and over again, rebooted it by taking out the battery, replaced the battery, switched the batteries among both devices, turning one device off while the other one is on, placing them in the same room, placing them in different rooms with the same distance to the ESP32 - it makes no difference. I don't think that this is a problem with OpenMQTTGateway, because the problem also occurs when the working sensor is turned off. Does anyone have a clue what the problem is?

Can't connect to newly flashed device

I just successfully flashed a bunch of thermometers with the custom firmware, but now I can't connect to them with the web tool to update the settings:

Log:
21:39:09: Searching for devices
21:39:18: Connecting to: ATC_8A6105
21:39:28: NotFoundError: No Services matching UUID 00010203-0405-0607-0809-0a0b0c0d1912 found in Device.
21:39:28: Reconnect 1 from 5
21:39:28: NotFoundError: No Services matching UUID 00010203-0405-0607-0809-0a0b0c0d1912 found in Device.
21:39:28: Reconnect 2 from 5
21:39:28: NotFoundError: No Services matching UUID 00010203-0405-0607-0809-0a0b0c0d1912 found in Device.
21:39:28: Reconnect 3 from 5
21:39:28: NotFoundError: No Services matching UUID 00010203-0405-0607-0809-0a0b0c0d1912 found in Device.
21:39:28: Reconnect 4 from 5
21:39:28: NotFoundError: No Services matching UUID 00010203-0405-0607-0809-0a0b0c0d1912 found in Device.
21:39:28: Reconnect 5 from 5
21:39:28: NotFoundError: No Services matching UUID 00010203-0405-0607-0809-0a0b0c0d1912 found in Device.
21:39:28: Something went wrong, to many reconnect's

They seem to be working fine otherwise, switching between displaying temperature/humidity and temperature/battery and advertising their values over BLE.
Is there another way to update the settings, besides the web tool?

Device security - disable OTA, custom firmware settings

Hello,

thank you for the great project!

Do I understand correctly, that the MiThermometers with original or custom FW can be flashed (or bricked) via OTA by anybody within the BTLE range? Same goes for the "Custom firmware Settings" (temp / humidity offset...)?

Is there any option to disable the OTA / Custom firmware setting? For example after 1min after inserting the battery or by HW modification to the MiThermometer (shorting some "program-disable" pin on the PCB)?

Lastly, is there an option how to prevent spoofing of the MiThermometers data? For example by implementing encryption/signing data with bindkey, so we can verify validity of received data?

Just trying to have secure home automation and credible environmental data for central heating control.

Advertising is missing the first 4 bytes

I just tried to implement a parser for the native adv. format, but I noticed that the data first 4 bytes seem to be missing. The payload starts with the mac address right away. Firmware version was the latest from this morning.

Firmware changelog

I noticed that the .bin has been updated since my first installation last week.
Is it possible to create a firmware changelog so I can understand what are the new bugfixes and features

Thanks for your time

Battery performance

Thanks for your work! You have some great knowledge / experience.

What I would like to know if the every minute part will drain the battery a lot more than the default implementation which does not send a lot of updates as I've seen. (looks maximum every 11 minutes if the value is different enough)

Yes, I'm aware the answer is still unclear! No problem, the issue can be left open until there is more info about it, and maybe added to the readme of this repo.

Cant flash, ativate and send parameters to custom firmware till 09/09/2020

Today i can't do activation (stuck) of stock firmware device, can't flash stock and custom firmware devices (even reflashed yesterday) and can't send parameters to custom firmware. Also i CAN connect to device.

Снимок экрана 2020-09-09 в 10 55 03

Снимок экрана 2020-09-09 в 10 56 47

Yesterday everything was fine. But till today t seems that something broken in script.

Tried on 3 devices and on MAC, PC and Android 10 pixel 4. Nothing.

Screenshots attached below.

Any ideas what happening?

Before today everything worked fine.

Measure battery more seldom

As I understand measuring the battery is the thing that drains it the most, is it possible to only do these measurements like once a day or at least once a hour?

Add Calibration/Offset

One thing that bothered me for a while now is that it was not possible to calibrate the sensors, even though various sources (e.g https://github.com/JsBergbau/MiTemperature2#calibration ) mention that especially the humidity is not that accurate.
It would be awesome to be able to set an offset for temperature/humidity, which is then applied to the sensor data before displaying and/or broadcasting.

Feature Request - Show BT MAC Address of Sensor in Web Flasher

I find it quite a lengthy process to identify the MAC address, when trying to add a new sensor to ESPHome.

Mu mobile is an iPhone and lamptop is running Windows 10. Neither of which seem to make it easy to ID the
sensor.

Would you kindly add a box to display the MAC address of the connected device in the Telink Flasher please?

Stuck on "Detected custom firmware"

Hi, thanks for the great work.

I installed the custom firmware, it shows correctly on the device, when i try to connect to it, i get this:

Log:
00:51:04: Searching for devices
00:51:14: TypeError: device.watchAdvertisements is not a function
00:51:14: Reconnect 1 from 5
00:51:18: Detected custom Firmware

And that's it. No temp or humidity indications or other.
Any idea what can cause this?

blinking smiley

Hi,

thanks for the very good job!
Sensors are nice, but battery life time is short if make a request every 10 minutes....
So I hope will be much better with advertising only.

regarding the blinking smiley - is it possible to go back to the default setting, that smiley is permanent available (even by default)?
Maybe same for battery could be useful.

Or maybe create a second such firmware file? ;)

Thanks!
Michael

Allow dumping original firmware via ATCtelink.py

Hi @atc1441,

First I'd like to thank you for the impressive work that you've done reverse engineering the flashing protocol and giving us mortals the possibility to flash custom firmware via OTA :)

I own some of the other Mi BLE sensors - LYWSD02, CGG1 and MHO-C401. Inspired by your work, yesterday I opened the latest sensor in my collection - MHO-C401 (greyish square body with e-ink display) , and I just confirmed my suspicions that its built around TLSR8251 too:

IMG_20200907_173110

So, I'd like to start experimenting with it, but not having the hardware flashing tool, I'd have to rely on USB to UART flashing and OTA. But first I'd like to be able to dump its original firmware, so that I have a predictable starting point should anything breaks.

Is it possible to make the ATCtelink.py script dump the firmware of the attached device into a file?

Diffferences between on-screen values and values transmited

Hi
First of all, thank you for you work. I would never thought someone would hack a 3$ thermometer :)

I have your firmware on 3 devices, I'm using atc_mithermometer in esphome to read values. I watch the device screen, and values from esp output logs and I can see some situations when for example:

Temp on screen is 23.5, temp I get form logs is 23.5 -->> Temp on screen increases to 23.6 and after few seconds / half a minute in logs I see message from sensor with old value 23.5

What could be the reason for this?

Thank you

[FR] Command line OTA flasher

Any chance for command line implementation of OTA flasher?
I'd love to see that happen, as I'm currently running your firmware on 12 devices (another 8 are on the way;) and updating that swarm using web flasher is serious pain in the ass;)
Command line version would allow much more flexibility (automation).

After flashing firmware not able to see the device anymore

Great work you did, but after flashing the firmware I do not see the device anymore under Windows 10 device lists.
If I open your TelinkFlasher page the browser is able to find the device, but I'm not able to press DoActivation, I guess this could only be pressed once, right ?

Do I have to made a note of the TOKEN and BIND KEY ?

Where do you get the original firmware ? Is it possible to get an original firmware read from the device as well over a webpage ?

Thanks

Can't reconnect to flashed thermother

I have managed to flash one of my sensor with the custom firmware all worked
But now I can't reconnect to it.
I can't see it but when I select it it end up saying in the log:

17:47:17: Searching for devices
17:47:29: TypeError: device.watchAdvertisements is not a function
17:47:29: Reconnect 1 from 5
17:47:34: NetworkError: Connection failed for unknown reason.
17:47:34: Reconnect 2 from 5
17:47:40: NetworkError: Connection failed for unknown reason.
17:47:40: Reconnect 3 from 5
17:47:46: NetworkError: Connection failed for unknown reason.
17:47:46: Reconnect 4 from 5
17:47:51: NetworkError: Connection failed for unknown reason.
17:47:51: Reconnect 5 from 5
17:47:56: NetworkError: Connection failed for unknown reason.
17:47:56: Something went wrong, to many reconnect's

I have no issue with another sensor that has not been flash yet. I don't dare flashing it :)

accidently flashed the zip, not the bin

Hi there,

thanks for this tool. But I made a mistake. I flashed the zip-file, not the extracted bin.
I'm trying to flash through UART through a USB-Adapter. It seems to write and finish, but the device is still dead.
I've tried with RX and TX, but both with no luck. Also the stock- and your .bin
Some other ideas?

Advertising type: 0xAE = Custom 0xAF = Mi Like <- Default

Is is possible to make
Advertising type:
0xAE = Custom
0xAF = Mi Like <- Default
?

I am using the ESP and it is not comfortable to open a web page and connect to the device to change this parameter all the time after battery change.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.