Giter Site home page Giter Site logo

pywws's People

Contributors

3v1n0 avatar ashenshugarret avatar chrisramsay avatar dr-seltsam avatar geekytim avatar glogiotatidis avatar jarvisms avatar jas4711 avatar jim-easterbrook avatar jpmeijers avatar matt2005 avatar mbirth avatar michlv avatar mortenf avatar myforest avatar peletiah avatar rk295 avatar rod-persky avatar sgtwilko avatar timgates42 avatar x2q avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pywws's Issues

[feature] Improve detection of WS3080

Hi.
I am facing the same issue as #49 and can reproduce the output (#49 (comment)) but with a WS3080.
However I can't find a solution to this currently but am somehow confident that this device will work either.
IMHO the hardware is very similar or even equivalent to the WH3080.
There still seems to be a problem present in the latest version.
Any help appreciated. A workaround would also be helpful.

System: Debian Bullseye (testing)
pywws-version: 20.1.0, build 1673 (92d8868) [installed via debian-repo]
Device-ID: USBDevice(0x1941, 0x8021)
Python versions: 3.8 & 3.9 (2.7 did not seem to have worked either)

See also: ad6b22f
Note: Conversion from Python 2.x to 3.x does not seem to address encoding automatically.

USBError: [Errno 110] Operation timed out

Hi Jim,
hello together,

First ... much respect for your work !! Thank you !!!

At the moment i have a problem. after a few minutes i get the USBError: [Errno 110] Operation timed out. Does somebody have an idea what i can do ?!

Thanks

Andreas

SQLite storage optimisation

I've noticed my text-based data only takes 71 MiB but after transferring everything into a SQLite database, the database is at 105 MiB.

This is probably due to floating-point numbers always being stored in 8 Bytes. However, I've also noticed my weather station (WH1080) only has 1 digit after the decimal point. So by multiplying all fp-numbers with 10, we could store them in an integer column and thus a value like e.g. 25.3 would be stored as 253 and only take 1 Byte instead of 8. A 33.4 would be stored as 334 and take 2 Bytes. So these 2 numbers alone would save 13 Bytes already.

Maybe add a config value precision that allows to set the factor by which fp-numbers are multiplied. In case other weather stations can deliver more precise numbers.

logdata.py: TypeError: unsupported operand type(s) for +: 'NoneType' and 'datetime.timedelta'

Hello,

with fresh pywws installation from git on a raspi I got this error:

$ pywws-livelog -vvv ~/weather/data

