Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

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

Closed
roobbb opened this issue Jan 19, 2022 · 5 comments
Closed

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

roobbb opened this issue Jan 19, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@roobbb
Copy link

roobbb commented Jan 19, 2022

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.

  1. 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:

  • a MQTT set command what reboots the entire GW?
    So I could be able to reboot it periodically.
  • a MQTT get command which gets the actual socket state?
    So I could send it out of my smart home system periodically and pull the information actively.
  • What does the MQTT command "{cmd:"rst_zig"} - restart Zigbee module" exactly do?

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
Copy link
Owner

xyzroe commented Jan 19, 2022

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.
3. 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
Copy link
Author

roobbb commented Jan 20, 2022

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 xyzroe added the bug Something isn't working label Jan 26, 2022
@xyzroe
Copy link
Owner

xyzroe commented Jan 26, 2022

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
Copy link
Owner

xyzroe commented Jan 28, 2022

  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.

xyzroe added a commit that referenced this issue Jan 30, 2022
- Add support for DS18B20 sensor. Works only on TTGO using GPIO 33. Shows in web browser
    and sends via MQTT with AutoDiscovery. Works only when the sensor is connected.

- Number of active socket clients reduced to 5 to avoid hangs. Maybe #10

- Number of active socket clients now sends via MQTT with auto-discovery. Using MQTT Refresh Interval. #9

- Automatically reconnect to a Wi-Fi hotspot after being disconnected, but you still need
    the hotspot to be available during the gateway reboot, otherwise it will start its own hotspot. #8

- Add a checkbox to disable emergency mode in Wi-Fi settings. #11

0.6.2

- Set MQTT reconnect interval same as MQTT update interval to avoid web server freezing,
    while broker is unavailable.

- Added web authentication. Issue #4
    Set to OFF by default, enable on general settings page.

- Blocking saving an empty hostname, login and password to the web interface.
    Replaced with standard values ( ZigStarGM / admin / admin )
xyzroe added a commit that referenced this issue Jan 31, 2022
- Fix version number

- Fix web interface rendering error

0.6.3

- Add support for DS18B20 sensor. Works only on TTGO using GPIO 33. Shows in web browser
    and sends via MQTT with AutoDiscovery. Works only when the sensor is connected.

- Number of active socket clients reduced to 5 to avoid hangs. Maybe #10

- Number of active socket clients now sends via MQTT with auto-discovery. Using MQTT Refresh Interval. #9

- Automatically reconnect to a Wi-Fi hotspot after being disconnected, but you still need
    the hotspot to be available during the gateway reboot, otherwise it will start its own hotspot. #8

- Add a checkbox to disable emergency mode in Wi-Fi settings. #11
@roobbb
Copy link
Author

roobbb commented Apr 7, 2022

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

@xyzroe xyzroe closed this as completed May 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants