You have two things going on here. 

***** Unable to decode source data for period 1.**** 'utf-8' codec can't 
decode byte 0xb0 in position 29: invalid start byte*
**** Period 1 will be skipped. Proceeding to next period.
**** Consider specifying the source file encoding using the 
'source_encoding' config option.

This is a warning that you have characters in your source data, in this 
case the degree symbol, that wee_import cannot process. Consequently the 
first period of data was skipped. The warning suggests specifying the 
encoding using the source_encoding config option but you really need to 
remove the offending character(s).

The 'readonly database'  error is likely due to permissions on your sqlite 
database file and the user that was running wee_import having insufficient 
privileges to write to that file. If WeeWX is run as the root user you may 
need to use sudo to run wee_import, eg:

$ sudo wee_import <rest of wee_import options>

Gary
On Sunday, 27 February 2022 at 23:03:52 UTC+10 Artvd wrote:

> I am trying to import a monthly csv file to weewx using the weewx import 
> guideline .Unfortunately i get a error. I wonder if someone could help me 
> to solve the problem. Below is weewx output of the dry run   
>
> wee_import --import-config=/var/tmp/csv.conf --dry-run
> Using WeeWX configuration file /etc/weewx/weewx.conf
> Starting wee_import...
> A CSV import from source file '/var/tmp/data.csv' has been requested.
> 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.
> This is a dry run, imported data will not be saved to archive.
> Starting dry run import ...
>
> ***** Unable to decode source data for period 1.**** 'utf-8' codec can't 
> decode byte 0xb0 in position 29: invalid start byte*
> **** Period 1 will be skipped. Proceeding to next period.
> **** Consider specifying the source file encoding using the 
> 'source_encoding' config option.
> Traceback (most recent call last):
>   File "/usr/share/weewx/weedb/sqlite.py", line 30, in guarded_fn
>     return fn(*args, **kwargs)
>   File "/usr/share/weewx/weedb/sqlite.py", line 219, in execute
>     return sqlite3.Cursor.execute(self, *args, **kwargs)
> sqlite3.OperationalError: attempt to write a readonly database
>
> During handling of the above exception, another exception occurred:
>
>
>
>
>
>
>
>
>
>
>
>
> *Traceback (most recent call last):  File "/usr/share/weewx/wee_import", 
> line 899, in <module>    main()  File "/usr/share/weewx/wee_import", line 
> 829, in main    source_obj.run()  File 
> "/usr/share/weewx/weeimport/weeimport.py", line 435, in run    
> self.dbm._write_metadata('lastUpdate', str(int(new_last_update)))  File 
> "/usr/share/weewx/weewx/manager.py", line 1494, in _write_metadata    
> _cursor.execute(DaySummaryManager.meta_replace_str % self.table_name,  File 
> "/usr/share/weewx/weedb/sqlite.py", line 44, in guarded_fn    raise 
> weedb.OperationalError(e)weedb.OperationalError: attempt to write a 
> readonly database*
>

-- 
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/75d7fe70-36e0-4842-bbb0-020476a586dbn%40googlegroups.com.

Reply via email to