[weewx-user] Wee_import error - write to read only database

2016-10-17 Thread Stephen Kerwin
Yes, that worked. Thanks so much Gary.

weewx@weewx:~$ sudo /home/weewx/bin/wee_import 
--import-config=/home/weewx/archive/csv-update.conf
Starting wee_import...
A CSV import from source file '/home/weewx/archive/csvdata.csv' has been 
requested.
Using database binding 'wx_binding', which is bound to database 'weewx.sdb'
Destination table 'archive' unit system is '0x10' (METRIC).
Missing derived observations will be calculated.
Starting import ...
7 records identified for import.
Proceeding will save all imported records in the weewx archive.
Are you sure you want to proceed (y/n)? y
Records processed: 7; Unique records: 7; Last timestamp: 2016-10-16 18:00:00 
AEST (1476604800)
Finished import. 7 raw records resulted in 7 unique records being processed in 
8.36 seconds.
Those records with a timestamp already in the archive will not have been
imported. Confirm successful import in the weewx log file.

-- 
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 weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Wee_import error - write to read only database

2016-10-16 Thread gjr80
Have you tried specifying the full path to wee_import?

Gary

-- 
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 weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Wee_import error - write to read only database

2016-10-16 Thread Stephen Kerwin
Yes, I'd already tried that but it doesn't like sudo.

weewx@weewx:~$ sudo wee_import 
--import-config=/home/weewx/archive/csv-update.conf
sudo: wee_import: command not found

It finds wee_import no problem without sudo.

-- 
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 weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Wee_import error - write to read only database

2016-10-16 Thread gjr80
Hi Stephen,

It is most likely a permissions problem, try prefixing your command with sudo, 
eg:

sudo wee_import

Gary

-- 
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 weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] Wee_import error - write to read only database

2016-10-16 Thread Stephen Kerwin
Hi, I have a Fine Offset USB weather station and use weewx Ver 3.6.1 on a 
Raspberry Pi 2B running the Minibian distro. My weather station suffers from 
the USB lockup problem so I have blocks of missing data. With the release of 
Ver 3.6, I thought I'd have a go at adding the missing data using the 
wee_import utility. All went well until the last step where I got an 'unable to 
add record ... readonly database' error.

I did try to change the database file read/write permissions using 'chmod 666 
weewx.sdb' but this made no difference.

Can anyone think of how I can get around the read only issue? Syslog and 
config/data files follow.

thanks
Steve

Extract from syslog:
Oct 17 14:42:45 weewx wee_import[427]: wee_import: Starting wee_import...
Oct 17 14:42:45 weewx wee_import[427]: wxcalculate: The following values will 
be calculated: barometer=prefer_hardware, windchill=prefer_hardware, 
dewpoint=prefer_hardware, appTemp=prefer_hardware, rainRate=prefer_hardware, 
windrun=prefer_hardware, heatindex=prefer_hardware, 
maxSolarRad=prefer_hardware, humidex=prefer_hardware, pressure=prefer_hardware, 
inDewpoint=prefer_hardware, ET=prefer_hardware, altimeter=prefer_hardware, 
cloudbase=prefer_hardware
Oct 17 14:42:45 weewx wee_import[427]: wxcalculate: The following algorithms 
will be used for calculations: altimeter=aaNOAA, maxSolarRad=RS
Oct 17 14:42:45 weewx wee_import[427]: wee_import: A CSV import from source 
file '/home/weewx/archive/csvdata.csv' has been requested.
Oct 17 14:42:45 weewx wee_import[427]: wee_import: Using database binding 
'wx_binding', which is bound to database 'weewx.sdb'
Oct 17 14:42:45 weewx wee_import[427]: wee_import: Destination table 'archive' 
unit system is '0x10' (METRIC).
Oct 17 14:42:45 weewx wee_import[427]: wee_import: The following imported 
field-to-weewx field map will be used:
Oct 17 14:42:45 weewx wee_import[427]: wee_import:  source field 'outTemp' 
in units 'degree_C' --> weewx field 'outTemp'
Oct 17 14:42:45 weewx wee_import[427]: wee_import:  source field 
'outHumidity' in units 'percent' --> weewx field 'outHumidity'
Oct 17 14:42:45 weewx wee_import[427]: wee_import:  source field 'rain' in 
units 'mm' --> weewx field 'rain'
Oct 17 14:42:45 weewx wee_import[427]: wee_import:  source field 
'timestamp' in units 'unix_epoch' --> weewx field 'dateTime'
Oct 17 14:42:45 weewx wee_import[427]: wee_import:  source field 'windDir' 
in units 'degree_compass' --> weewx field 'windDir'
Oct 17 14:42:45 weewx wee_import[427]: wee_import:  source field 'pressure' 
in units 'hPa' --> weewx field 'pressure'
Oct 17 14:42:45 weewx wee_import[427]: wee_import:  source field 
'windSpeed' in units 'km_per_hour' --> weewx field 'windSpeed'
Oct 17 14:42:45 weewx wee_import[427]: wee_import:  source field 
'inHumidity' in units 'percent' --> weewx field 'inHumidity'
Oct 17 14:42:45 weewx wee_import[427]: wee_import:  source field 'inTemp' 
in units 'degree_C' --> weewx field 'inTemp'
Oct 17 14:42:45 weewx wee_import[427]: wee_import:  source field 'windGust' 
in units 'km_per_hour' --> weewx field 'windGust'
Oct 17 14:42:48 weewx wee_import[427]: manager: unable to add record 2016-10-17 
06:30:00 AEST (1476649800) to database 'weewx.sdb': attempt to write a readonly 
database
Oct 17 14:42:48 weewx wee_import[427]: manager: unable to add record 2016-10-17 
06:00:00 AEST (1476648000) to database 'weewx.sdb': attempt to write a readonly 
database
Oct 17 14:42:48 weewx wee_import[427]: manager: unable to add record 2016-10-17 
05:30:00 AEST (1476646200) to database 'weewx.sdb': attempt to write a readonly 
database
Oct 17 14:42:48 weewx wee_import[427]: manager: unable to add record 2016-10-17 
05:00:00 AEST (1476644400) to database 'weewx.sdb': attempt to write a readonly 
database
Oct 17 14:42:48 weewx wee_import[427]: manager: unable to add record 2016-10-17 
04:30:00 AEST (1476642600) to database 'weewx.sdb': attempt to write a readonly 
database
Oct 17 14:42:48 weewx wee_import[427]: manager: unable to add record 2016-10-16 
18:30:00 AEST (1476606600) to database 'weewx.sdb': attempt to write a readonly 
database
Oct 17 14:42:48 weewx wee_import[427]: manager: unable to add record 2016-10-16 
18:00:00 AEST (1476604800) to database 'weewx.sdb': attempt to write a readonly 
database
Oct 17 14:42:48 weewx wee_import[427]: wee_import: Finished import. 7 raw 
records resulted in 7 unique records being processed in 2.68 seconds.


Data file csvdata.csv:
timestamp,pressure,inTemp,outTemp,inHumidity,outHumidity,windSpeed,windDir,windGust,rain
2016-10-17 06:30:00,991.2,21.3,13.8,53,92,4,225,4,0
2016-10-17 06:00:00,991.2,21.3,12.9,53,94,0,,0,0
2016-10-17 05:30:00,991.1,21.4,11.7,53,96,0,,0,0
2016-10-17 05:00:00,991.1,21.4,11.7,53,94,0,,0,0
2016-10-17 04:30:00,991.1,21.4,11.7,53,95,0,,0,0
2016-10-16 18:30:00,992.8,24.3,20.3,42,61,6,45,6,0
2016-10-16 18:00:00,992.8,24.3,20.8,42,59,9,45,9,0



Config file csv-update.conf (comments deleted here to cut down