wunderground import error

65 views
Skip to first unread message

george kyr

unread,
Oct 30, 2023, 3:59:08 AM10/30/23
to weewx-user
Last night I tried to import data from wunderground and I got this error. I read here that wunderground has changed something in its API. I wonder if I can do what Sylvain did, but I have installed v.4.10.2
Here's the error:

:~ $ sudo wee_import --import-config=/etc/weewx/import/wu-example.conf --from=2023-10-10T23:59 --to=2023-10-29T23:59 --verbose --dry-run
Using WeeWX configuration file /etc/weewx/weewx.conf
Starting wee_import...
Observation history for Weather Underground station 'IPAGAL1' will be imported.
The following options will be used:
     config=/etc/weewx/weewx.conf, import-config=/etc/weewx/import/wu-example.conf
     station=IPAGAL1, from=2023-10-10T23:59, to=2023-10-29T23:59
     apiKey=****************************69c5
     dry-run=True, calc_missing=False, ignore_invalid_data=True
     tranche=500, interval=5, wind_direction=[0.0, 360.0]
Using database binding 'wx_binding', which is bound to database 'weewx.sdb'
Destination table 'archive' unit system is '0x11' (METRICWX).
Observations timestamped after 2023-10-10 23:59:00 EEST (1696971540) and up to and
including 2023-10-29 23:59:00 EET (1698616740) will be imported.
This is a dry run, imported data will not be saved to archive.
Starting dry run import ...
Records covering multiple periods have been identified for import.
Period 1 ...
Obtaining raw import data for period 1 ...
Traceback (most recent call last):
  File "/usr/share/weewx/wee_import", line 900, in <module>
    main()
  File "/usr/share/weewx/wee_import", line 830, in main
    source_obj.run()
  File "/usr/share/weewx/weeimport/weeimport.py", line 382, in run
    _raw_data = self.getRawData(period)
  File "/usr/share/weewx/weeimport/wuimport.py", line 258, in getRawData
    _raw_data = f.read().decode(char_set)
TypeError: decode() argument 1 must be str, not None

gjr80

unread,
Oct 30, 2023, 8:54:39 AM10/30/23
to weewx-user
If you are running WeeWX v4.10.2 under python3 you should be able to use (untested) the patched wee_import files mentioned in this thread and replace the v4.10.2 versions. Since you are running WeeWX v4.x the process (and instructions) are a little less complicated:

1. Rename /usr/share/weewx/weeimport/wuimport.py and /usr/share/weewx/weeimport/weeimport.py so you can revert the files if needed:

$ mv /usr/share/weewx/weeimport/wuimport.py /usr/share/weewx/weeimport/wuimport_orig.py
$ mv /usr/share/weewx/weeimport/weeimport.py /usr/share/weewx/weeimport/weeimport_orig.py

2. Download the patched files wuimport.py and weeimport.py:


3. You can now use wee_import.

If you need to revert the files just delete /usr/share/weewx/weeimport/wuimport.py and /usr/share/weewx/weeimport/weeimport.py and move the renamed originals back in place:

$ mv /usr/share/weewx/weeimport/wuimport_orig.py /usr/share/weewx/weeimport/wuimport.py
$ mv /usr/share/weewx/weeimport/weeimport_orig.py /usr/share/weewx/weeimport/weeimport.py

Gary

george kyr

unread,
Oct 30, 2023, 2:55:10 PM10/30/23
to weewx...@googlegroups.com
Thank you Gary
it worked fine!

--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/VzYOnKf8Ers/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/abc0cd51-4530-448c-a270-7b0e6a2e3134n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages