jim-easterbrook / pywws

Python software for USB Wireless WeatherStations
https://pywws.readthedocs.io/
GNU General Public License v2.0
204 stars 62 forks source link

can't run logdata - weather station issue? #92

Closed RussH closed 4 years ago

RussH commented 4 years ago

After many years intending to set up the weatherstation with pywws, I'm following your documentation (with a Maplin weatherstation) - and an initial logdata command fails as per the below output;

pi@raspberrypi:~ $ python -m pywws.logdata -vvv ~/weather/data 20:13:02:pywws.logger:pywws version 20.1.0, build 1673 (92d8868) 20:13:02:pywws.logger:Python version 2.7.13 (default, Sep 26 2018, 18:42:22) [GCC 6.3.0 20170516] 20:13:02:pywws.weatherstation:using pywws.device_pyusb1 20:13:03:pywws.weatherstation:_read_block changing 000000 20:13:03:pywws.weatherstation:_read_block changing 000020 20:13:03:pywws.weatherstation:_read_block changing 000020 20:13:03:pywws.weatherstation:_read_block changing 000020 20:13:04:pywws.weatherstation:_read_block changing 000040 20:13:04:pywws.weatherstation:_read_block changing 000040 20:13:04:pywws.weatherstation:_read_block changing 000040 20:13:04:pywws.weatherstation:_read_block changing 000040 20:13:04:pywws.weatherstation:_read_block changing 000040 20:13:04:pywws.weatherstation:_read_block changing 000040 20:13:04:pywws.weatherstation:_read_block changing 000040 20:13:04:pywws.weatherstation:_read_block changing 000040 20:13:04:pywws.weatherstation:_read_block changing 000040 20:13:04:pywws.weatherstation:_read_block changing 000040 20:13:04:pywws.weatherstation:_read_block changing 000040 20:13:04:pywws.weatherstation:_read_block changing 000040 20:13:04:pywws.weatherstation:_read_block changing 000040 20:13:04:pywws.weatherstation:_read_block changing 000040 20:13:05:pywws.weatherstation:_read_block changing 000040 20:13:05:pywws.weatherstation:_read_block changing 000040 20:13:05:pywws.weatherstation:_read_block changing 000040 20:13:05:pywws.weatherstation:_read_block changing 000040 20:13:05:pywws.weatherstation:_read_block changing 000040 20:13:05:pywws.weatherstation:_read_block changing 000040 20:13:05:pywws.weatherstation:_read_block changing 000040 20:13:05:pywws.weatherstation:_read_block changing 000040 20:13:05:pywws.weatherstation:_read_block changing 000040 20:13:05:pywws.weatherstation:_read_block changing 000060 20:13:05:pywws.weatherstation:_read_block changing 000060 20:13:05:pywws.weatherstation:_read_block changing 000060 20:13:05:pywws.weatherstation:_read_block changing 000060 20:13:05:pywws.weatherstation:_read_block changing 000060 20:13:06:pywws.weatherstation:_read_block changing 000060 20:13:06:main:Synchronising to weather station 20:13:06:pywws.storage:flushing Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main "main", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/usr/local/lib/python2.7/dist-packages/pywws/logdata.py", line 301, in sys.exit(main()) File "/usr/local/lib/python2.7/dist-packages/pywws/logdata.py", line 298, in main DataLogger(context).log_data(sync=sync, clear=clear) File "/usr/local/lib/python2.7/dist-packages/pywws/logdata.py", line 191, in log_data if last_delay > self.fixed_block['read_period'] + 1: TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

