ATC_MiThermometer icon indicating copy to clipboard operation
ATC_MiThermometer copied to clipboard

Device not broadcasting after replaced battery?

Open YvoTuk opened this issue 3 years ago • 20 comments

One of my ATC_Mi thermometers recently drained it's battery and got empty. After replacing the battery, all seemed fine, but I noticed it seems to have stopped broadcasting. I connected using TelinkFlasher which worked, tried some settings with no effect (the display changes when the setting are sent, but no data on the ESP32 data collector. I then uploaded the original firmware to see if it was corrupted in some way. Although the upload is very slow (takes over 15mins!) it worked fine. I activated the device in TelinkFlasher which returned a new Bindkey. Noted that and flashed the same firmware as I used for all the other devices. Copied / pasted the Bindkey in the ESP32 file and .. nothing.

I don't understand what's happening or what's caused this to happen. What am I missing?

YvoTuk avatar Oct 25 '21 11:10 YvoTuk

Hey. You dont need the bindkey with the custom firmware. Maybe back then you did set it to MiLike Advertising ? You need to activate that then.

The 15min upload could have been fixed by reconnecting and restart the upload :)

atc1441 avatar Oct 25 '21 11:10 atc1441

Ah.. just found out all bindkeys are the same and they were originally inserted because the ESP32 config YAML demanded the bindkey line. However, all other entities are running and displaying Temp/Hum/Lvl I'll give it another shot forcing it to custom advertising (although I'd expect that to be reset after a revert to original fimware > custom firmware.

YvoTuk avatar Oct 25 '21 12:10 YvoTuk

@YvoTuk when you upload the custom firmware, the advertising type will be set to custom by default. If you are using ESPHome on your ESP32, this means that you have to change:

  • platform: xiaomi_lywsd03mmc to:
  • platform: atc_mithermometer

for the esphome to recognize the advertized data.

You didn't mention what kind of sofware you are using on your ESP32 but since you do mentions YAML file the epshome is likely. Did you do this change in the platform line?

kadamski avatar Oct 27 '21 09:10 kadamski

Yes, I'm using esphome. The thermometer is set to custom advertising, but let me give this a go as well. Up till now I still just can't figure out why it would not advertise anymore after the battery dying.

YvoTuk avatar Oct 27 '21 12:10 YvoTuk

I've experienced this too - flashed an esphome device many months ago, hooked it up to 4 thermometers running this firmware. Battery died on one a month or so ago, replaced - no new temps read by esphome. I assumed it was a problem with that sensor, but now another battery has gone and the same has happened to that device too. Platform has always been set to xiaomi_lywsd03mmc on esphome which had been working fine, will try switching though...

wilb avatar Oct 27 '21 19:10 wilb

@wilb that sound again like you did made some custom settings back when setting it up and on reboot they are reset to default so the custom settings need to be done again.

The newest firmware saves the settings in flash so they do not get lost anymore. click the button save settings permanent to do so

atc1441 avatar Oct 27 '21 19:10 atc1441

When battery is replaced and settings were stores in a flash before: is it data automatically read from flash and device “just works” like before or it’s needed any action (read from flash via OTA flasher or similar) ?

Protoncek avatar Oct 27 '21 19:10 Protoncek

@wilb that sound again like you did made some custom settings back when setting it up and on reboot they are reset to default so the custom settings need to be done again.

The newest firmware saves the settings in flash so they do not get lost anymore. click the button save settings permanent to do so

Confirmed this appears to be exactly what's happened - updating firmware and setting config back to "Mi Like" has restored normal service. Apologies & thanks!

wilb avatar Oct 27 '21 19:10 wilb

When battery is replaced and settings were stores in a flash before: is it data automatically read from flash and device “just works” like before or it’s needed any action (read from flash via OTA flasher or similar) ?

On the old version no, as the settings are not saved at all.

On the new version yes, on every reboot the settings area is read looked for any unplausible data and if the settings are good then load and used

atc1441 avatar Oct 27 '21 19:10 atc1441

experiencing about the same device seems stop broadcasting mean i cannot even see it to pair it anymore. I have 2 device experiencing this ..... one the device still broadcast but i cannot stay connected enough to update the fw is solder the pad the only way to fix this ?

devzwf avatar Nov 23 '21 21:11 devzwf

If no Bluetooth is available anymore the only back debricking is via UART yes.

Would always try a new battery, even if the devices are new, first

atc1441 avatar Nov 23 '21 21:11 atc1441

i already try new battery device is working fine... just no Bluetooth And i forgot to say this did not happen after battery dried..... all suddenly the bluetooth stop working as i said , secodn device

devzwf avatar Nov 23 '21 22:11 devzwf

Strange. Did you try connecting to the device with some other computer or even a phone, maybe?

kadamski avatar Nov 24 '21 05:11 kadamski

Yes i try to pair from different device , but there is simply no advertising. Like i said the device was sending data to esphome before and suddenly stop advertising

devzwf avatar Nov 24 '21 14:11 devzwf

Hey guys, after about a year of use, I started suffering similar with a limited number of my thermometers (4 of 21 units total. Maybe I'll spot a bigger pattern as more batteries star running low on juice...) I was able to reach them via bluetooth though and I eventually found this recovery procedure worked for me (I'm sure my process has room for improvement though.) Hopefully it'll help someone's woes...

  1. Using the Telink flasher site and your mobile, connect to the misbehaving thermometer and reflash the stock firmware.
  2. Reconnect to the device once it's flashed and grab the new bind key (in case you need it).
  3. Before anything times out, reflash with the latest custom firmware.
  4. Reconnect again once it's flashed and set the advertising type to 'mi like'.
  5. At this point, I closed my mobile's BT connection, in case that was interfering with my BLE receivers, but the device seemed to work from thereon in.

Dogmanov avatar Dec 19 '21 00:12 Dogmanov

HI @Dogmanov

I will revisit th eunit i have issue with... but my issue was i did not had any bluetooth at all...

But at one point , cant remember what i was doing i saw the BT sign on the device... but i still could not see it on the scanning device.... was weird... I then give up and use an other sensor.... and put this one i the box...

and this issue happen while i was at 60% battery...

devzwf avatar Dec 19 '21 02:12 devzwf

I have also this issue. After replacing an empty battery, there is no data receiver from the device. I've 8 devices, 6 of them are now offline.... I can reflash the device (flashed the latest firmware), and change setting via the website but nothing seems to help. Anyone have a solution yet?

markvandenakker avatar Jan 29 '22 17:01 markvandenakker

It sounds line you need to select mi like advertising.

That depends on how you set them up first time

atc1441 avatar Jan 29 '22 17:01 atc1441

It sounds line you need to select mi like advertising.

That depends on how you set them up first time

atc1441 avatar Jan 29 '22 17:01 atc1441

Same issue here, can't see the sensors anymore on the esphome devices, also can't connect from the flashing page. But I could see them from Windows BT Devices and even connect them and see the MAC address. Solved after changing type to atc and commenting the bind key:

`#Xiaomi sensors with ATC firmware and Mi Like advertisement

  • platform: atc_mithermometer mac_address: "A4:C1:38:6F:55:D5" #bindkey: "eef418daf699a0c188f3bfd17e4565d9" temperature: name: "ATC Temperature Dormitor" humidity: name: "ATC Humidity Dormitor" battery_level: name: "ATC Battery-Level Dormitor"`

bbogdanmircea avatar Apr 02 '22 13:04 bbogdanmircea