Author Topic: FineOffset restart automatically  (Read 720 times)

0 Members and 1 Guest are viewing this topic.

Offline pila

  • Member
  • *
  • Posts: 9
FineOffset restart automatically
« on: September 15, 2019, 10:32:36 AM »
Since my weewx install is less than twoo weeks old, my FineOffset WS1080 did not jet hang up on me. But it is to expect it will. Now I see there is only provision to kill the power to the USB hub when that occurs.

I would prefer to have ability to call my local script to perform desired actions needed to restart dead USB link to FineOffset station. Or at least to see some alarm that can be read automatically from an outside script.

I was thinking: Zero with weewx powers my FineOffset via USB cable with batteries removed. When weewx sees there is no more communication to my FineOffset, it simply restarts Zero cutting the power to the attached USB for a moment. If that is not enough, then Zero instructs a SmartSwitch to kill its power and restore it 5 or 10 or 15 seconds later. That should reset FineOffset for sure and fix USB link.

But do do this, we need a weewx hook into a restart script.

Now, I have no clue how to detect if my FineOffset locks up. My current hope is that I will see the "Signal Quality" is not 100% which may be wrong assumption.



Offline galfert

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 6822
Re: FineOffset restart automatically
« Reply #1 on: September 15, 2019, 10:51:01 AM »
I did a similar thing with a Meteobridge and then used IFTTT with a smart power switch.
https://www.wxforum.net/index.php?topic=34948.msg357305#msg357305

I'm not familiar enough with WeeWx. But there would need to be some sort of trigger on bad data, no data, or unchanged data after x amount of time.
Ecowitt GW1000 | Meteobridge on Raspberry Pi
WU: KFLWINTE111  |  PWSweather: KFLWINTE111
CWOP: FW3708  |  AWEKAS: 14814
Windy: pws-f075acbe
Weather Underground Issue Tracking
Tele-Pole

Offline pila

  • Member
  • *
  • Posts: 9
Re: FineOffset restart automatically
« Reply #2 on: September 15, 2019, 10:57:15 AM »
I will read it. For a starters, seems like completely different environment, but the idea is the same.

For now, I do not know how to realialby get an alarm or a hook from weewx should an USB problem arise.

Offline galfert

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 6822
Re: FineOffset restart automatically
« Reply #3 on: September 15, 2019, 11:09:20 AM »
Here is a script to send out email alerts if a certain condition is met.

https://github.com/weewx/weewx/blob/master/examples/alarm.py

This example code uses the following condition:
outTemp < 40.0

But you could change that part of the code to be anything you want. If you find out what condition occurs when the station USB is frozen then you could use that as a trigger condition.
« Last Edit: September 15, 2019, 11:13:11 AM by galfert »
Ecowitt GW1000 | Meteobridge on Raspberry Pi
WU: KFLWINTE111  |  PWSweather: KFLWINTE111
CWOP: FW3708  |  AWEKAS: 14814
Windy: pws-f075acbe
Weather Underground Issue Tracking
Tele-Pole

Offline pila

  • Member
  • *
  • Posts: 9
Re: FineOffset restart automatically
« Reply #4 on: September 15, 2019, 11:19:11 AM »
Thanks, excellent start :)

Python is not my thing, but I only need the script to say. reboot the Zero, or send out some other command to the shell, so I shold be able to find out how to do it.

What expresion to use as the sure sign USB went down? What will occur? Would all latest variables simply be empty? And will generated report contain empty values?

So, could I test: if inTemp (Inside Temperature) is an empty string/variable?


Offline pila

  • Member
  • *
  • Posts: 9
Re: FineOffset restart automatically
« Reply #5 on: September 17, 2019, 06:07:26 AM »
Funny thing: this morning, I looked at the graphs and I could see few hours hap in the morning. But, it reconnected later. Funny.

Then I saw that the Inside temp has no breaks. Obviously, my batteries must have worn out, they are probably 6-7 years in service there, so I can not blame them.

I plan on using Weewx data for some of my SmartHome aspects. Buttons and statuses will be on its Smartphone page. This may not be a standard way, but to interface with the values, I made a script that will simply parse the weewx generated HTML page and extract info I need.

It is best if I put reboot of the Zero in there if I find that the inside temperature is empty. I plan to chron my script probably once in 5 minutes after weewx generates pages.

 

anything