Reboot GW1000 using monit?

106 views
Skip to first unread message

se...@bitkickers.us

unread,
Feb 15, 2021, 8:56:49 PM2/15/21
to weewx-user
Not bothering to post logs, etc., because this isn't a "problem" with the software.

Been using Weewx for a few years with Acurite 01525 but finally got fed up with the horribly flaky RF from sensors to console and recently transitioned to Ecowitt and the GW1000 with temp, wind, and rain sensors. Loving it so far although the WS View app on Android apparently had a bug that initially prevented me from configuring the gateway properly. Kudos to the Ecowitt team who were very responsive (sup...@ecowitt.com).

Browsing the weewx-user group I found https://github.com/gjr80/weewx-gw1000 and that's a delightful piece of code, every bit as good an useful as Weewx itself.

The gateway has gone offline a couple of times in the past 48 hours for reasons unknown. Its leds are flashing as if it's online, and it can sometimes be pinged so it's on the wlan, but it doesn't respond to API requests for the driver. I'd like to monitor the gateway from a monit server that I have running on my network and while I can test for the host alive and send an alert, I'd really like to monitor the gateway function itself somehow. 

If it were a linux box under the covers and had access, I could script a solution on the gateway itself but I don't think that's possible. I note in the GW1000 driver that the command list has a "reset" and "reboot" command and wonder if the driver will allow me to send either one of those by itself?

Any other suggestions?

Thanks!

    Sean

gjr80

unread,
Feb 15, 2021, 11:51:52 PM2/15/21
to weewx-user
Can't speak for Monit, haven't used it and only briefly skimmed an article on it a year or two back. Whilst the GW1000API has commands to reset and reboot the device I have not implemented them int he GW1000 driver and I have been loathed to do so. I really don't see much point in giving the driver the ability to factory reset the GW1000; if the device is factory reset you need to use the WS View app to pair/configure the device again so you might as well goto the device or use the WS View app to factory reset if such action is warranted. I could see some utility in being able to reboot the GW1000, but I suspect that in almost all situations where you would want to take such action you have lost contact with the GW1000 and I doubt you will be able to command the GW1000 to reboot via the API.

That being said WeeWX and the GW1000 driver have a couple of features that attempt recovery if contact with the GW1000 is lost. Firstly, if a driver cannot be loaded WeeWX has the ability to keep trying to load the driver every 60 seconds rather than exiting (refer loop_on_init config option in weewx.conf). Secondly, if the GW1000 driver cannot contact the GW1000 on startup, or if contact is lost during normal operation, the driver re-attempts contact a number of times and if contact cannot be made the driver will attempt to re-discover the GW1000 on the network. These may or may not work depending on the issue, the log would be need to be checked to see what the symptoms were and what WeeWX/the driver did.

Ultimately if the GW1000 cannot be contacted and cannot be discovered then there is not much that can be done short of notifying you to go and hit the reset button.

Gary

se...@bitkickers.us

unread,
Feb 16, 2021, 10:41:36 AM2/16/21
to weewx-user
If 'reset' does a factory reset, I think I agree with you - not too much value in that for me. OTOH, being able to reboot remotely, at least in my case, might be a benefit. 

While I understand the ability of Weewx and the GW1000 driver to attempt to reconnect to the gateway. Unfortunately, that doesn't solve the problem if it's alive but unresponsive.

Thanks for the reply.

   Sean

galfert

unread,
Feb 16, 2021, 10:45:39 AM2/16/21
to weewx-user
I would use a smartplug to power cycle.

vince

unread,
Feb 16, 2021, 11:30:51 AM2/16/21
to weewx-user
On Tuesday, February 16, 2021 at 7:45:39 AM UTC-8 galfert wrote:
I would use a smartplug to power cycle.


Agree for sure.

But - it should never be necessary.   I'd probably start by relocating the gateway to someplace with known solid wifi.   If that doesn't work I'd consider contacting the seller for a hardware replacement. 

My guess is you have flaky wifi.   Run a wifi scanner and see if somebody's out-radiating you nearby or running on the wrong channel and overlapping the normal bands.  It might be as simple as hard-setting your wifi to a different channel.

se...@bitkickers.us

unread,
Feb 16, 2021, 11:57:41 AM2/16/21
to weewx-user
Is the API documented online somewhere? I've not been able to find is so far.

vince

unread,
Feb 16, 2021, 12:39:25 PM2/16/21
to weewx-user
Not that I've seen.  It still seems to be under NDA.

galfert

unread,
Feb 16, 2021, 12:44:54 PM2/16/21
to weewx-user
Another solution for remote reboot, or for anything else is to run WS View in Windows with the help of NoxPlayer. Then you simply remote into that computer. NoxPlayer allows you to have a full blown Android operating system virtual machine. It lets you run Android apps inside of Windows. You need to enable the network bridge settings in NoxPlayer and then you can run WS View. 

Here is my write up on NoxPlayer to run WS View:

gjr80

unread,
Feb 16, 2021, 2:47:53 PM2/16/21
to weewx-user
On Wednesday, 17 February 2021 at 01:41:36 UTC+10 se...@bitkickers.us wrote:
If 'reset' does a factory reset, I think I agree with you - not too much value in that for me. OTOH, being able to reboot remotely, at least in my case, might be a benefit. 

While I understand the ability of Weewx and the GW1000 driver to attempt to reconnect to the gateway. Unfortunately, that doesn't solve the problem if it's alive but unresponsive.

Unfortunately having an API means of reboot does not solve your problem either as an unresponsive device is exactly that.... unresponsive.