17:35:08:pywws.logger:pywws version 20.9.0, build 1679 (97fbb71)
17:35:08:pywws.logger:Python version 2.7.9 (default, Sep 17 2016, 20:26:04) 
[GCC 4.9.2]
17:35:08:pywws.weatherstation:trying USB module device_libusb1
17:35:08:pywws.weatherstation:trying USB module device_pyusb1
17:35:08:pywws.weatherstation:using pywws.device_pyusb1
'''

17:35:10:pywws.calib:Using default calibration
17:35:10:pywws.service.mqtt:template:
#idx          '"idx"             : "%Y-%m-%d %H:%M:%S",'##wind_dir     '"wind_dir_degrees": "%.d",' '' 'winddir_degrees(x)'##wind_dir     '"wind_dir_text"   : "%s",' '' 'winddir_text(x)'##wind_ave     '"wind_ave_mps"    : "%.2f",'##wind_ave     '"wind_ave_mph"    : "%.2f",' '' 'wind_mph(x)'##wind_gust    '"wind_gust_mps"   : "%.2f",'##wind_gust    '"wind_gust_mph"   : "%.2f",' '' 'wind_mph(x)'##calc 'wind_chill(data["temp_out"],data["wind_ave"])'         '"wind_chill_c" : "%.1f",'##calc 'temp_f(wind_chill(data["temp_out"],data["wind_ave"]))' '"wind_chill_f" : "%.1f",'##calc 'dew_point(data["temp_out"],data["hum_out"])'           '"dew_point_c" : "%.1f",'##calc 'temp_f(dew_point(data["temp_out"],data["hum_out"]))'   '"dew_point_f" : "%.1f",'##hum_out      '"hum_out"     : "%.d",'##hum_in       '"hum_in"      : "%.d",'##temp_in      '"temp_in_c"   : "%.1f",'##temp_in      '"temp_in_f"   : "%.1f",' '' 'temp_f(x)'##temp_out     '"temp_out_c"  : "%.1f",'##temp_out     '"temp_out_f"  : "%.1f",' '' 'temp_f(x)'##calc 'apparent_temp(data["temp_out"],data["hum_out"],data["wind_ave"])'         '"temp_out_realfeel_c" : "%.1f",'##calc 'temp_f(apparent_temp(data["temp_out"],data["hum_out"],data["wind_ave"]))' '"temp_out_realfeel_f" : "%.1f",'##rel_pressure '"pressure_rel_hpa" : "%.1f",'##rel_pressure '"pressure_rel_inhg": "%.4f",' '' 'pressure_inhg(x)'##abs_pressure '"pressure_abs_hpa" : "%.1f",'##abs_pressure '"pressure_abs_inhg": "%.4f",' '' 'pressure_inhg(x)'##rain         '"rain_mm"     : "%.1f",'##rain         '"rain_in"     : "%.2f",' '' 'rain_inch(x)'##calc 'rain_hour(data)'            '"rain_last_hour_mm": "%.1f",'##calc 'rain_inch(rain_hour(data))' '"rain_last_hour_in": "%.2f",'##calc 'rain_24hr(data)'            '"rain_last_24hours_mm": "%.1f",'##calc 'rain_inch(rain_24hr(data))' '"rain_last_24hours_in": "%.2f",'##calc 'rain_day(data)'             '"rain_day_mm": "%.1f",'##calc 'rain_inch(rain_day(data))'  '"rain_day_in": "%.2f",'#
17:35:10:pywws.logdata:Synchronising to weather station
17:35:11:pywws.weatherstation:read period 163
17:35:11:pywws.weatherstation:delay 80, pause 0.5
17:35:11:pywws.weatherstation:status {'rain_overflow': False, 'lost_connection': False}
17:35:12:pywws.weatherstation:delay 80, pause 0.5
17:35:12:pywws.weatherstation:delay 80, pause 0.5
17:35:13:pywws.weatherstation:delay 80, pause 0.5
17:35:14:pywws.weatherstation:delay 80, pause 0.5
17:35:14:pywws.weatherstation:delay 80, pause 0.5
17:35:15:pywws.weatherstation:delay 80, pause 0.5
17:35:16:pywws.weatherstation:delay 80, pause 0.5
17:35:16:pywws.weatherstation:delay 80, pause 0.5
17:35:17:pywws.weatherstation:delay 80, pause 0.5
17:35:18:pywws.weatherstation:delay 80, pause 0.5
17:35:18:pywws.weatherstation:delay 80, pause 0.5
17:35:19:pywws.weatherstation:live_data new data
17:35:19:pywws.weatherstation:setting sensor clock 7.68365
17:35:19:pywws.logdata:Reading time 15:35:19
17:35:19:pywws.logdata:est log time 14:13:55 +- 24s (14:13:31..14:14:19)
17:35:19:pywws.weatherstation:delay 81, pause 44.4828
17:36:04:pywws.weatherstation:avoid 5.89973092079
17:36:11:pywws.weatherstation:live_data new data
17:36:11:pywws.logdata:Reading time 15:36:07
17:36:11:pywws.logdata:est log time 14:14:13 +- 6s (14:14:07..14:14:19)
17:36:11:pywws.logdata:Fetching data
17:36:11:pywws.livelog:unsupported operand type(s) for +: 'NoneType' and 'datetime.timedelta'
Traceback (most recent call last):
 File "/usr/local/lib/python2.7/dist-packages/pywws-20.9.0-py2.7.egg/pywws/livelog.py", line 80, in live_log
   datalogger.log_data()
 File "/usr/local/lib/python2.7/dist-packages/pywws-20.9.0-py2.7.egg/pywws/logdata.py", line 238, in log_data
   self.fetch_logged(last_date, last_ptr)
 File "/usr/local/lib/python2.7/dist-packages/pywws-20.9.0-py2.7.egg/pywws/logdata.py", line 173, in fetch_logged
   next_date = self.raw_data.after(last_date + SECOND)
TypeError: unsupported operand type(s) for +: 'NoneType' and 'datetime.timedelta'
17:36:11:pywws.storage:flushing

thanks in advance

Weather Underground Precip Rate = Precip Accum

Since about 11th August I have noticed that on my Weather Underground results the Precip Rate = Precip Accum. I had to reinstall pywws due to an issue with my SD card, but managed to rescue the data, but installed the latest pywws.

I must admit, I don't know if it is a pywws issue or Weather Underground. My MQTT messages are showing that the station is reporting different values, so that appears to be correct.

Weather station is at: https://www.wunderground.com/personal-weather-station/dashboard?ID=IPOTTON3#history/s20180811/e20180811/mdaily

Filter for data spikes

Hi,

I have from time to time the problem that the data connection from the outside sensor seems to be not reliable and so I get corrupted data. But always just one sample.

Of course this is a hardware issue and should primary addressed on this level.

But would it be possible to add to pywws a filter, which could drop samples ?

Like, if one sample is N digits different than the one before/afterwards, drop it.

Thomas

Exception when running livelog

I've reinstalled pywws on a new Raspberry pi and tried to configure livelog. When i started i got this:

pywws-livelog -vvv ~/weather/data
10:26:22:pywws.Logger:pywws version 18.04.1, build 1389 (5a32227)
10:26:22:pywws.Logger:Python version 2.7.13 (default, Nov 24 2017, 17:33:09)
[GCC 6.3.0 20170516]
10:26:22:pywws.WeatherStation.CUSBDrive:using pywws.device_pyusb1
10:26:24:pywws.Calib:Using default calibration
Traceback (most recent call last):
  File "/usr/local/bin/pywws-livelog", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/pywws/LiveLog.py", line 126, in main
    return LiveLog(args[0])
  File "/usr/local/lib/python2.7/dist-packages/pywws/LiveLog.py", line 76, in LiveLog
    asynch=asynch)
  File "/usr/local/lib/python2.7/dist-packages/pywws/Tasks.py", line 113, in __init__
    service_name=name)
  File "/usr/local/lib/python2.7/dist-packages/pywws/toservice.py", line 284, in __init__
    self.next_update = min(self.next_update, self.data.before(datetime.max))
TypeError: can't compare datetime.datetime to NoneType

I did some debug-printing of the content of row 284 and found the following:
self.next_update = 2018-05-27 08:26:24.550716
datetime.max = 9999-12-31 23:59:59.999999
self.data.before = None

Created a quick workaround and got it running:

        if self.data.before(datetime.max) is not None:
            self.next_update = min(self.next_update, self.data.before(datetime.max))

pywws-livelog-daemon "Unable to change process owner" error

The python-daemon library version 2.1.0 causes a permissions problem with pywws-livelog-daemon:

Unable to change process owner ([Errno 1] Operation not permitted)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pywws/livelogdaemon.py", line 110, in main
    runner.do_action()

This is fixed in commit d2b937f. Until the next release of pywws you can work around the problem by downgrading python-daemon:

sudo pip install python-daemon==2.0.6

Allow "day end hour" to change with DST

Currently the "day end hour" setting ignores daylight savings time, as recommended by the UK met office. Some people (particularly those with it set to midnight) prefer it to be midnight local time, summer and winter. (And not worry about the 23 hour and 25 hour days that will happen around the DST change.)

A 'flag' could be added to the day end hour setting to select this behaviour. This would require some work on the pywws.Process module to cope with the DST change.

Please add support for candlesticks graphs

A candlesticks graph with whiskers (and/or whiskerbars) would be ideal for those day/night avg/max/min graphs currently used in 28days and yearly graphs.

Those look like these: http://gnuplot.sourceforge.net/demo/candlesticks.html . Or this one:

image

Sadly, the current source code doesn't allow this as candlesticks graphs need 4 y-values per row (NightAvg, NightMin, DayMax, DayAvg) and the Plot.py only writes 1 values per row.

I'm not sure but it might be sufficient if the <ycalc> field would allow a tuple to specify multiple data values. And the using 1:2 string for gnuplot should be adapted accordingly.

running pywws.Hourly fails with python error

My pywws installation has stopped getting data from my Maplin USB weather station. The python error output is:

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, 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/Hourly.py", line 57, in <module>
    from . import Process
  File "/usr/local/lib/python2.7/dist-packages/pywws/Process.py", line 90, in <module>
    from .TimeZone import STDOFFSET
  File "/usr/local/lib/python2.7/dist-packages/pywws/TimeZone.py", line 41, in <module>
    import pytz
ValueError: bad marshal data (unknown type code)

I'm unsure if this is a corruption with the data my weather station has recorded, or a problem with pywws or python. Is there any additional debugging or log files that would be useful?

Unable to get Wind Chill in MQTT

I've tried formatting the wind_chill in the MQTT template, but for the life of me I cannot get it to work. I get:

File "", line 12
Jun 01 19:44:34 PiWeather pywws-livelog[1570]: '#calc 'wind_chill(data('temp_out'], data['wind_ave'])' '"chill": "%.0f",' '' 'scale(x, 10.0)'#\n'

Do you have any idea what is happening here?

pywws-testweatherstation got error

Hi,

Thanks a lot for your work in this module. Unfortunately I didn't success to run pywws-Testweatherstation

I just followed the documentation of pywws and run it on a Mac. The weather station I'm using now is WH1080. After I installed the dependencies and pywws(with pip, in python 3) I tried to start pywws-testweatherstation, then I got the following error:

16:49:28:pywws.Logger:pywws version 16.12.0, build 1367 (e917ba9)
Traceback (most recent call last):
File "/Users/yimeng/anaconda/bin/pywws-testweatherstation", line 11, in
sys.exit(main())
File "/Users/yimeng/anaconda/lib/python3.5/site-packages/pywws/TestWeatherStation.py", line 117, in main
raw_fixed = ws.get_raw_fixed_block()
File "/Users/yimeng/anaconda/lib/python3.5/site-packages/pywws/WeatherStation.py", line 598, in get_raw_fixed_block
self._fixed_block = self._read_fixed_block()
File "/Users/yimeng/anaconda/lib/python3.5/site-packages/pywws/WeatherStation.py", line 642, in _read_fixed_block
result += self._read_block(mempos)
File "/Users/yimeng/anaconda/lib/python3.5/site-packages/pywws/WeatherStation.py", line 630, in _read_block
new_block = self.cusb.read_block(ptr)
File "/Users/yimeng/anaconda/lib/python3.5/site-packages/pywws/WeatherStation.py", line 265, in read_block
if not self.dev.write_data(buf):
File "/Users/yimeng/anaconda/lib/python3.5/site-packages/pywws/device_ctypes_hidapi.py", line 145, in write_data
if hidapi.hid_write(self.device, ctypes.c_char_p(data), size) != size:
TypeError: bytes or integer address expected instead of str instance

Then I followed this link that I changed
if hidapi.hid_write(self.device, ctypes.c_char_p(data), size) != size:
in device_ctypes_hidapi.py line 145 to
if hidapi.hid_write(self.device, ctypes.c_char_p(data.encode('UTF-8')), size) != size:
and solved this exception.

After that I ran pywws-testweatherstation again and I got the following error:
16:54:43:pywws.Logger:pywws version 16.12.0, build 1367 (e917ba9)
Traceback (most recent call last):
File "/Users/yimeng/anaconda/bin/pywws-testweatherstation", line 11, in
sys.exit(main())
File "/Users/yimeng/anaconda/lib/python3.5/site-packages/pywws/TestWeatherStation.py", line 117, in main
raw_fixed = ws.get_raw_fixed_block()
File "/Users/yimeng/anaconda/lib/python3.5/site-packages/pywws/WeatherStation.py", line 598, in get_raw_fixed_block
self._fixed_block = self._read_fixed_block()
File "/Users/yimeng/anaconda/lib/python3.5/site-packages/pywws/WeatherStation.py", line 642, in _read_fixed_block
result += self._read_block(mempos)
File "/Users/yimeng/anaconda/lib/python3.5/site-packages/pywws/WeatherStation.py", line 630, in _read_block
new_block = self.cusb.read_block(ptr)
File "/Users/yimeng/anaconda/lib/python3.5/site-packages/pywws/WeatherStation.py", line 267, in read_block
return self.dev.read_data(32)
File "/Users/yimeng/anaconda/lib/python3.5/site-packages/pywws/device_ctypes_hidapi.py", line 125, in read_data
'pywws.device_ctypes_hidapi.USBDevice.read_data failed')
OSError: pywws.device_ctypes_hidapi.USBDevice.read_data failed

I checked n = hidapi.hid_read_timeout(self.device, data, length, 100) in device_ctypes_hidapi.py line line 122 and found n = 0 at this place, which means no data to be read before time out. Besides the self.device is no problem which is passed a integer to the method.

Did you meet the same problem before? For any help I will be appreciate!

Thanks in advance

Allow start and stop to take the current year and month as parameters

Hi

I am finding that showing the last 12 months means that the graph moves across the screen as the month progresses when I only use weeks = 52

Would it be possible in the plot to use the following syntax for start and stop
year=%Y, month=%m, day =31
Which would allow you to specify the stop date as the end of the current month. Obviously the number of days would need to be calculated but 31 could be used to indicate the end of the month.

Then the start date time would be 52 weeks prior which should stop the graph moving from right to left as the days in the month increase. It would only then move as the month changes.

The image below shows the issue
capture

Cheers

Paul

The MQTT service doesn't permit authentication

Hi, the MQTT service currently doesn't handle the case where connecting to a broker might require authentication. I wondered if the original author of the service patch had any plans to implement this? if not I'll have a look at what is required.

Pywws's LiveLog should not crash when the weather station is disconnected

I'm running pywws with big joy from an Openmoko Neo Freerunner, using an USB Y cable to power both the station and the freerunner (also if the Neo could give power to the station by itself, I need to use external power to keep it on 24/24, 7/7 of course).

However in my area is sometimes affected by power outages, and in this case the station loses the USB power. This leads to the Freerunner not to see the station as a connected usb device, and thus pywws has read errors such as:

2013-05-27 08:28:47:pywws:error sending control message: No such device
Traceback (most recent call last):
File "./LiveLog.py", line 156, in
sys.exit(main())
File "./LiveLog.py", line 151, in main
return LiveLog(args[0])
File "./LiveLog.py", line 98, in LiveLog
logged_only=(not tasks.has_live_tasks())):
File "/root/pywws/code/pywws/WeatherStation.py", line 470, in live_data
new_data = self.get_data(old_ptr, unbuffered=True)
File "/root/pywws/code/pywws/WeatherStation.py", line 618, in get_data
return _decode(self.get_raw_data(ptr, unbuffered),
File "/root/pywws/code/pywws/WeatherStation.py", line 609, in get_raw_data
self._data_block = self._read_block(self._data_pos)
File "/root/pywws/code/pywws/WeatherStation.py", line 684, in _read_block
new_block = self.cusb.read_block(ptr)
File "/root/pywws/code/pywws/WeatherStation.py", line 343, in read_block
if not self.dev.write_data(buf):
File "/root/pywws/code/pywws/device_pyusb.py", line 178, in write_data
usb.REQ_SET_CONFIGURATION, buf, value=0x200, timeout=50)
USBError: error sending control message: No such device

In this case I could make the freerunner a powered USB host and resume the usb connection, but in anycase it's not great to have the logger daemon crashed.

I'm using cron jobs to prevent this, but it would be nice if pywws would just log the read errors retrying to read from USB every N seconds, without crashing.

livelog-daemon issue

Hi Jim,

I'm running pywws on Rpi jessie. All running well, apart from an issue running livelog-daemon. I get the following error:

File "/usr/local/lib/python2.7/dist-packages/pywws/livelogdaemon.py", line 48, in
from daemon.runner import DaemonRunner
ImportError: No module named daemon.runner

Can you offer any advice on how to resolve?

Many thanks,

can't run logdata - weather station issue?

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?

Double labels on wind rose right hand axis

Some people are getting double labels on the right hand axis of their wind roses and single labels on the left, others get single labels on the right and none on the left. This seems to be a feature of different gnuplot versions.

Using EmonCms

Hello,

Is it possible to add a service for pulling data into a EmonCms server?

Thank's.

Regards,

Big

Problem to run weatherstation.py "No USB libary found"

Hi,

i try to run on my RaspberryPi4 with Python3.7 the weatherstation.py, to get some easy weatherinformations for a own python Projekt, but everything i´ve try to run the programm doesent work and i end up with No USB libary found".

I´ve trying "pip3 install libusb", "pip3 install usb", "sudo apt-get install python-libusb1.0.0", "sudo apt-get install python-usb", "pip3 install pyusb"

Any ideas to try something else?

Twitter UTF-8 character count

I've seen in the code that ToTwitter.py limits the length of a tweet to 140 characters without attached media and 117 characters with media attached.

To calculate the length, the generated tweet is converted to utf-8 first. And then, the first 117 (or 140) characters are used.

However, this counts multi-byte characters as multiple characters (😎 = 4 characters, although it should be counted as only 1 character) where the Twitter doc clearly states that multi-byte characters count as one character.

Mosquitto - add SSL/TLS support

Please, add SSL/TLS support for MQTT service.
I configured my broker to use a certificate from Let's Encrypt. To establish the connection, I just had to add this line to toservice.py (just before the call to mosquitto_client.connect(hostname, int(port))):

mosquitto_client.tls_set("/etc/ssl/certs/DST_Root_CA_X3.pem")

For this to work, there should be the possibility to configure the paths for ca_certs, certfile and keyfile in weather.ini (in my case, I just had to set set the ca_certs path).

sphinx won't compile

Hello,

First, thanks a million for that great piece of free - not as in free beer - software! :)

Issue

When compiling the documentation, I get the following error

python setup.py build_sphinx
running build_sphinx
Running Sphinx v1.5.1
loading translations [en]... done
loading pickled environment... not yet created
[autosummary] generating autosummary for: api_index.rst, copyright.rst, essentials/CHANGELOG.rst, essentials/LICENCE.rst, essentials/dependencies.rst, guides/getstarted.rst, guides/hourlylogging.rst, guides/humidex.rst, guides/index.rst, guides/integration.rst, guides/language.rst, guides/livelogging.rst, guides/logfiles.rst, guides/twitter.rst, guides/weather_ini.rst, index.rst
WARNING: [autosummary] failed to import 'pywws.DataStore': no module named pywws.DataStore

Exception occurred:
  File "/home/prometheus/Projects/RaspStation/pywws/pywws/lib/python3.5/site-packages/sphinx/ext/autosummary/__init__.py", line 504, in _import_by_name
    __import__(modname)
  File "/home/prometheus/Projects/RaspStation/pywws/pywws/pywws/pywws/src/pywws/EWtoPy.py", line 76
    except getopt.error, msg:
                       ^
SyntaxError: invalid syntax

live data never sent to services

I had an old installation of pywws (around 16.12), and I decided to finally upgrade it.

My pywws was down for a couple of days. So I've upgraded pywws, lanunched pywws.reprocess but now the live data is correctly read but never sent.

I've added some debugging bits, but basically datalogger.log_data() called and never returns... Continuously processing live data:

2019-03-29 03:49:14:pywws.logger:pywws version 19.3.0, build 1650 (17131d2)
2019-03-29 03:49:14:pywws.logger:Python version 2.7.9 (default, Aug 13 2016, 17:33:18) 
[GCC 4.9.2]
2019-03-29 03:49:14:pywws.weatherstation:using pywws.device_pyusb
2019-03-29 03:49:16:pywws.weatherstation:avoid 5.34576821327
2019-03-29 03:49:23:pywws.calib:Using default calibration
2019-03-29 03:49:25:pywws.livelog:Logging data...
2019-03-29 03:49:25:pywws.logdata:Synchronising to weather station
2019-03-29 03:49:26:pywws.weatherstation:read period 218
2019-03-29 03:49:26:pywws.weatherstation:delay 158, pause 37.4444
2019-03-29 03:50:03:pywws.weatherstation:status {'rain_overflow': False, 'lost_connection': False}
2019-03-29 03:50:03:pywws.weatherstation:delay 158, pause 0.5
2019-03-29 03:50:04:pywws.weatherstation:avoid 5.74577116966
2019-03-29 03:50:10:pywws.weatherstation:live_data new data
2019-03-29 03:50:10:pywws.logdata:Reading time 29/03 02:50:07
2019-03-29 03:50:10:pywws.logdata:Is logged False, 2019-03-29 02:50:07, 1, None
2019-03-29 03:50:10:pywws.weatherstation:delay 159, pause 41.2913
2019-03-29 03:50:51:pywws.weatherstation:delay 159, pause 0.5
2019-03-29 03:50:52:pywws.weatherstation:avoid 5.77075910568
2019-03-29 03:50:58:pywws.weatherstation:live_data new data
2019-03-29 03:50:58:pywws.logdata:Reading time 29/03 02:50:55
2019-03-29 03:50:58:pywws.logdata:Is logged False, 2019-03-29 02:50:55, 1, None
2019-03-29 03:50:58:pywws.weatherstation:delay 159, pause 41.2907
2019-03-29 03:51:39:pywws.weatherstation:delay 159, pause 0.5
2019-03-29 03:51:40:pywws.weatherstation:avoid 5.77075719833
2019-03-29 03:51:46:pywws.weatherstation:live_data new data
2019-03-29 03:51:46:pywws.logdata:Reading time 29/03 02:51:43
...
2019-03-29 04:38:10:pywws.weatherstation:live_data new data
2019-03-29 04:38:10:pywws.logdata:Reading time 29/03 03:38:07
2019-03-29 04:38:10:pywws.logdata:Is logged False, 2019-03-29 03:38:07, 1, None
2019-03-29 04:38:10:pywws.weatherstation:delay 207, pause 41.2651
2019-03-29 04:38:51:pywws.weatherstation:delay 207, pause 0.5
2019-03-29 04:38:52:pywws.weatherstation:avoid 5.75576305389
2019-03-29 04:38:58:pywws.weatherstation:live_data new data
2019-03-29 04:38:58:pywws.logdata:Reading time 29/03 03:38:55
2019-03-29 04:38:58:pywws.logdata:Is logged False, 2019-03-29 03:38:55, 1, None
2019-03-29 04:38:58:pywws.weatherstation:delay 207, pause 41.2719

And so continues... No service is called.

If I set logdata sync = 0, the function does exit but it never enters into this cycle: for data, logged in datalogger.live_data(logged_only=(not tasks.has_live_tasks())):

Any way I can help in debugging this? [not that should change, but I've tried running in python3 but no change]

MQTT Template in weather.ini being ignored

I have updated the MQTT template in weathwer.ini, and restarted pywws, but it is still sending out the old default template defined in mqtt.py. For example, I don't have the temp_out_f, but it is still being received on the broker and subscribers.

Use other file than weather.ini to cache values

pywws is using weather.ini file both to read the current configuration and to save cached values such as the ones in the "fixed" section and the last update time for the upload services.

I think it should be better if pywws would use another file to cache such data so that it would be safely possible to edit the weather.ini file also when pywws livelogger is running.

Does pywws work with Davis Vantage Pro 2?

I'm trying to get my Raspberry Pi running pywws to work with my Vantage Pro 2 with the USB data logger installed. When I run pywws.TestWeatherStation I get:

python -m pywws.TestWeatherStation
07:04:13:pywws.Logger:pywws version 14.12.0
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, 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/TestWeatherStation.py", lin e 180, in
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/pywws/TestWeatherStation.py", lin e 115, in main
ws = WeatherStation.weather_station()
File "/usr/local/lib/python2.7/dist-packages/pywws/WeatherStation.py", line 40 5, in init
self.cusb = CUSBDrive()
File "/usr/local/lib/python2.7/dist-packages/pywws/WeatherStation.py", line 25 2, in init
self.dev = USBDevice(0x1941, 0x8021)
File "/usr/local/lib/python2.7/dist-packages/pywws/device_pyusb.py", line 99, in init
raise IOError("Weather station device not found")
IOError: Weather station device not found
Exception AttributeError: "'USBDevice' object has no attribute 'devh'" in <bound method USBDevice.del of <pywws.device_pyusb.USBDevice object at 0xb689fc50>

When I run lsusb I see the Data Logger interface:
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 154b:007a PNY
Bus 001 Device 005: ID 10c4:ea61 Cygnal Integrated Products, Inc. CP210x UART Bridge
Bus 001 Device 006: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter

The weather station is the CP210x UART Bridge

Any suggestion?

Passwords with special characters break the parser

Hi Jim,
Thanks for the code, I'm using and enjoying it. I have hit a minor bug, when uploading to weather underground I generated a password with % and & signs in it, this caused the config file parser to fail.

No real need to fix this unless you want to as I have now changed my password to one which is alphanumeric and all is well.
Thanks,
Troy.

sudo pywws-testweatherstation -d -h 1 doesn't show some data

I use testweatherstation -d -h 1 for my weatherstation and send this data in json to my FTP server. My problem is that I do not see some data like dewpoint. And rain data are not displayed correctly.
My weather station is WH1090
Sorry for my bad English.

Enhancement - check for excessive change in temp_out

In the same way as rain is checked, it would be very useful to check for excessive changes in temp_out that will likely indicate corrupt data. A check is already made for some aspects of inconsistent temp_out figures that would indicate corrupt data and this would enhance it. I have seen values vastly different from previous values, that were corrupt data.

if data['temp_out'] is not None or not self.retval:

Invalid filename in "services" section breaks file copying

Hi Jim,
For the first time in running this great software I managed to break it.
I defined a new text file in weather.ini, but mis-typed it in the "services" directive. So where I should have written
services = [('copy', 'feed.xml'),('copy', 'feed2.xml'),('copy','live.data')]
I wrote
services = [('copy', 'feed.xml'),('copy', 'feed22.xml'),('copy','live.data')]
Which was pretty stupid.
Afterwards, when running pywws-livelog, when the program tried to copy files to the necessary directory, it threw an error:
pywws.service.copy:IOError(2, 'No such file or directory')
This shouldn't be a problem - once I realised where I'd gone wrong I edited weather.ini and corrected it. But every time I tried to run pywws-livelog afterwards, the same error occurred. And it stopped all other files being copied as well.
After a lot of digging, I found that status.ini contained a section:
[pending]
copy = ['feed22.xml']
Which seems to mean that the program will keep trying to copy that file even when it isn't in weather.ini, and thus breaking copying.

My guess (Python not being one of my programming languages) is that there's a need for the copy program to check if any pending copy still exists in weather.ini and if it doesn't, removing it.

Thanks again for a great utility.
Tony

After new reorganization I can't run TestWeatherStation

root@neo:~/pywws# python pywws/TestWeatherStation.py
Traceback (most recent call last):
File "pywws/TestWeatherStation.py", line 56, in
from pywws.Logger import ApplicationLogger
ImportError: No module named pywws.Logger

ValueError: time data '2017@SynoEAStream' does not match format '%Y-%m-%d.txt'

Hello,
I run WH1080 on Synology NAS.
I did full reinstall of Synology, copy-pasted pywws data and installed pywws.

python -m pywws.LogData -vvv /volume1/weather/

returns this error:

22:59:12:pywws.Logger:pywws version 17.01.0, build 1372 (7d691f1)
22:59:12:pywws.Logger:Python version 2.7.12 (default, Jun 26 2017, 02:36:18)
[GCC 4.9.3 20150311 (prerelease)]
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/lib/python2.7/site-packages/pywws-17.1.0-py2.7.egg/pywws/LogData.py", line 309, in
sys.exit(main())
File "/usr/lib/python2.7/site-packages/pywws-17.1.0-py2.7.egg/pywws/LogData.py", line 306, in main
DataStore.data_store(root_dir)).log_data(sync=sync, clear=clear)
File "/usr/lib/python2.7/site-packages/pywws-17.1.0-py2.7.egg/pywws/DataStore.py", line 507, in init
core_store.init(self, os.path.join(root_dir, 'raw'))
File "/usr/lib/python2.7/site-packages/pywws-17.1.0-py2.7.egg/pywws/DataStore.py", line 246, in init
safestrptime(file, "%Y-%m-%d.txt").date())
File "/usr/lib/python2.7/site-packages/pywws-17.1.0-py2.7.egg/pywws/DataStore.py", line 87, in safestrptime
return datetime(*(time.strptime(date_string, format)[0:6]))
File "/usr/lib/python2.7/_strptime.py", line 478, in _strptime_time
return _strptime(data_string, format)[0]
File "/usr/lib/python2.7/_strptime.py", line 332, in _strptime
(data_string, format))
ValueError: time data '2017@SynoEAStream' does not match format '%Y-%m-%d.txt'

Any idea what to fix to get a proper time?
Thanks a lot

can't compare datetime.datetime to NoneType when submitting to wunderground

$ pywws-livelog -vvv ~/weather/data
16:56:14:pywws.Logger:pywws version 17.11.0, build 1380 (b01d94a)
16:56:14:pywws.Logger:Python version 2.7.3 (default, Nov 24 2017, 21:13:24)
[GCC 4.6.3]
16:56:14:pywws.WeatherStation.CUSBDrive:using pywws.device_pyusb
16:56:15:pywws.weather_station:avoid 0.769716978073
16:56:17:pywws.Calib:Using default calibration
Traceback (most recent call last):
File "/usr/local/bin/pywws-livelog", line 11, in
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/pywws/LiveLog.py", line 123, in main
return LiveLog(args[0])
File "/usr/local/lib/python2.7/dist-packages/pywws/LiveLog.py", line 76, in LiveLog
asynch=asynch)
File "/usr/local/lib/python2.7/dist-packages/pywws/Tasks.py", line 113, in init
service_name=name)
File "/usr/local/lib/python2.7/dist-packages/pywws/toservice.py", line 284, in init
self.next_update = min(self.next_update, self.data.before(datetime.max))
TypeError: can't compare datetime.datetime to NoneType

self.data.before seems to be evaluating to None

Missing Version.py

setup.py fails to install cause your import is pointing to a missing file:

from pywws.version import version

locally I was able to create a file version.py and inside it I put:

version = "0.1"

but I'm sure that's the wrong version number.

unorderable types when running pywws-livelog

Debian Stretch/arm when running pywws-livelog. pywws-hourly runs ok
I am running pywws for years w/o problems so looks strange to discover such a
low-level error
--tomek

07:47:47:pywws.logger:pywws version 20.1.0, build 1673 (92d8868)
07:47:47:pywws.logger:Python version 3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516]
07:47:47:pywws.weatherstation:using pywws.device_pyusb1
Traceback (most recent call last):
File "/usr/local/bin/pywws-livelog", line 11, in
sys.exit(main())
File "/usr/local/lib/python3.5/dist-packages/pywws/livelog.py", line 130, in main
return live_log(args[0])
File "/usr/local/lib/python3.5/dist-packages/pywws/livelog.py", line 75, in live_log
datalogger = pywws.logdata.DataLogger(context)
File "/usr/local/lib/python3.5/dist-packages/pywws/logdata.py", line 100, in init
while saved_date < self.last_stored_time:
TypeError: unorderable types: NoneType() < datetime.datetime()

extending pywws for "external" data

Hi Jim,

what do you think about extending pywws for "external" data, which is provided from other measuring systems where you can retrieve data eg. with a python script or something like that?
I'd like to integrate a selfmade Snowhightsensor (sonar) on my pywws graphs and therefore it would by great to store other measurements in pywws datastore for further analysis.

regards
Bene

PS: pywws is realy a great piece of work! Thank you!

error processing hourly

Hello

My weather stations been running for years but I've been slack and haven't checked it recently. Turns out the pi crashed in December but had been giving errors for a few weeks before that. Hourly processing has stopped working and I can't figure out why.

pi@weatherpi2:~/weather $ pywws-hourly -v data
13:04:33:pywws.logger:pywws version 20.1.0, build 1673 (92d8868)
13:04:33:pywws.logger:Python version 3.7.3 (default, Apr  3 2019, 05:39:12) 
[GCC 8.2.0]
13:04:34:pywws.weatherstation:using pywws.device_libusb1
13:04:35:pywws.logdata:Synchronising to weather station
13:05:00:pywws.weatherstation:status {'lost_connection': False, 'rain_overflow': False}
13:05:00:pywws.logdata:Fetching data
13:05:00:pywws.process:Generating summary data
13:05:01:pywws.calib:Using default calibration
Traceback (most recent call last):
  File "/home/pi/.local/bin/pywws-hourly", line 10, in <module>
    sys.exit(main())
  File "/home/pi/.local/lib/python3.7/site-packages/pywws/hourly.py", line 97, in main
    return hourly(args[0])
  File "/home/pi/.local/lib/python3.7/site-packages/pywws/hourly.py", line 68, in hourly
    pywws.regulartasks.RegularTasks(context).do_tasks()
  File "/home/pi/.local/lib/python3.7/site-packages/pywws/regulartasks.py", line 89, in __init__
    for name, options in self._parse_templates(section, 'services'):
  File "/home/pi/.local/lib/python3.7/site-packages/pywws/regulartasks.py", line 119, in _parse_templates
    for template in literal_eval(self.params.get(section, option, '[]')):
  File "/usr/lib/python3.7/ast.py", line 91, in literal_eval
    return _convert(node_or_string)
  File "/usr/lib/python3.7/ast.py", line 74, in _convert
    return list(map(_convert, node.elts))
  File "/usr/lib/python3.7/ast.py", line 90, in _convert
    return _convert_signed_num(node)
  File "/usr/lib/python3.7/ast.py", line 63, in _convert_signed_num
    return _convert_num(node)
  File "/usr/lib/python3.7/ast.py", line 55, in _convert_num
    raise ValueError('malformed node or string: ' + repr(node))
ValueError: malformed node or string: <_ast.Call object at 0xb4adec10>

I thought it might be a corrupt data file but they look ok, I tried removing the one for the day it stopped processing and the one after but no luck.

Any ideas?

Regards

FTP IOError No such file or directory: ... ftp.ini

When enabling FTP in weather.ini i get the following error with pywws version 15.01.0:
...
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1316, in _getstream = open(path, 'rb')
IOError: [Errno 2] No such file or directory: '/usr/local/lib/python2.7/dist-packages/pywws/services/ftp.ini'

Can't change station read period

Running pywws-setweatherstation -r 5 doesn't change my station read period and am stuck on 30 mins.

# pywws-setweatherstation -vvv -r 5 10:46:12:pywws.logger:pywws version 20.1.0, build 1673 (92d8868) 10:46:12:pywws.logger:Python version 3.7.3 (default, Jul 25 2020, 13:03:44) [GCC 8.3.0] 10:46:12:pywws.weatherstation:using pywws.device_pyusb1 10:46:13:pywws.weatherstation:write_data waiting for ack 10:46:19:pywws.weatherstation:write_data waiting for ack 10:46:25:pywws.weatherstation:write_data waiting for ack 10:46:31:pywws.weatherstation:write_data waiting for ack

# pywws-testweatherstation -vvv -d 10:46:46:pywws.logger:pywws version 20.1.0, build 1673 (92d8868) 10:46:46:pywws.logger:Python version 3.7.3 (default, Jul 25 2020, 13:03:44) [GCC 8.3.0] 10:46:46:pywws.weatherstation:using pywws.device_pyusb1 {'abs_pressure': 965, . . 'current_pos': 800, 'data_changed': 0, 'data_count': 35, 'date_time': '2021-03-05 10:45:00', . . . 'rain_factor_raw': 17920, 'read_period': 30, . . 'timezone': 0, 'unknown_01': 0, 'unknown_18': 0, 'wind_factor_raw': 91} min -> temp_out -> {'val': -36.7, 'date': '2013-10-02 07:29:00'} alarm -> hum_out -> {'hi': 70, 'lo': 45} rel_pressure -> 1019.3 abs_pressure -> 965

Maplin W1080 connected to a Pi 3B, clean install of Raspbian Lite + dependancies.

Tried:
python 2.7 v python 3.7
libusb1 v pyusb
multiple different power supplies
Pi 3B+
/boot/config.txt dtoverlay settings from another suggestion
Unplugging W1080 & removing batteries for over an hour

Nothing works and read_period in test output always stays at 30. Any suggestions?

MQTT not working in Python3

I've build a new Raspberry Pi with Debian Jessie Lite, I've copied the data and configs from the Wheezy install. Installed pip and run sudo pip install paho-mqtt.
Setup pywws via pip and it uploads to MetOffice and Weather Underground, however when i add MQTT to livelog it crashes. This previously worked fine before i rebuilt the RPi, I suspect it's due to Python3.

Below is the error message
sudo python3 -m pywws.LiveLog -v /home/pi/weather
21:32:13:pywws.Logger:pywws version 15.12.0
21:32:13:pywws.Logger:Python version 3.4.2 (default, Oct 19 2014, 13:31:11)
[GCC 4.9.1]
21:32:13:pywws.WeatherStation.CUSBDrive:using pywws.device_libusb1
21:32:15:pywws.Calib:Using default calibration
21:32:38:pywws.weather_station:setting sensor clock 38.2162
21:33:13:pywws.LiveLog:unorderable types: str() <= int()
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/pywws/LiveLog.py", line 88, in LiveLog
tasks.do_live(data)
File "/usr/local/lib/python3.4/dist-packages/pywws/Tasks.py", line 300, in do_live
self._do_common(['live'], calib_data)
File "/usr/local/lib/python3.4/dist-packages/pywws/Tasks.py", line 269, in _do_common
self._do_queued_tasks()
File "/usr/local/lib/python3.4/dist-packages/pywws/Tasks.py", line 174, in _do_queued_tasks
elif service.send_data(timestamp, prepared_data):
File "/usr/local/lib/python3.4/dist-packages/pywws/toservice.py", line 339, in mqtt_send_data
mosquitto_client.connect(hostname, port)
File "/usr/local/lib/python3.4/dist-packages/paho/mqtt/client.py", line 611, in connect
self.connect_async(host, port, keepalive, bind_address)
File "/usr/local/lib/python3.4/dist-packages/paho/mqtt/client.py", line 667, in connect_async
if port <= 0:
TypeError: unorderable types: str() <= int()
Exception ignored in: <bound method status.del of <pywws.DataStore.status object at 0xb63da410>>
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/pywws/DataStore.py", line 109, in del
self.flush()
File "/usr/local/lib/python3.4/dist-packages/pywws/DataStore.py", line 117, in flush
self._config.write(of)
File "/usr/lib/python3.4/configparser.py", line 895, in write
for section in self._sections:
File "/usr/lib/python3.4/collections/init.py", line 87, in iter
curr = root.next
ReferenceError: weakly-referenced object no longer exists

Live wind data to Weathercloud service

Hi,
Would it be possible that 'Live' wind data could be sent to Weathercloud?
From what I can see in weathercloud.py only 'wspdavg', 'wspdhi', and 'wdiravg' data is sent. Could 'wspd' and 'wdir' be added to weathercloud.py?

ie PiWeatherUK only shows Average wind speed, direction and the gust. The live info is ghosted out as it is not being received.

Thanks,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.