pvvx / BZdevice

Custom firmware for devices on the TLSR825x chip operating simultaneously in Zigbee 3 and Bluetooth LE
Other
47 stars 1 forks source link

Newly flashed device works in Zigbee but not BLE OTA plus weird display cycling #4

Open tbaumann opened 8 months ago

tbaumann commented 8 months ago

Hi,

I just flashed this firmware (I liked the idea to regain BLE Flash support). First I flashed my LYWSD03MMC first with the pvvx/ATC_MiThermometer firmware and then this one. (https://github.com/pvvx/BZdevice/blob/master/bin/1141-020a-02053001-Z03MMC.zigbee)

The device was able to bind to Zigbee (ZHA) and shows temps there. (Firmware version 0x02053001)

But the Telink OTA is no longer able to connect to it. How do I still use BLE flashing? (There is a ATCz BLE device visible)

Also, how is the screen configured? I can't read or write the userInterface attributes like in https://github.com/pvvx/ZigbeeTLc/issues/28

The Display is currently cycling through C,F and --- (BT logo on all the time)

tbaumann commented 8 months ago

https://github.com/pvvx/BZdevice/assets/76476/96e5ac64-2521-4101-aa41-5e42e4166a07

tbaumann commented 8 months ago

When the --- appear the BLE connection gets disconnected. I think it's in some kind of boot loop. Also I don't think there are any zigbee updates happening. Except when the device is switched on.

pvvx commented 8 months ago

Register the thermometer to the Zigbee network. Next, Zigbee OTA is possible. BLE OTA is unstable on these versions. You may have to use TelinkOTA.html several times.


For Zigbee everything is similar https://github.com/pvvx/ZigbeeTLc/

A solid "BT" icon indicates a connection loss or the thermometer is not registered with the Zigbee network.

The Display is currently cycling through C,F and --- (BT logo on all the time)

The “reset” contact is closed to “-Vbat”.

tbaumann commented 8 months ago

The Display is currently cycling through C,F and --- (BT logo on all the time)

The “reset” contact is closed to “-Vbat”.

Unfortunately not. The pin is clear and undamaged. And the battery new. I tried to hold the reset pin down, nothing really happens. Except I think it sometimes went into zigbee pairing mode for a moment. But it retested before it could do anything.

I can't do zigbee OTA because the device doesn't actually stay on the network. If I power it off and on I sometimes get a temperature update, but anything else will not work.

Something put it into a boot loop I think.

I will try to revert back via Telink OTA, but I'm not 100% sure what .bin file to use. It doesn't like the .zigbee files..

Psytoshgen commented 8 months ago

same here....

henkiejan1 commented 8 months ago

Same here. Even flash back and clear to complete flash with the USB-COM flasher looks not fix it. The flash with USB-COM flasher looks like it goes all ok. But at the end exactly the same thing is happy: it hangs in the look like post above

pvvx commented 8 months ago

Try to reflash with preliminary erasing of the entire flash. (This will also change the MAC on the device. It will exclude the possibility that the current MAC address is already stuck somewhere...) However, this has a greater impact on BLE, since capacitor calibrations for quartz and binding BLE setup is loaded from Flash. After erasing them everything works fine. And if there is garbage there, there may be problems. For Zigbee, it is enough to perform a reset by connecting the “reset” pin to “-Vbat” for a while as described in the general instructions... I have never observed the problems with ZHA described here. And my count of the number of firmwares with various options has long exceeded a thousand... Zigbee very rarely gets stuck during registration. But this is due to the coordinator, the channel load (in the HA log there is a warning about 95% of the channel load) and the software in the HA. After a subsequent reset, the binding is guaranteed to work. An EFR32MG21 coordinator with an Ethernet connection is used.

In the Zigbee coordinator compiled from the Telink SDK for debugging, registration and binding of clusters always succeeds. A different radio channel is used, where all my other Zigbee devices do not work and do not interfere...

I don't use Z2M - Z2M has too many problems.

henkiejan1 commented 7 months ago

I am happy. I got restored it and it works again with the only Zigbee firmware.

Things i did:

  1. Connected the wires as described on https://zigbee.blakadder.com/Xiaomi_LYWSD03MMC.html (For me i use a ESP8266 as usb to serial adapter. The reason: i am so sure that it will use 3.3V and not 5V what a lot adapters do. I uploaded before connecting to the temperature sensor this very simple sketch.
  2. As described i flashed with USB-COM tool from you @pvvx https://pvvx.github.io/ATC_MiThermometer/USBCOMFlashTx.html with for me the original Xiaomi firmware: this one.
  3. after that: i removed the reset cable and the 100kOhm transistor / rx wire and reboot
  4. Device came available in bluetooth devices. Connected to it with Telink OTA tool of @pvvx and with the correct zigbee firmware
  5. After reboot it joins to the Zigbee network without any problems.

Strange enough when i flashed direct z03mmc.bin to the sensor it would not come available or joins my Zigbee network. Maybe i did something wrong. But anyways it's nice my sensor works again! :)