captain-coredump / weatherflow-udp

WeatherFlow Personal Weather Station driver for weewx, via UDP broadcast packets
GNU General Public License v3.0
53 stars 18 forks source link

WeatherflowUDP can not fetch data from WeatherFlow webservice #23

Closed kalju closed 1 year ago

kalju commented 1 year ago

Hi all,

First of all - Merry Christmas!

My Weewx installation fails to start with following error:

weewx[2060] CRITICAL main: Caught unrecoverable exception: weewx[2060] CRITICAL main: Could not fetch records from WeatherFlow webservice: <Response [500]> weewx[2060] CRITICAL main: Traceback (most recent call last): weewx[2060] CRITICAL main: File "/usr/share/weewx/weewxd", line 154, in main weewx[2060] CRITICAL main: engine.run() weewx[2060] CRITICAL main: File "/usr/share/weewx/weewx/engine.py", line 178, in run weewx[2060] CRITICAL main: self.dispatchEvent(weewx.Event(weewx.STARTUP)) weewx[2060] CRITICAL main: File "/usr/share/weewx/weewx/engine.py", line 245, in dispatchEvent weewx[2060] CRITICAL main: callback(event) weewx[2060] CRITICAL main: File "/usr/share/weewx/weewx/engine.py", line 584, in startup weewx[2060] CRITICAL main: self._catchup(self.engine.console.genStartupRecords) weewx[2060] CRITICAL main: File "/usr/share/weewx/weewx/engine.py", line 697, in _catchup weewx[2060] CRITICAL main: for record in generator(lastgood_ts): weewx[2060] CRITICAL main: File "/usr/share/weewx/user/weatherflowudp.py", line 620, in genStartupRecords weewx[2060] CRITICAL main: for packet in readDataFromWF(sincets + 1, self., self._devices, self._device_dict, self._batch_size): weewx[2060] CRITICAL main: File "/usr/share/weewx/user/weatherflowudp.py", line 329, in readDataFromWF weewx[2060] CRITICAL main: raise DriverException("Could not fetch records from WeatherFlow webservice: {}".format(response)) weewx[2060] CRITICAL main: user.weatherflowudp.DriverException: Could not fetch records from WeatherFlow webservice: <Response [500]> weewx[2060] CRITICAL main: Exiting.

I have set token = TOKEN in the WeatherFlowUDP configuration. I can access both https://swd.weatherflow.com/swd/rest/observations/device/DEVICE_ID?token=TOKEN and https://swd.weatherflow.com/swd/rest/stations?token=TOKEN In both cases request returns proper reply.

This issue surfaced when I restarted server and noticed that Weewx did not start. I have not changed any configurations.

Any ideas what's wrong?

Thanks in advance!

fcaron71 commented 1 year ago

