xyzroe / ZigStarGW-FW

ZigStar LAN Gateway - Firmware
GNU General Public License v3.0
87 stars 24 forks source link

ZigStar Ethernet GW: get MQTT socket state and reboot cmd #9

Closed roobbb closed 2 years ago

roobbb commented 2 years ago

Hello.

I have bought your ZigStar Ethernet GW which is working very well and I really appreciate it (it's working inside a DIN rail box). It is absolutely worth the money. Great work!

Even the MQTT functionality (sending information of the GW itself) comes in very handy. I have noticed the following behavior while having the GW running: 1) socket report over MQTT When the GW was started and zigbee2mqtt is online, the GW reports socket as ON. Unfortunately after almost 5 days the GW reports socket OFF, but zigbee2mqtt is still online. Even when I check the ZigstarGW web interface, it states there socket is online by a green check mark. When I restart zigbee2mqtt or the GW it reports socket ON again. But 5 days later it reports socket OFF. All other MQTT reports, e.g. temperature, are still working fine.

2) Web interface of the GW About ten days after the socket is reported as OFF the web interface of the GW becomes unreachable.

I tried to reboot the GW be sending out "ZigStarGW-9549/cmd {cmd:"rst_esp"}" but it didn't help in both cases. I have to power it off and on to get the web interface back and I have to restart zigbee2mqtt to get the socket state.

3) restart Zigbee module Because of 1) and 2) I even tried the MQTT command ZigStarGW-9549/cmd {cmd:"rst_zig"} to restart the Zigbee module. I tested it several times and after that the Zigbee system stopped its communication. I had to take off the GW's power again.

Could you please help me with these questions: Is it possible to implement:

Thank you very much and kind regards

---------- some screenshots --------------------------- socket state in ZigStar webif ZigstarGW_MQTT_state_in_smarthome

socket state in my smart home system ZigstarGW_webif

xyzroe commented 2 years ago

Greetings!

Thank you for your observations and detailed description of the noticed bugs.

1 and 2 I will try to repeat them and after I will search and fix it.

  1. After restarting the Zigbee module, of course, the network operation stops, it is necessary to restart the zigbee2mqtt. There is no need to reboot the power gateway.

Your questions:

  1. Reboot ESP reboots the entire gateway.
  2. The status of the socket connection is already visible in MQTT, it does not need to be requested.
  3. Restart Zigbee module just restart Zigbee module using RST pin.
roobbb commented 2 years ago

Hello.

Thank you very much for your quick response 😀 I was not sure if the behavior I observed was actually caused by bugs. This is what you can say far better than me of course. So I stay tuned for the results you will find out. Please let me know if you need further information or testing.

Best regards

xyzroe commented 2 years ago

On the first point - there was an understanding where the problem came from. If the socket connection rises faster than the MQTT, then report as OFF. There will be a fix soon.

The second point - with an inaccessible web interface, there is no possibility to repeat it yet, the uptime is too small. I accidentally rebooted because I mixed up the IP addresses.

xyzroe commented 2 years ago
  1. Reboot ESP reboots the entire gateway.

My mistake. Reboot ESP reboots just ESP, without Zigbee. To reboot entire GW you need to send command to reboot zigbee and then another command to reboot ESP.

roobbb commented 2 years ago

Hello.

Does it mean the problem should be fixed? I could try to update the firmware by the OTA-option. Do you think that should work or is it too risky and could brick my device?

Thanks a lot and kind regards