Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket connection and MQTT need to be stoped while Zigbee flash #70

Open
xyzroe opened this issue Jun 9, 2024 · 15 comments
Open

Socket connection and MQTT need to be stoped while Zigbee flash #70

xyzroe opened this issue Jun 9, 2024 · 15 comments
Labels
bug Something isn't working

Comments

@xyzroe
Copy link
Owner

xyzroe commented Jun 9, 2024

          So I need to add socket connection and MQTT stoping mechanism. Ok.

Originally posted by @xyzroe in #63 (comment)

@xyzroe
Copy link
Owner Author

xyzroe commented Jun 9, 2024

But serial already didn't work while Zigbee flashing. And MQTT doesn't interfere at all.
@jdm09 could you try again but disabling only ZHA ?

@jdm09
Copy link

jdm09 commented Jun 9, 2024

I tried these steps:

  1. ZHA & MQTT enabled and connected -> Coordinator stucks at several progress states (72,3, 83 or 96%). Sometimes the Coordinator restarts and doesnt come back to life. After a power cycle i get the Website again back to life but ZHA Connection always stucks. MQTT Connection was established.
  2. ZHA disabled, MQTT enabled -> Update succeeded but the Coordinator restarts after update and wont response. After a power cycle everything works well (HA ZHA Connection & MQTT Connection)
  3. ZHA enabled & MQTT disabled -> Same as 1.

So i think may a ZHA or Socket Connection stop mechanism should work properly.

Thanks very much for your support!

@xyzroe
Copy link
Owner Author

xyzroe commented Jun 9, 2024

Thanks for your feedback

@LeonArmston
Copy link

Yes a handy hint would be to tell people they might want to shutdown their instance of Zigbee2MQTT or ZHA down whilst updating Zigbee. I was only able to update OTA by stopping Zigbee2MQTT

@xyzroe
Copy link
Owner Author

xyzroe commented Jun 10, 2024

It seems to me that if you are going to update the firmware of a device, it would be logical to stop using it while the firmware is being updated.

@LeonArmston
Copy link

It seems to me that if you are going to update the firmware of a device, it would be logical to stop using it while the firmware is being updated.

Indeed - I was putting this message up and suggesting a warning so future me remembers to stop Zigbee2MQTT first (or otherwise it freezes during the flash at x%). 💯

@jdm09
Copy link

jdm09 commented Jun 10, 2024

Because of the Zigbee FW Bug koenkk ZG FW Bug on P7 Coordinators #496
i had to update this. Now i had the XZG Fail as discussed above: ZHA was disabled, MQTT enabled and connected. While Update Process, it stopped again at xx % and i had to power cycle to get WebUI back to life. After that i disabled MQTT also and ZB FW Update finished successfully.

Would be great, if you could post a warning note or disable ZHA and MQTT before update starts. Thanks a lot for this support here!

@xyzroe
Copy link
Owner Author

xyzroe commented Jun 10, 2024

Guys, thanks a lot for your feedback. I'll keep it in mind.

@xyzroe xyzroe added the bug Something isn't working label Jun 10, 2024
@xyzroe
Copy link
Owner Author

xyzroe commented Jun 10, 2024

@LeonArmston @jdm09
try please this one, without disabling ZHA and MQTT

@jdm09
Copy link

jdm09 commented Jun 11, 2024

I updated to new XZG:
ESP Update worked good. ZG FW Update worked also partial as expected (update process hangs at 96... % but ZG Gateway restarted and i could reach the gui with a new session. Old session hangs). After Restart MQTT connected to broker, but ZHA Socked doesn't connect. Even a HomeAssistant restart doesn't get ZHA Connection back to work. I really has to disable ZHA in HA, start the ZG FW Update again (this time i get till 100% with succeed message and ZG Gateway restarts). Then i activated the ZHA in HA again and everything is working well.

So it's not a 100% solution, but it's on a good way :)

@Jeppedy
Copy link