Same problem here. Stopped working 2022-12-26 00:05 (last successful publication) Log dump: Dec 26 00:08:05 raspberrypi weewx[11054] INFO main: Received signal TERM (15). Dec 26 00:08:05 raspberrypi weewx[11054] INFO weewx.engine: Main loop exiting. Shutting engine down. Dec 26 00:08:05 raspberrypi weewx[11054] INFO weewx.engine: Shutting down StdReport thread Dec 26 00:08:05 raspberrypi weewx[11054] INFO main: Terminating weewx version 4.9.1 Dec 26 00:08:05 raspberrypi weewx[24532]: Stopping weewx weather system: weewx. Dec 26 00:09:04 raspberrypi weewx[24662] INFO main: Initializing weewx version 4.9.1 Dec 26 00:09:04 raspberrypi weewx[24662] INFO main: Using Python 3.7.3 (default, Jan 22 2021, 20:04:44) #012[GCC 8.3.0] Dec 26 00:09:04 raspberrypi weewx[24662] INFO main: Located at /usr/bin/python3 Dec 26 00:09:04 raspberrypi weewx[24662] INFO main: Platform Linux-5.10.103-v7l+-armv7l-with-debian-10.13 Dec 26 00:09:04 raspberrypi weewx[24662] INFO main: Locale is 'fr_CA.UTF-8' Dec 26 00:09:04 raspberrypi weewx[24662] INFO main: Using configuration file /etc/weewx/weewx.conf Dec 26 00:09:04 raspberrypi weewx[24662] INFO main: Debug is 0 Dec 26 00:09:04 raspberrypi weewx[24662] INFO main: PID file is /var/run/weewx.pid Dec 26 00:09:04 raspberrypi weewx[24666] INFO weewx.engine: Loading station type WeatherFlowUDP (user.weatherflowudp) Dec 26 00:09:04 raspberrypi weewx[24651]: Starting weewx weather system: weewx. Dec 26 00:09:05 raspberrypi weewx[24666] INFO user.weatherflowudp: driver version is 1.13 Dec 26 00:09:05 raspberrypi weewx[24666] INFO user.weatherflowudp: sensor map is {'outTemp': 'air_temperature.ST-00091710.obs_st', 'outHumidity': 'relative_humidity.ST-00091710.obs_st', 'pressure': 'station_pressure.ST-00091710.obs_st', 'outTempBatteryStatus': 'battery.ST-00091710.obs_st', 'windSpeed': 'wind_speed.ST-00091710.rapid_wind', 'windDir': 'wind_direction.ST-00091710.rapid_wind', 'lux': 'illumance.ST-00091710.obs_st', 'UV': 'uv.ST-00091710.obs_st', 'rain': 'rain_accumulated.ST-00091710.obs_st', 'windBatteryStatus': 'battery.ST-00091710.obs_st', 'radiation': 'solar_radiation.ST-00091710.obs_st', 'txBatteryStatus': 'battery.ST-00091710.obs_st'} Dec 26 00:09:05 raspberrypi weewx[24666] INFO user.weatherflowudp: * Sensor names per packet type Dec 26 00:09:05 raspberrypi weewx[24666] INFO user.weatherflowudp: packet obs_air: ('time_epoch', 'station_pressure', 'air_temperature', 'relative_humidity', 'lightning_strike_count', 'lightning_strike_avg_distance', 'battery', 'report_interval') Dec 26 00:09:05 raspberrypi weewx[24666] INFO user.weatherflowudp: packet obs_sky: ('time_epoch', 'illuminance', 'uv', 'rain_accumulated', 'wind_lull', 'wind_avg', 'wind_gust', 'wind_direction', 'battery', 'report_interval', 'solar_radiation', 'local_day_rain_accumulation', 'precipitation_type', 'wind_sample_interval') Dec 26 00:09:05 raspberrypi weewx[24666] INFO user.weatherflowudp: packet rapid_wind: ('time_epoch', 'wind_speed', 'wind_direction') Dec 26 00:09:05 raspberrypi weewx[24666] INFO user.weatherflowudp: packet evt_precip: ('time_epoch',) Dec 26 00:09:05 raspberrypi weewx[24666] INFO user.weatherflowudp: packet evt_strike: ('time_epoch', 'distance', 'energy') Dec 26 00:09:05 raspberrypi weewx[24666] INFO user.weatherflowudp: packet obs_st: ('time_epoch', 'wind_lull', 'wind_avg', 'wind_gust', 'wind_direction', 'wind_sample_interval', 'station_pressure', 'air_temperature', 'relative_humidity', 'illuminance', 'uv', 'solar_radiation', 'rain_accumulated', 'precipitation_type', 'lightning_strike_avg_distance', 'lightning_strike_count', 'battery', 'report_interval') Dec 26 00:09:05 raspberrypi weewx[24666] INFO weewx.engine: StdConvert target unit is 0x1 Dec 26 00:09:05 raspberrypi weewx[24666] INFO weewx.wxservices: StdWXCalculate will use data binding wx_binding Dec 26 00:09:05 raspberrypi weewx[24666] INFO weewx.engine: Archive will use data binding wx_binding Dec 26 00:09:05 raspberrypi weewx[24666] INFO weewx.engine: Record generation will be attempted in 'hardware' Dec 26 00:09:05 raspberrypi weewx[24666] INFO weewx.engine: Using archive interval of 300 seconds (specified in weewx configuration) Dec 26 00:09:05 raspberrypi weewx[24666] INFO weewx.restx: StationRegistry: Station will be registered. Dec 26 00:09:05 raspberrypi weewx[24666] INFO weewx.restx: Wunderground-PWS: Data for station ILONGU12 will be posted Dec 26 00:09:05 raspberrypi weewx[24666] INFO weewx.restx: PWSWeather: Data for station PWS1729 will be posted Dec 26 00:09:05 raspberrypi weewx[24666] INFO weewx.restx: CWOP: Data for station FW8061 will be posted Dec 26 00:09:05 raspberrypi weewx[24666] INFO weewx.restx: WOW: Posting not enabled. Dec 26 00:09:05 raspberrypi weewx[24666] INFO weewx.restx: AWEKAS: Posting not enabled. Dec 26 00:09:05 raspberrypi weewx[24666] INFO user.wcloud: service version is 0.13 Dec 26 00:09:05 raspberrypi weewx[24666] INFO user.wcloud: Data will be uploaded for id=59c3d82290000a1d Dec 26 00:09:05 raspberrypi weewx[24666] INFO weewx.engine: 'pyephem' not detected, extended almanac data is not available Dec 26 00:09:05 raspberrypi weewx[24666] INFO main: Starting up weewx version 4.9.1 Dec 26 00:09:05 raspberrypi weewx[24666] INFO weewx.engine: Using binding 'wx_binding' to database 'weewx.sdb' Dec 26 00:09:05 raspberrypi weewx[24666] INFO weewx.manager: Starting backfill of daily summaries Dec 26 00:09:05 raspberrypi weewx[24666] INFO weewx.manager: Daily summaries up to date Dec 26 00:09:05 raspberrypi weewx[24666] INFO user.weatherflowudp: Reading from 2022-12-26 05:05:00 Dec 26 00:09:05 raspberrypi weewx[24666] INFO weewx.engine: Main loop exiting. Shutting engine down. Dec 26 00:09:05 raspberrypi weewx[24666] CRITICAL main: Caught unrecoverable exception: Dec 26 00:09:05 raspberrypi weewx[24666] CRITICAL main: ** Could not fetch records from WeatherFlow webservice: <Response [500]> Dec 26 00:09:05 raspberrypi weewx[24666] CRITICAL main: Traceback (most recent call last): Dec 26 00:09:05 raspberrypi weewx[24666] CRITICAL main: File "/usr/share/weewx/weewxd", line 154, in main Dec 26 00:09:05 raspberrypi weewx[24666] CRITICAL main: engine.run() Dec 26 00:09:05 raspberrypi weewx[24666] CRITICAL main: File "/usr/share/weewx/weewx/engine.py", line 178, in run Dec 26 00:09:05 raspberrypi weewx[24666] CRITICAL main: self.dispatchEvent(weewx.Event(weewx.STARTUP)) Dec 26 00:09:05 raspberrypi weewx[24666] CRITICAL main: File "/usr/share/weewx/weewx/engine.py", line 245, in dispatchEvent Dec 26 00:09:05 raspberrypi weewx[24666] CRITICAL main: callback(event) Dec 26 00:09:05 raspberrypi weewx[24666] CRITICAL main: File "/usr/share/weewx/weewx/engine.py", line 584, in startup Dec 26 00:09:05 raspberrypi weewx[24666] CRITICAL main: self._catchup(self.engine.console.genStartupRecords) Dec 26 00:09:05 raspberrypi weewx[24666] CRITICAL main: File "/usr/share/weewx/weewx/engine.py", line 697, in _catchup Dec 26 00:09:05 raspberrypi weewx[24666] CRITICAL main: for record in generator(lastgood_ts): Dec 26 00:09:05 raspberrypi weewx[24666] CRITICAL main: File "/usr/share/weewx/user/weatherflowudp.py", line 608, in genStartupRecords Dec 26 00:09:05 raspberrypi weewx[24666] CRITICAL main: for packet in readDataFromWF(since_ts + 1, self._token, self._devices, self._device_dict, self._batch_size): Dec 26 00:09:05 raspberrypi weewx[24666] CRITICAL main: File "/usr/share/weewx/user/weatherflowudp.py", line 324, in readDataFromWF Dec 26 00:09:05 raspberrypi weewx[24666] CRITICAL main: raise DriverException("Could not fetch records from WeatherFlow webservice: {}".format(response)) Dec 26 00:09:05 raspberrypi weewx[24666] CRITICAL main: user.weatherflowudp.DriverException: Could not fetch records from WeatherFlow webservice: <Response [500]> Dec 26 00:09:05 raspberrypi weewx[24666] CRITICAL main: **** Exiting.

fcaron71 commented 1 year ago

Not sure why (and maybe it is ok, date format?) but right before it crashes it reads from Dec 26 05:05:00 while the time seems to be 00:09:05…

jjvdgeer commented 1 year ago

Late reply, I was here by coincidence. The log from @fcaron71 is from version 1.13 which is not from this repository (this one has version number 1.10) but from a branch, probably either mine or edi-x (which is a branch from mine again). I think also @kalju uses a driver not from this repository. I've released a version 1.14 of the driver that copes with this problem. You should update to that (or a version from edi-x' branch).

fcaron71 commented 1 year ago

Thanks! I eventually found out. The GitHub forking can sometimes become confusing but you end up finding what you need with a bit of patience!--FrançoisLe 9 mai 2023 à 17:38, jjvdgeer @.***> a écrit : Late reply, I was here by coincidence. The log from @fcaron71 is from version 1.13 which is not from this repository (this one has version number 1.10) but from a branch, probably either mine or edi-x (which is a branch from mine again). I think also @kalju uses a driver not from this repository. I've released a version 1.14 of the driver that copes with this problem. You should update to that (or a version from edi-x' branch).

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

kalju commented 1 year ago

@jjvdgeer thanks for the update. Grabbed your version 1.14 and it works like a charm. Closing the case.