and the output from the test command is; pi@raspberrypi:~ $ pywws-testweatherstation -d -h 1
20:17:31:pywws.logger:pywws version 20.1.0, build 1673 (92d8868) {'abs_pressure': 864, 'alarm': {'abs_pressure': {'hi': 6373.6, 'lo': 2854.4}, 'dewpoint': {'hi': -51.2, 'lo': -11}, 'hum_in': {'hi': 223, 'lo': 247}, 'hum_out': {'hi': 223, 'lo': 253}, 'illuminance': 842543.6, 'rain': {'day': 15051.6, 'hour': 18460.5}, 'rel_pressure': {'hi': 6526.4, 'lo': 6547.1}, 'temp_in': {'hi': 3, 'lo': 0.4}, 'temp_out': {'hi': -253.8, 'lo': -11.2}, 'time': '145:165', 'uv': 231, 'wind_ave': {'bft': None, 'ms': 21.5}, 'wind_dir': None, 'wind_gust': {'bft': 204, 'ms': 22.4}, 'windchill': {'hi': -19.2, 'lo': 615.1}}, 'alarm_1': {'hum_out_hi': False, 'hum_in_lo': False, 'hum_in_hi': False, 'hum_out_lo': False, 'time': False, 'wind_dir': False}, 'alarm_2': {'wind_ave': False, 'wind_gust': False, 'rain_hour': False, 'pressure_rel_lo': False, 'pressure_abs_hi': False, 'rain_day': False, 'pressure_rel_hi': False, 'pressure_abs_lo': False}, 'alarm_3': {'temp_out_hi': False, 'wind_chill_lo': False, 'dew_point_lo': False, 'temp_in_lo': False, 'wind_chill_hi': False, 'temp_in_hi': False, 'temp_out_lo': False, 'dew_point_hi': False}, 'current_pos': 256, 'data_changed': 193, 'data_count': 1, 'date_time': '2010-01-01 10:00:00', 'display_1': {'wind_gust': True, 'show_day_name': True, 'show_year': True, 'time_scale_24': True, 'pressure_rel': False, 'alarm_time': False, 'date_mdy': False, 'clock_12hr': False}, 'display_2': {'temp_out_temp': False, 'rain_hour': False, 'rain_month': False, 'rain_week': False, 'temp_out_chill': False, 'rain_day': False, 'temp_out_dew': False, 'rain_total': False}, 'display_3': {'alarm_uv_hi': True, 'illuminance_fc': True, 'illuminance_wm2': True, 'alarm_illuminance_hi': True, 'bit4': True, 'bit3': True}, 'lux_wm2_coeff': 4937.6, 'magic_0': 85, 'magic_1': 170, 'max': {'abs_pressure': {'date': '2010-01-01 12:00:00', 'val': 6550.3}, 'dewpoint': {'date': '2010-01-01 12:00:00', 'val': 0}, 'hum_in': {'date': '2010-01-01 12:00:00', 'val': 0}, 'hum_out': {'date': '2010-01-01 12:00:00', 'val': 128}, 'illuminance': {'date': '2001-01-01 01:01:00', 'val': 291452.7}, 'rain': {'day': {'date': '2010-01-01 12:00:00', 'val': 0}, 'hour': {'date': '2010-01-01 12:00:00', 'val': 0}, 'month': {'date': '2010-01-01 12:00:00', 'val': 0}, 'total': {'date': '2010-01-01 12:00:00', 'val': 0}, 'week': {'date': '2010-01-01 12:00:00', 'val': 0}}, 'rel_pressure': {'date': '2010-01-01 12:00:00', 'val': 6543.9}, 'temp_in': {'date': '2010-01-01 12:00:00', 'val': 19.2}, 'temp_out': {'date': '2010-01-01 12:00:00', 'val': 0}, 'uv': {'date': '2000-01-01 01:01:00', 'val': 225}, 'wind_ave': {'date': '2010-01-01 12:00:00', 'val': 6054.3}, 'wind_gust': {'date': '2010-01-01 12:00:00', 'val': 0}, 'windchill': {'date': '2010-01-01 12:00:00', 'val': 0}}, 'min': {'abs_pressure': {'date': '2010-01-01 12:00:00', 'val': 2917.9}, 'dewpoint': {'date': '2010-01-01 12:00:00', 'val': -1763.9}, 'hum_in': {'date': '2010-01-01 12:00:00', 'val': 0}, 'hum_out': {'date': '2010-01-01 12:00:00', 'val': 56}, 'rel_pressure': {'date': '2010-01-01 12:00:00', 'val': 6540}, 'temp_in': {'date': '2010-01-01 12:00:00', 'val': -2452.6}, 'temp_out': {'date': '2010-01-01 12:00:00', 'val': 0}, 'windchill': {'date': '2010-01-01 12:00:00', 'val': 0}}, 'rain_factor_raw': 257, 'read_period': None, 'rel_pressure': 1012.8, 'settings_1': {'pressure_hPa': True, 'temp_out_F': False, 'rain_in': False, 'temp_in_F': False, 'pressure_inHg': True, 'pressure_mmHg': True}, 'settings_2': {'wind_bft': False, 'wind_mps': False, 'wind_knot': False, 'bit7': True, 'bit6': True, 'bit5': True, 'wind_kmph': False, 'wind_mph': False}, 'timezone': 3, 'unknown_01': 0, 'unknown_18': 131, 'wind_factor_raw': 257} min -> temp_out -> {'date': '2010-01-01 12:00:00', 'val': 0} alarm -> hum_out -> {'lo': 253, 'hi': 223} rel_pressure -> 1012.8 abs_pressure -> 864 Recent history 0x0100 2020-02-27 20:17:00 {'abs_pressure': 1018.1, 'delay': 1, 'hum_in': 33, 'hum_out': 63, 'rain': 261.9, 'status': {'rain_overflow': False, 'lost_connection': False}, 'temp_in': 24.2, 'temp_out': 4, 'wind_ave': 1, 'wind_dir': 11, 'wind_gust': 1.7}

...any clues?