Jeppedy commented Jul 14, 2024

Help me out here... What's the clean process for upgrading the Zigbee firmware, or the ESP32 firmware?
I was working just fine (though a new user) and upgraded to the 10-July Zigbee firmware and all hell has broken loose.
I have rolled back the update. I've rebooted everything repeatedly. Everything seems to be working, I'm getting updates to the MQTT topics from my devices. But Z2M can't seem to reach any of my devices.
The hardest part is there's no real debugging available. How can I be seeing updates in MQTT and yet Z2M says it can't connect to any of my devices.
Any help here? How am I supposed to properly update the UZG-01?

@Jeppedy
Copy link

Jeppedy commented Jul 14, 2024

It seems to me that if you are going to update the firmware of a device, it would be logical to stop using it while the firmware is being updated.

I could agree with you, but unless you are deep into Zigbee communications, this is how it appears to people:
So, this device has an update available.
I tell it to update.
I expect the device will do whatever it needs to do to update properly.

I don't usually have to think about what else may be going on when I tell a device to update.
And if I AM supposed to stop the Zigbee communications, how do I disconnect the UZG-01/XZG device from the airwaves and Z2M and still tell it to update? Why would I need to shut down Z2M? Can't the UZG-01/XZG just "stop talking", do the upgrade, then start talking again??

@xyzroe
Copy link
Owner Author

xyzroe commented Jul 14, 2024

Help me out here... What's the clean process for upgrading the Zigbee firmware, or the ESP32 firmware? I was working just fine (though a new user) and upgraded to the 10-July Zigbee firmware and all hell has broken loose. I have rolled back the update. I've rebooted everything repeatedly. Everything seems to be working, I'm getting updates to the MQTT topics from my devices. But Z2M can't seem to reach any of my devices. The hardest part is there's no real debugging available. How can I be seeing updates in MQTT and yet Z2M says it can't connect to any of my devices. Any help here? How am I supposed to properly update the UZG-01?

  1. Updating any firmware requires stopping the software managing the Zigbee network before the update or restarting it immediately after the update.
  2. Your mistake was that you started doing everything at once instead of understanding what was happening and how to proceed correctly.
  3. If your devices are in MQTT but not in z2m, then another software is processing the Zigbee network messages. You should not use two software products simultaneously unless you are well-versed in this.
  4. You need to debug not the XZG but the software solution that is connected to the gateway. It seems you are using z2m, but likely not only it.
  5. It seems to me that you have added your coordinator to ZHA without realizing it.

@xyzroe
Copy link
Owner Author

xyzroe commented Jul 14, 2024

I could agree with you, but unless you are deep into Zigbee communications, this is how it appears to people: So, this device has an update available. I tell it to update. I expect the device will do whatever it needs to do to update properly.

I don't usually have to think about what else may be going on when I tell a device to update. And if I AM supposed to stop the Zigbee communications, how do I disconnect the UZG-01/XZG device from the airwaves and Z2M and still tell it to update? Why would I need to shut down Z2M? Can't the UZG-01/XZG just "stop talking", do the upgrade, then start talking again??

  1. XZG firmware, like UZG gateways and similar devices, are not end-consumer products. Let's call them smart home enthusiast products intended for testing and debugging software solutions. All responsibility lies with you, and understanding the processes is required.
  2. The device does everything necessary for the update on its own. Your mistake occurred after the update was completed.
  3. You do not need to disconnect the device for the update, only stop/restart the software you are using.
  4. After the firmware update, the device is "clean" and needs to be brought back to a working state, which z2m does during its startup process. It is not necessary to stop z2m; the gateway will stop communicating with z2m on its own, but you must restart z2m immediately after the update. Many users prefer to stop z2m before the update and start it afterward to be safe. This is because z2m can make a backup of the coordinator's memory during shutdown (on a clean firmware, this would be an empty backup), but not all software solutions have this behavior.

@Jeppedy
Copy link

Jeppedy commented Jul 14, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants