On 19/01/2024 16:09, '
runge....@googlemail.com' via pywws wrote:
>
> But now i get this problem nearly every day, after i have cleaned my
> outside sensors.
I wonder what changed?
> So i checked the logs more in detail and read your documentation.
> I get:
> 2024-01-19 15:59:06:pywws.weatherstation:live_data lost sync -3.39785
> and after that i loose the USB connection.
> I adapted
> usb activity margin = 3.9
> but also this seems not to help.
The number shown in the "lost sync" message isn't really an indicator of
what margin is required. I think it will always be larger than your
current margin.
If you have an old backup of your data file you could have a look in
status.ini at the "sensor drift" value. The activity margin needs to
exceed the larger of the (absolute) drift values by at least 0.5 seconds.
You could try setting the margin to something larger, e.g. 6 seconds,
and see if things get any more stable.
> You write:
> " The clock drifts are measured at approximately 24 hour intervals. If
> pywws loses synchronisation with your station it will measure them
> again. Doing this measurement increases the risk of causing a USB
> lockup, so if pywws often loses synchronisation you should try and find
> out why it’s happening."
Yeah, that's not very helpful is it?
With hindsight I think I was wrong to try and synchronise to the
station's clocks. It was an OK thing to do before stations started
locking up but now it seems to be more trouble than it's worth.
Taking one reading every 15 seconds and declaring it to be the current
weather is probably good enough. (It's what the EasyWeather software
does.) Reading multiple times to see when it changes (what pywws does)
doesn't seem so clever now.
> But how can i find out why it is happening? Is it just bad reception? I
> can move my base station to a better place if this might help.
Probably not due to bad reception.
> Do you have an idea what i can check or do?
If you can bear not having 'live' logging then you could set "logdata
sync" to zero and run pywws-hourly at twice your logging interval. This
should poll the station much less often and reduce your chances of lockup.
> Here is the interesting part of the log from today where i lost the USB
> connection,
> interesting that two times after each other it looses the sync.
>
> 2024-01-19 15:54:20:pywws.weatherstation:live_data lost sync -3.29565
> 2024-01-19 15:54:20:pywws.weatherstation:old data {'illuminance': 2329,
> 'uv': 0, 'delay': 0, 'hum_in': 62, 'temp_in': 20.1, 'hum_out': 75,
> 'temp_out': 0.4, 'abs_pressure': 997.2, 'wind_ave': 0, 'wind_gust': 0,
> 'wind_dir': 8, 'rain': 78, 'status': {'lost_connection': False,
> 'rain_overflow': False}}
> 2024-01-19 15:54:20:pywws.weatherstation:new data {'illuminance': 0,
> 'uv': 0, 'delay': 5, 'hum_in': 71, 'temp_in': 19.7, 'hum_out': 86,
> 'temp_out': 8.6, 'abs_pressure': 989.7, 'wind_ave': 1, 'wind_gust': 1.7,
> 'wind_dir': 4, 'rain': 22.5, 'status': {'lost_connection': False,
> 'rain_overflow': False}}
This is why it loses sync - nothing to do with clock drift but because
of an unexpected data change. Note that all the readings change, with an
abrupt change in air pressure and a decrease in the total rain. This
looks like picking up very old data, maybe from reading the wrong memory
address.
> 2024-01-19 15:59:06:pywws.weatherstation:live_data lost sync -3.39785
> 2024-01-19 15:59:06:pywws.weatherstation:old data {'illuminance':
> 2004.7, 'uv': 0, 'delay': 0, 'hum_in': 62, 'temp_in': 20.1, 'hum_out':
> 75, 'temp_out': 0.3, 'abs_pressure': 997.4, 'wind_ave': 0, 'wind_gust':
> 0, 'wind_dir': 8, 'rain': 78, 'status': {'lost_connection': False,
> 'rain_overflow': False}}
> 2024-01-19 15:59:06:pywws.weatherstation:new data {'illuminance': 0,
> 'uv': 0, 'delay': 5, 'hum_in': 71, 'temp_in': 19.7, 'hum_out': 86,
> 'temp_out': 8.6, 'abs_pressure': 989.9, 'wind_ave': 1.4, 'wind_gust': 2,
> 'wind_dir': 14, 'rain': 22.5, 'status': {'lost_connection': False,
> 'rain_overflow': False}}
This is almost the same wrong data, probably the next wrong address to
the previous wrong one.
The two readings are five minutes apart. I assume that's your logging
interval. When the logging interval is reached the station increments
the "current data" pointer and pywws starts reading data from the new
address. In your case it looks as if the station hasn't yet written new
data to to the new current data pointer so you get old data. I've not
seen this behaviour before.
If you run live logging with high verbosity (in a terminal rather than a
background task writing to log files) you should see it log when the
data pointer changes.
It might be possible to modify pywws to ignore the "new" data if it's
obviously wrong. In this case the 'delay' value jumping from 0 to 5 is
proof of wrong data.
--
Jim Easterbrook <
http://www.jim-easterbrook.me.uk/>