I have a low cost WH1080 USB Weather station, connected by USB to an intel NUC running docker (x86). These weather stations have a bug in that they occasionally lock up and stop sending data. I implemented an automated way to reset it.
With this version/model I may get one or two lockups per year, but it annoying to lose data when it happens. Earlier models it happened a lot more regularly.
The weatherstation receiver is connected and powered by USB. I had a couple of Sinilink USB XY-WFUSB (ESP8266) devices, flashed with Tasmota. I put one inline in the USB cable. Power is interrupted on command and the USB data passes though it fine.
Sinilink USB XY-WFUSB and Tasmota Flash:
Weewx setup in docker, with MQTT
I run a python setup for watching failures. I monitor one of the WeeWX MQTT topics (I watch weewx/dateTime, but it could easily be another parameter), which gives a status 0 if a regular MQTT update is given, then a 1 if the topic recovers.
Alternatively, the unix epoch time would be monitored and a failure would be if the time hadn’t updated in a valid period.
I run this in docker, with this dockerfile
FROM python:3-alpine RUN mkdir -p /app RUN pip install --upgrade pip RUN pip install requests paho-mqtt PyYAML WORKDIR /app COPY ./mqtt-watchdog/ /app/ COPY ./data/config.yaml /app/config.yaml CMD ["python", "-u", "mqtt-watchdog.py"]
and this docker-compose.yaml file
version: '3.3' services: mqtt-watchdog: build: . volumes: - "/etc/localtime:/etc/localtime:ro" - "/etc/timezone:/etc/timezone:ro" container_name: mqtt-watchdog hostname: mqtt-watchdog restart: unless-stopped
Node Red Reset and Notifications
I used Node Red to reset the USB device (turn the Sinilink off, then on again). If there was still no response from MQTT watchdog after 30 mins, it notifies me on my mobile phone via Pushover.
Additional Links & Info
Weather Station Info
Fine Offset Models info https://wiki.trixology.com/index.php?title=Fine_Offset
Eliminate the USB receiver/display for more reliability
Remove the USB Main display which may not be that reliable (hopefully my current model is more reliable than the last) and build a 433MHz receiver.
This is my setup for using an SDR and getting the data directly (I didn’t need both methods, and am happy with using WeeWX.