Hi,

Thank you, there is indeed a flaw in the weathercat import code. I have 
fixed it and it should appear in WeeWX 4.3.0. In the meantime you can carry 
on with your importing by downloading and using the updated file as follows:

1. move aside your existing weathercatimport.py:

$ sudo mv /usr/share/weewx/weeimport/weathercatimport.py 
/usr/share/weewx/weeimport/weathercatimport_orig.py

2. download the updated weathercatimport.py:

$ sudo wget -P /usr/share/weewx/weeimport 
https://raw.githubusercontent.com/weewx/weewx/master/bin/weeimport/weathercatimport.py

3. retry your import

Please let me know if there are any further errors.

Gary

On Monday, 28 December 2020 at 23:33:54 UTC+10 [email protected] wrote:

> Weewx is latest version 4.2.0 installed on ubuntu 20.04 via apt-get.
>
> -Ville-
>
>
> maanantai 28. joulukuuta 2020 klo 15.31.34 UTC+2 [email protected] 
> kirjoitti:
>
>> Hi,
>> Trying to import from weathercat monthly .cat files.
>>
>> I get this error:
>>
>> ville@weewx:~/Location1/2017$ sudo wee_import 
>> --config=/etc/weewx/weewx.conf --import-config=/etc/weewx/import/wct.conf 
>> --verbose
>>
>> Using WeeWX configuration file /etc/weewx/weewx.conf
>>
>> Starting wee_import...
>>
>> WeatherCat monthly .cat files in the '/home/ville/Location1' directory 
>> will be imported
>>
>> The following options will be used:
>>
>>      config=/etc/weewx/weewx.conf, 
>> import-config=/etc/weewx/import/wct.conf
>>
>>      from=None, to=None
>>
>>      dry-run=None, calc-missing=True
>>
>>      tranche=250, interval=derive
>>
>>      UV=True, radiation=True
>>
>> Using database binding 'wx_binding', which is bound to database 
>> 'weewx.sdb'
>>
>> Destination table 'archive' unit system is '0x01' (US).
>>
>> Missing derived observations will be calculated.
>>
>> Starting import ...
>>
>> Records covering multiple periods have been identified for import.
>>
>> Period 1 ...
>>
>> Obtaining raw import data for period 1 ...
>>
>> Raw import data read successfully for period 1.
>>
>> Mapping 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 401, in run
>>
>>     _mapped_data = self.mapRawData(_raw_data, self.archive_unit_sys)
>>
>>   File "/usr/share/weewx/weeimport/weeimport.py", line 698, in mapRawData
>>
>>     for _row in data:
>>
>>   File "/usr/share/weewx/weeimport/weathercatimport.py", line 332, in 
>> getRawData
>>
>>     _line = _clean_line.strip()
>>
>> UnboundLocalError: local variable '_clean_line' referenced before 
>> assignment
>>
>>
>> Checking syslog says:
>>
>>
>> ville@weewx:~/Location1/2017$ tail -f /var/log/syslog
>>
>> Dec 28 15:26:09 weewx wee_import[52575] DEBUG 
>> weeimport.weathercatimport:      config=/etc/weewx/weewx.conf, 
>> import-config=/etc/weewx/import/wct.conf
>>
>> Dec 28 15:26:09 weewx wee_import[52575] DEBUG 
>> weeimport.weathercatimport:      from=None, to=None
>>
>> Dec 28 15:26:09 weewx wee_import[52575] DEBUG 
>> weeimport.weathercatimport:      dry-run=None, calc-missing=True
>>
>> Dec 28 15:26:09 weewx wee_import[52575] DEBUG 
>> weeimport.weathercatimport:      tranche=250, interval=derive
>>
>> Dec 28 15:26:09 weewx wee_import[52575] DEBUG 
>> weeimport.weathercatimport:      UV=True, radiation=True
>>
>> Dec 28 15:26:09 weewx wee_import[52575] INFO weeimport.weathercatimport: 
>> Using database binding 'wx_binding', which is bound to database 'weewx.sdb'
>>
>> Dec 28 15:26:09 weewx wee_import[52575] INFO weeimport.weathercatimport: 
>> Destination table 'archive' unit system is '0x01' (US).
>>
>> Dec 28 15:26:09 weewx wee_import[52575] INFO weeimport.weeimport: 
>> Obtaining raw import data for period 1 ...
>>
>> Dec 28 15:26:09 weewx wee_import[52575] INFO weeimport.weeimport: Raw 
>> import data read successfully for period 1.
>>
>> Dec 28 15:26:09 weewx wee_import[52575] INFO weeimport.weeimport: Mapping 
>> raw import data for period 1 ...
>>
>>
>> I really don't know what to try next?
>>
>> Can somebody advice?
>>
>>
>> -Ville-
>>
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/57439c4a-6dc9-4b57-9aec-aebeae467291n%40googlegroups.com.

Reply via email to