Gary

James Batchelor

unread,
Feb 16, 2021, 3:03:17 PM2/16/21
to weewx...@googlegroups.com
If it truly needs scheduled reboot..  I am guessing .. a smart plug on the USB brick?    The again.. if WiFi is issue, smart plug may have issues too.
I have a GW1000.  it is on alllllll  the time. but it is near one of my mesh pucks.

jim




--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/2b5551ab-808f-4bb1-8faf-6a18d75a6e5cn%40googlegroups.com.

galfert

unread,
Feb 16, 2021, 3:38:44 PM2/16/21
to weewx-user
The GW1000 has a built in heath check. It is designed to ping an Internet IP address in China. Some people are not happy about that. If the GW1000 can't ping that internally set IP then it reboots. There are other health checks like it needs to also be able to reach an NTP server on the Internet...again this is internal and cannot be changed. If any of these health check issues occur it reboots. There is a thread over on wxforum.net where someone was attempting to run a GW1000 that was not connected to the Internet, because they were going to use a ham radio and solar panels and battery storage to run the thing. The project at first did not run well because the GW1000 needs Internet for these health functions. The project progressed and spoofing the NTP server and such were required in order to maintain the GW1000 running so that it wouldn't constantly reboot. 

Therefore...I see no need for a reboot function. If the GW1000 has poor connectivity to the Internet it will reboot automatically. I'm starting to suspect a bad GW1000...or you have poor WiFi coverage.

Tom Keffer

unread,
Feb 16, 2021, 5:08:23 PM2/16/21
to weewx-user

Pretty creepy that the GW1000 does that.

galfert

unread,
Feb 16, 2021, 5:16:11 PM2/16/21
to weewx-user
Yes that is the correct thread...sorry I linked to the completed project and not to the thread that dealt with the issues of running GW1000 without Internet.

vince

unread,
Feb 16, 2021, 5:27:27 PM2/16/21
to weewx-user
On Tuesday, February 16, 2021 at 2:08:23 PM UTC-8 Tom Keffer wrote:

Pretty creepy that the GW1000 does that.


Multiple people including me asked for a simple on/off switch for the watchdogs so we could run LAN-only and they said no.

At least it can be faked on the LAN if you have enough network-fu, but we shouldn't have to do stuff like that.

Their email back to me was:

    For your issue, our engineer responsed as below:
    The client's server replies with 200 OK after receiving the data and will not restart after replying with UTC time, for example:

    HTTP/1.1 200 OK
    Server: Tengine
    Content-Type: text/html; charset=UTF-8
    Content-Length: 46
    Connection: close
    Date: Sun, 01 Nov 2020 15:58:58 GMT
    Vary: Accept-Encoding

    When GW1000 receives "200 OK", it will think it is connected to the Internet, and when it receives "Date: Sun, 01 Nov 2020 15:58:58 GMT", it will synchronize time.

    The user needs to respond time to the device from the server, then the running time of the device could be correct, otherwise the rainfall statistics will be incorrect.

    We could not do that by a firmware update
.


I'm calling baloney on that last sentence, and they of course could make it discretionary.   Many (most?) don't even have a rain bucket so why would this be necessary for other folks as the general rule anyway.   Kinda bugs me to say the least.   Imagine what else could be forced that way.

(other example - WeatherFlow sets up an unencrypted MQTT session to 'their' servers)


se...@bitkickers.us

unread,
Feb 16, 2021, 6:20:20 PM2/16/21
to weewx-user
Already checked that. It's definitely the gateway that is losing its mind from time to time. If that's truly the case and it's not responding on the wlan, it's not likely that the reboot command from the driver will be received in any case. The smart plug may be the best way to go. Thanks for that thought. Off to Amazon I go. Any recommendations for a reliable one?

Graham Eddy

unread,
Feb 16, 2021, 11:29:51 PM2/16/21
to weewx...@googlegroups.com
internet our here in the bush is flakey and goes down often.
i have UPS on internet connection so have not looked out for gw1000 rebooting every 20 mins while running on battery. i will look out for it next time. *very* unsatisfactory if lack of external internet interrupts my local data collection

i would appreciate a recipe on how to bypass it (masquerading IPs to local server and spoofing http request, and ntp request?) in the gw1000 wiki, and appreciate even more it being an installation option on the driver/service

yes, i will lodge a complaint with ecowitt too. i can’t see the manufacturer changing it, but they need to be aware of the line crossed. (has anyone checked to see if it conflicts with ecowitt's declared privacy policy?)

vince

unread,
Feb 17, 2021, 11:10:20 AM2/17/21
to weewx-user
On Tuesday, February 16, 2021 at 8:29:51 PM UTC-8 graha...@gmail.com wrote:
i would appreciate a recipe on how to bypass it (masquerading IPs to local server and spoofing http request, and ntp request?) in the gw1000 wiki, and appreciate even more it being an installation option on the driver/service


You want to look on wxforum.net in the https://www.wxforum.net/index.php?board=111.0 forum there and dig through the threads there.

Faking out the gateway isn't weewx-specific so to me it's no applicable to the driver/service, and the networking stuff you need to do is way outside the scope of weewx as an app.  Basically you need to set up a fake ecowitt webserver and force the queries from the gateway to go there, not to China.    The thread I'm aware of is https://www.wxforum.net/index.php?topic=40437.0 but there might be others.  My wifi/internet is very stable so I'm not aware that I've experienced the watchdog reboots here.
 
Reply all
Reply to author
Forward
0 new messages