[weewx-user] Weewx 5.0.0 b13 ftp error 553 Could not create file.

2023-10-30 Thread Maarten Weerman
Hi all,

I'm running weewx 5.0.0 build 13 together with Fine Offset WH 3080 and both
worked fine until this evening.

The wh3080 is known for having a usb lockup every now and then (can be
anything from 3 days to 4 weeks if all goes well) and today it was that
time again. So i did what i always do, stopping weewx, resetting the
station and starting weewx again. After an hour or so i looked up the data
on my website realizing that it is still not updating.

Taking a look on the error log, i noticed that i get an error 553 everytime
ftpgenerator wanted to upload a file.
Ftp username, password and server name are correct and i haven't changed
anything in the weewx.conf

Any ideas what i can do?

Here's the error log

Oct 30 21:00:12 raspberrypi dbus-daemon[1044]: [session uid=1000 pid=1044]
Activating via systemd: service name='org.gtk.vfs.Metadata'
unit='gvfs-metadata.service' requested by ':1.10' (uid=1000 pid=1219
comm="pcmanfm --desktop --profile LXDE-pi ")
Oct 30 21:00:12 raspberrypi systemd[713]: Starting Virtual filesystem
metadata service...
Oct 30 21:00:13 raspberrypi dbus-daemon[1044]: [session uid=1000 pid=1044]
Successfully activated service 'org.gtk.vfs.Metadata'
Oct 30 21:00:13 raspberrypi systemd[713]: Started Virtual filesystem
metadata service.
Oct 30 21:00:14 raspberrypi dbus-daemon[390]: [system] Activating via
systemd: service name='org.freedesktop.PackageKit'
unit='packagekit.service' requested by ':1.48' (uid=1000 pid=1216
comm="lxpanel --profile LXDE-pi ")
Oct 30 21:00:14 raspberrypi systemd[1]: Starting PackageKit Daemon...
Oct 30 21:00:14 raspberrypi PackageKit: daemon start
Oct 30 21:00:17 raspberrypi dbus-daemon[390]: [system] Successfully
activated service 'org.freedesktop.PackageKit'
Oct 30 21:00:17 raspberrypi systemd[1]: Started PackageKit Daemon.
Oct 30 21:00:23 raspberrypi PackageKit: refresh-cache transaction
/1684_ceecddcd from uid 1000 finished with success after 6239ms
+Oct 30 21:00:32 raspberrypi PackageKit: get-updates transaction
/1686_acbebeae from uid 1000 finished with success after 8775ms
Oct 30 21:00:51 raspberrypi weewx[1841] INFO weewxd: Initializing weewx
version 5.0.0b13
Oct 30 21:00:51 raspberrypi weewx[1841] INFO weewxd: Using Python 3.9.2
(default, Mar 12 2021, 04:06:34) #012[GCC 10.2.1 20210110]
Oct 30 21:00:51 raspberrypi weewx[1841] INFO weewxd: Located at
/usr/bin/python3
Oct 30 21:00:51 raspberrypi weewx[1841] INFO weewxd: Platform
Linux-5.15.32-v7+-armv7l-with-glibc2.31
Oct 30 21:00:51 raspberrypi weewx[1841] INFO weewxd: Locale is 'de_DE.UTF-8'
Oct 30 21:00:51 raspberrypi weewx[1841] INFO weewxd: Entry path:
/usr/local/lib/python3.9/dist-packages/weewxd.py
Oct 30 21:00:51 raspberrypi weewx[1841] INFO weewxd: Using configuration
file /home/weewx/weewx.conf
Oct 30 21:00:51 raspberrypi weewx[1841] INFO weewxd: Debug is 0
Oct 30 21:00:51 raspberrypi weewx[1841] INFO weewx.engine: Loading station
type FineOffsetUSB (weewx.drivers.fousb)
Oct 30 21:00:51 raspberrypi weewx[1841] INFO weewx.drivers.fousb: driver
version is 1.3
Oct 30 21:00:51 raspberrypi weewx[1841] INFO weewx.drivers.fousb: polling
mode is PERIODIC
Oct 30 21:00:51 raspberrypi weewx[1841] INFO weewx.drivers.fousb: polling
interval is 60
Oct 30 21:00:52 raspberrypi weewx[1841] INFO weewx.drivers.fousb: found
station on USB bus= device=
Oct 30 21:00:52 raspberrypi weewx[1841] INFO weewx.engine: StdConvert
target unit is 0x1
Oct 30 21:00:52 raspberrypi weewx[1841] INFO weewx.wxservices:
StdWXCalculate will use data binding wx_binding
Oct 30 21:00:52 raspberrypi weewx[1841] INFO weewx.engine: Archive will use
data binding wx_binding
Oct 30 21:00:52 raspberrypi weewx[1841] INFO weewx.engine: Record
generation will be attempted in 'software'
Oct 30 21:00:52 raspberrypi weewx[1841] INFO weewx.engine: Using archive
interval of 300 seconds (software record generation)
Oct 30 21:00:52 raspberrypi weewx[1841] INFO weewx.restx: StationRegistry:
Station will be registered.
Oct 30 21:00:52 raspberrypi weewx[1841] INFO weewx.restx: Wunderground:
Posting not enabled.
Oct 30 21:00:52 raspberrypi weewx[1841] INFO weewx.restx: PWSweather:
Posting not enabled.
Oct 30 21:00:52 raspberrypi weewx[1841] INFO weewx.restx: CWOP: Posting not
enabled.
Oct 30 21:00:52 raspberrypi weewx[1841] INFO weewx.restx: WOW: Posting not
enabled.
Oct 30 21:00:52 raspberrypi weewx[1841] INFO weewx.restx: AWEKAS: Data will
be uploaded for user Georg8019
Oct 30 21:00:52 raspberrypi weewx[1841] INFO weewx.engine: 'pyephem'
detected, extended almanac data is available
Oct 30 21:00:52 raspberrypi weewx[1841] INFO weewxd: Starting up weewx
version 5.0.0b13
Oct 30 21:00:52 raspberrypi weewx[1841] INFO weewx.engine: Using binding
'wx_binding' to database 'weewx.sdb'
Oct 30 21:00:52 raspberrypi weewx[1841] INFO weewx.manager: Starting
backfill of daily summaries
Oct 30 21:00:52 raspberrypi weewx[1841] INFO weewx.manager: Daily summaries
up to date
Oct 30 21:00:53 raspberrypi weewx[1841] INFO weewx.drivers.fousb:
synchronising to the weather 

Re: [weewx-user] Having problems with weewx not wrighting all the rain into reports.

2023-10-30 Thread kufuu
Ok, this is what I found happening, the other day when I reset the weather 
station pico enviro weather it was sending the payload at 5 min intervals 
example 20:06:09 and it was writing to db and sending the data to weather 
underground every reading, now the clock resets ever so often on the 
weather station and now its example 20:05:09 and its only recording and 
sending to WU every other reading. weewx is up to date and running on a pi 
zero w. Any clues ? Heres a copy of the log

Oct 30 19:00:09 zero-wx weewx[6949] DEBUG user.MQTTSubscribe: (Driver) 
MessageCallbackProvider data-> incoming topic: enviro/river-wx, QOS: 0, 
retain: 0, payload: b'{"readings": {"pressure": 950.45, "rain": 0, 
"wind_speed": 0, "temperature": 10.73, "humidity": 86.41, "wind_direction": 
90, "rain_per_second": 0.0, "luminance": 0.0}, "nickname": "river-wx", 
"model": "weather", "uid": "e6614c311b62b034", "timestamp": 
"2023-10-30T23:00:05Z"}'
Oct 30 19:00:09 zero-wx weewx[6949] DEBUG user.MQTTSubscribe: (Driver) 
TopicManager data-> incoming enviro/river-wx: 'luminance': '0.0', 
'outHumidity': '86.41', 'outTemp': '10.73', 'pressure': '950.45', 'rain': 
'0.0', 'rainPersecond': '0.0', 'windDir': '90.0', 'windSpeed': '0.0'
Oct 30 19:00:09 zero-wx weewx[6949] DEBUG user.MQTTSubscribe: (Driver) 
TopicManager data-> outgoing enviro/river-wx: 'dateTime': 
'1698706809.1511908', 'luminance': '0.0', 'outHumidity': '86.41', 
'outTemp': '10.73', 'pressure': '950.45', 'rain': '0.0', 'rainPersecond': 
'0.0', 'usUnits': '17', 'windDir': '90.0', 'windSpeed': '0.0'
Oct 30 19:00:09 zero-wx weewx[6949] DEBUG user.MQTTSubscribe: (Driver) 
data-> final loop packet is enviro/river-wx 2023-10-30 19:00:09 EDT 
(1698706809): 'dateTime': '1698706809.1511908', 'luminance': '0.0', 
'outHumidity': '86.41', 'outTemp': '10.73', 'pressure': '950.45', 'rain': 
'0.0', 'rainPersecond': '0.0', 'usUnits': '17', 'windDir': '90.0', 
'windSpeed': '0.0'
Oct 30 19:05:09 zero-wx weewx[6949] DEBUG user.MQTTSubscribe: (Driver) 
MessageCallbackProvider data-> incoming topic: enviro/river-wx, QOS: 0, 
retain: 0, payload: b'{"readings": {"pressure": 950.54, "rain": 0, 
"wind_speed": 0, "temperature": 10.58, "humidity": 89.15, "wind_direction": 
90, "rain_per_second": 0.0, "luminance": 0.0}, "nickname": "river-wx", 
"model": "weather", "uid": "e6614c311b62b034", "timestamp": 
"2023-10-30T23:05:05Z"}'
Oct 30 19:05:09 zero-wx weewx[6949] DEBUG user.MQTTSubscribe: (Driver) 
TopicManager data-> incoming enviro/river-wx: 'luminance': '0.0', 
'outHumidity': '89.15', 'outTemp': '10.58', 'pressure': '950.54', 'rain': 
'0.0', 'rainPersecond': '0.0', 'windDir': '90.0', 'windSpeed': '0.0'
Oct 30 19:05:09 zero-wx weewx[6949] DEBUG user.MQTTSubscribe: (Driver) 
TopicManager data-> outgoing enviro/river-wx: 'dateTime': 
'1698707109.1076276', 'luminance': '0.0', 'outHumidity': '89.15', 
'outTemp': '10.58', 'pressure': '950.54', 'rain': '0.0', 'rainPersecond': 
'0.0', 'usUnits': '17', 'windDir': '90.0', 'windSpeed': '0.0'
Oct 30 19:05:09 zero-wx weewx[6949] DEBUG user.MQTTSubscribe: (Driver) 
data-> final loop packet is enviro/river-wx 2023-10-30 19:05:09 EDT 
(1698707109): 'dateTime': '1698707109.1076276', 'luminance': '0.0', 
'outHumidity': '89.15', 'outTemp': '10.58', 'pressure': '950.54', 'rain': 
'0.0', 'rainPersecond': '0.0', 'usUnits': '17', 'windDir': '90.0', 
'windSpeed': '0.0'
Oct 30 19:05:09 zero-wx weewx[6949] DEBUG user.MQTTSubscribe: (Driver) No 
archive topic configured.
Oct 30 19:05:10 zero-wx weewx[6949] INFO weewx.manager: Added record 
2023-10-30 19:05:00 EDT (1698707100) to database 'weewx.sdb'
Oct 30 19:05:10 zero-wx weewx[6949] INFO weewx.manager: Added record 
2023-10-30 19:05:00 EDT (1698707100) to daily summary in 'weewx.sdb'
Oct 30 19:05:11 zero-wx weewx[6949] DEBUG weewx.reportengine: Running 
reports for latest time in the database.
Oct 30 19:05:11 zero-wx weewx[6949] DEBUG weewx.reportengine: Running 
report 'SeasonsReport'
Oct 30 19:05:11 zero-wx weewx[6949] DEBUG weewx.reportengine: Found 
configuration file /etc/weewx/skins/Seasons/skin.conf for report 
'SeasonsReport'
Oct 30 19:05:11 zero-wx weewx[6949] INFO weewx.restx: Wunderground-PWS: 
Published record 2023-10-30 19:05:00 EDT (1698707100)
Oct 30 19:05:12 zero-wx weewx[6949] DEBUG weewx.cheetahgenerator: Using 
search list ['weewx.cheetahgenerator.Almanac', 
'weewx.cheetahgenerator.Current', 'weewx.cheetahgenerator.DisplayOptions', 
'weewx.cheetahgenerator.Extras', 'weewx.cheetahgenerator.Gettext', 
'weewx.cheetahgenerator.JSONHelpers', 'weewx.cheetahgenerator.PlotInfo', 
'weewx.cheetahgenerator.SkinInfo', 'weewx.cheetahgenerator.Station', 
'weewx.cheetahgenerator.Stats', 'weewx.cheetahgenerator.UnitInfo']
Oct 30 19:05:12 zero-wx weewx[6949] DEBUG weewx.manager: Daily summary 
version is 4.0
Oct 30 19:05:24 zero-wx weewx[6949] INFO weewx.cheetahgenerator: Generated 
8 files for report SeasonsReport in 12.36 seconds
Oct 30 19:05:24 zero-wx weewx[6949] DEBUG weewx.manager: Daily summary 
version is 4.0

Re: [weewx-user] Having problems with weewx not wrighting all the rain into reports.

2023-10-30 Thread kufuu
Ok, this is what I found happening, the other day when I reset the weather 
station pico enviro weather it was sending the payload at 5 min intervals 
example 20:06:09 and it was writing to db and sending the data to weather 
underground every reading, now the clock resets ever so often on the 
weather station and now its example 20:05:09 and its only recording and 
sending to WU every other reading. weewx is up to date and running on a pi 
zero w. Any clues ?

On Sunday, October 29, 2023 at 10:54:56 AM UTC-4 kufuu wrote:

> I completely removed weewx from the pi zero and reloaded it, It seems to 
> have cleared up 2 problems I had, its writing to the to the db every 
> reading now and the rain is being recorded, Ill have to see when we get 
> some rain if that holds out.
>
>
> On Friday, October 27, 2023 at 8:58:29 AM UTC-4 kufuu wrote:
>
>> I did load DB Browser and seen that the 1697832900 packet did not record 
>> the rain in the db.
>>
>> On Thursday, October 26, 2023 at 12:03:02 PM UTC-4 kufuu wrote:
>>
>>> Thanks Rich , All the other observations are good, I don't know how to 
>>> look at the database, I do have sqlite installed however  I'm a newbie at 
>>> this.
>>>
>>> On Monday, October 23, 2023 at 9:14:26 AM UTC-4 Rich Bell wrote:
>>>
 I agree it looks like WeeWX is getting the information. The line below 
 is logged right before the loop packet is generated. This should be seen 
 in 
 the 1697833200 archive record. So no rain.
 Oct 20 16:15:02 zero-wx weewx[579] DEBUG user.MQTTSubscribe: (Driver) 
 data-> final loop packet is enviro/river-wx 2023-10-20 16:15:00 EDT 
 (1697832900): 'dateTime': '1697832900.6921751', 'luminance': '171.37', 
 'outHumidity': '77.89', 'outTemp': '13.52', 'pressure': '936.97', 'rain': 
 '0.0', 'usUnits': '17', 'windDir': '45.0', 'windSpeed': '0.0'

 The line below is logged right before the loop packet is generated. 
 This should be seen in the next archive record. So 2.514 mm or .099 in.
 Oct 20 16:20:00 zero-wx weewx[579] DEBUG user.MQTTSubscribe: (Driver) 
 data-> final loop packet is enviro/river-wx 2023-10-20 16:20:00 EDT 
 (1697833200): 'dateTime': '1697833200.808235', 'luminance': '82.25', 
 'outHumidity': '77.04', 'outTemp': '13.6', 'pressure': '937.04', 'rain': 
 '2.5146', 'usUnits': '17', 'windDir': '45.0', 'windSpeed': '2.12127'

 The next thing to try is, run WeeWX from the command line. This will 
 print the loop packets and archive records to the console.

 Out of curiosity, what are the values in the database? Do the other 
 observations look correct?
 rich


 On Fri, Oct 20, 2023 at 5:10 PM kufuu  wrote:

> Using weewx mqtt from a pi pico enviro weather, had rain off and on 
> all day today and this morning the reports had .110" , after another .100 
> later weewx didnt write it to the reports, went out and manually added 
> rain 
> to try to figure out whats wrong and still didnt write it, weewx is 
> getting 
> it but dont know whats going on. Heres the script.
>
> Oct 20 16:15:00 zero-wx weewx[579] DEBUG user.MQTTSubscribe: (Driver) 
> MessageCallbackProvider data-> incoming topic: enviro/river-wx, QOS: 0, 
> retain: 0, payload: b'{"readings": {"pressure": 936.97, "rain": 0, 
> "wind_speed": 0, "temperature": 13.52, "humidity": 77.89, 
> "wind_direction": 
> 45, "rain_per_second": 0.0, "luminance": 171.37}, "nickname": "river-wx", 
> "model": "weather", "uid": "e6614c311b62b034", "timestamp": 
> "2023-10-20T20:15:05Z"}'
> Oct 20 16:15:00 zero-wx weewx[579] DEBUG user.MQTTSubscribe: (Driver) 
> TopicManager data-> incoming enviro/river-wx: 'luminance': '171.37', 
> 'outHumidity': '77.89', 'outTemp': '13.52', 'pressure': '936.97', 'rain': 
> '0.0', 'windDir': '45.0', 'windSpeed': '0.0'
> Oct 20 16:15:02 zero-wx weewx[579] DEBUG user.MQTTSubscribe: (Driver) 
> TopicManager data-> outgoing enviro/river-wx: 'dateTime': 
> '1697832900.6921751', 'luminance': '171.37', 'outHumidity': '77.89', 
> 'outTemp': '13.52', 'pressure': '936.97', 'rain': '0.0', 'usUnits': '17', 
> 'windDir': '45.0', 'windSpeed': '0.0'
> Oct 20 16:15:02 zero-wx weewx[579] DEBUG user.MQTTSubscribe: (Driver) 
> data-> final loop packet is enviro/river-wx 2023-10-20 16:15:00 EDT 
> (1697832900): 'dateTime': '1697832900.6921751', 'luminance': '171.37', 
> 'outHumidity': '77.89', 'outTemp': '13.52', 'pressure': '936.97', 'rain': 
> '0.0', 'usUnits': '17', 'windDir': '45.0', 'windSpeed': '0.0'
> Oct 20 16:17:01 zero-wx CRON[1104]: (root) CMD (   cd / && run-parts 
> --report /etc/cron.hourly)
> Oct 20 16:20:00 zero-wx weewx[579] DEBUG user.MQTTSubscribe: (Driver) 
> MessageCallbackProvider data-> incoming topic: enviro/river-wx, QOS: 0, 
> retain: 0, payload: b'{"readings": {"pressure": 937.04, "rain": 2.5146, 
> "wind_speed": 2.12127, 

[weewx-user] Re: ws28xx: run weewx as non-root user?

2023-10-30 Thread vince
Yes.  Maybe. What device does it use ?

If you are on a pi using user 'pi' you are a member of group 'dialout' 
which can access the serial/usb port ala /dev/ttyUSB0 without making any 
changes.  That's how my VP2 using a serial2usb converter works.

On Monday, October 30, 2023 at 2:20:38 PM UTC-7 michael.k...@gmx.at wrote:

> Can I run weewx as non-root user using the ws28xx driver?
>
> I am on raspianOS, is there a device I have to change access rights or is 
> there a group to add the user to, or some other rule to let unprivileged 
> users access the device?
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/5715e32c-ede9-43ec-9e64-b33b4e384a30n%40googlegroups.com.


[weewx-user] ws28xx: run weewx as non-root user?

2023-10-30 Thread michael.k...@gmx.at
Can I run weewx as non-root user using the ws28xx driver?

I am on raspianOS, is there a device I have to change access rights or is 
there a group to add the user to, or some other rule to let unprivileged 
users access the device?

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/25b68d56-800e-4f6e-9f2d-e4b165d33b4en%40googlegroups.com.


Re: [weewx-user] Cascading errors for the Seasons base skin.

2023-10-30 Thread gjr80
When importing records with wee_import primary key duplicate entry log 
entries indicate a record with the timestamp of the current imported record 
already exists in the database. This most commonly occurs if the import 
period overlaps with existing database data. This is normal and not 
considered an error. In such cases the imported record is discarded and no 
database changes are made. If the imported record is required rather than 
the corresponding record in the database, the database record must be 
deleted and the import performed again. If the database record is to be 
retained then nothing need be done.

Gary

On Tuesday, 31 October 2023 at 04:50:45 UTC+10 sylvain...@gmail.com wrote:

> Hello Gary.
>
> Thank you very much for your work !
> I updated the weeimport.py file at 6:50 p.m.
>
> I created a small bash script (I'm not a programmer) to download my WU 
> data every hour (I didn't dare to be more greedy). The script is triggered 
> by the crontab.
> My script retrieves the last timestamp from the mysql database and uses it 
> as dateFrom=%Y-%m-%dT%H:%M. The recovery date is dateTo=%Y-%m-%dT%H:%M. In 
> principle everything works well.
>
> If I understood correctly, the calculation error that you detected can 
> explain my mysql errors of this type 1062, "Duplicate entry '1698663292' 
> for key 'PRIMARY":
>
> #* journalctl -u weewx.service -p err -b -f --since today*
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *...Oct 30 17:28:01 gandalf python3[1261]: weewx[1261] ERROR 
> weewx.manager: Unable to add record 2022-07-12 03:55:00 CEST (1657590900) 
> to database 'weewx': (1062, " Duplicate entry '1657590900' for key 
> 'PRIMARY'")Oct 30 17:33:02 gandalf python3[1261]: weewx[1261] ERROR 
> weewx.manager: Unable to add record 2022-07-12 04:00:00 CEST (1657591200) 
> to database 'weewx': (1062, " Duplicate entry '1657591200' for key 
> 'PRIMARY'")Oct 30 17:38:03 gandalf python3[1261]: weewx[1261] ERROR 
> weewx.manager: Unable to add record 2022-07-12 04:05:00 CEST (1657591500) 
> to database 'weewx': (1062, " Duplicate entry '1657591500' for key 
> 'PRIMARY'")Oct 30 17:43:04 gandalf python3[1261]: weewx[1261] ERROR 
> weewx.manager: Unable to add record 2022-07-12 04:10:00 CEST (1657591800) 
> to database 'weewx': (1062, " Duplicate entry '1657591800' for key 
> 'PRIMARY'")Oct 30 17:48:04 gandalf python3[1261]: weewx[1261] ERROR 
> weewx.manager: Unable to add record 2022-07-12 04:15:00 CEST (1657592100) 
> to database 'weewx': (1062, " Duplicate entry '1657592100' for key 
> 'PRIMARY'")Oct 30 17:53:04 gandalf python3[1261]: weewx[1261] ERROR 
> weewx.manager: Unable to add record 2022-07-12 04:20:00 CEST (1657592400) 
> to database 'weewx': (1062, " Duplicate entry '1657592400' for key 
> 'PRIMARY'")Oct 30 17:58:05 gandalf python3[1261]: weewx[1261] ERROR 
> weewx.manager: Unable to add record 2022-07-12 04:25:00 CEST (1657592700) 
> to database 'weewx': (1062, " Duplicate entry '1657592700' for key 
> 'PRIMARY'")Oct 30 18:03:05 gandalf python3[1261]: weewx[1261] ERROR 
> weewx.manager: Unable to add record 2022-07-12 04:30:00 CEST (1657593000) 
> to database 'weewx': (1062, " Duplicate entry '1657593000' for key 
> 'PRIMARY'")Oct 30 18:08:05 gandalf python3[1261]: weewx[1261] ERROR 
> weewx.manager: Unable to add record 2022-07-12 04:35:00 CEST (1657593300) 
> to database 'weewx': (1062, " Duplicate entry '1657593300' for key 
> 'PRIMARY'")Oct 30 18:13:05 gandalf python3[1261]: weewx[1261] ERROR 
> weewx.manager: Unable to add record 2022-07-12 04:40:00 CEST (1657593600) 
> to database 'weewx': (1062, " Duplicate entry '1657593600' for key 
> 'PRIMARY'")Oct 30 18:18:07 gandalf python3[1261]: weewx[1261] ERROR 
> weewx.manager: Unable to add record 2022-07-12 04:45:00 CEST (1657593900) 
> to database 'weewx': (1062, " Duplicate entry '1657593900' for key 
> 'PRIMARY'")Oct 30 18:23:07 gandalf python3[1261]: weewx[1261] ERROR 
> weewx.manager: Unable to add record 2022-07-12 04:50:00 CEST (1657594200) 
> to database 'weewx': (1062, " Duplicate entry '1657594200' for key 
> 'PRIMARY'")Oct 30 18:28:07 gandalf python3[1261]: weewx[1261] ERROR 
> weewx.manager: Unable to add record 2022-07-12 04:55:00 CEST (1657594500) 
> to database 'weewx': (1062, " Duplicate entry '1657594500' for key 
> 'PRIMARY'")Oct 30 18:33:07 gandalf python3[1261]: weewx[1261] ERROR 
> weewx.manager: Unable to add record 2022-07-12 05:00:00 CEST (1657594800) 
> to database 'weewx': (1062, " Duplicate entry '1657594800' for key 
> 'PRIMARY'")Oct 30 18:38:08 gandalf python3[1261]: weewx[1261] ERROR 
> weewx.manager: Unable to add record 2022-07-12 05:05:00 CEST (1657595100) 
> to database 'weewx': (1062, " Duplicate entry '1657595100' for key 
> 'PRIMARY'")Oct 30 18:43:08 gandalf python3[1261]: weewx[1261] ERROR 
> weewx.manager: Unable to add record 2022-07-12 05:10:00 CEST (1657595400) 
> to database 'weewx': (1062, " Duplicate entry '1657595400' for key 
> 'PRIMARY'")Oct 30 18:48:08 gandalf python3[1261]: weewx[1261] 

[weewx-user] Re: Importing Historical Data from Weatherlink.com

2023-10-30 Thread The Reckoning
Thanks for your detailed responses. That is great info!

On Monday, October 30, 2023 at 4:20:44 PM UTC-4 gjr80 wrote:

> Perhaps a little late as you seem to have solved your issues but a few 
> points post importing data.
>
> 1. Checking for a successful import by looking at the WeeWX generated web 
> pages is a poor choice as it often provides misleading information. When 
> folks import data it is often to obtain historical data from some days (or 
> months or years) ago; WeeWX typically displays such data in plots or on 
> historical stats pages. Many plots (particularly week, month and year) use 
> aggregate periods of one, three or 24 hours when obtaining their source 
> data. WeeWX plots are updated every aggregate period so some plots may not 
> update for one, three or 24 hours. Stats type pages typically update each 
> report cycle, so they may well (or may not) give an indication if data was 
> successfully imported, but this indication will likely before for a few 
> specific points in time rather than an extensive report (such as provided 
> in a plot). The best measure of a success import is to look at the data in 
> the database (the archive table) and to look at the WeeWX log.
>
> 2. '*unable to add record UNIQUE constraint failed*' log entries are 
> entirely normal and not considered an error, it is just WeeWX saying that a 
> record with the same timestamp as the current imported record already 
> exists in the WeeWX database and the imported record has been discarded. 
> Unfortunately wee_import cannot tell (well not in an efficient manner) if 
> an imported record already exists in the database, so hence the summary 
> reporting within wee_import states the number of records processed and 
> the number of unique records imported but refers the user to the WeeWX log 
> for what actually happened.
>
> 3. There is no need for dropping or rebuilding daily summaries when 
> importing. wee_import automatically updates the daily summaries. A drop 
> and rebuild should only be used where an import failed mid-stream (and then 
> it will unlikely be required due to the transactional nature of database 
> operations performed by wee_import (and WeeWX)). Arguably, unnecessary 
> dropping and rebuilding actually loses data as this can reduce the 
> granularity of highs/lows (both in terms of value and time) recorded in the 
> daily summaries for each observation - but that is another story.
>
> 4. NOAA format reports are updated each report cycle but only the current 
> month and year report are updated; WeeWX does not go back and recreate any 
> earlier/missing month/year reports. The solution here is to delete all NOAA 
> format reports from the WeeWX machine and this will force WeeWX to 
> regenerate all NOAA format reports for all time on the next report cycle. 
> This can take quite a few minutes (database size dependent) so for multiple 
>  imports it may be time effective to perform one import, delete and check 
> NOAA format report generation and then force regeneration. Once satisfied 
> the first import works, perform the rest of the imports then force NOAA 
> format report regeneration once the imports are complete.
>
> 5. Plots can suffer a similar problem to the NOAA format reports but due 
> to a different mechanism (refer 1. above). The solution; however, is the 
> same; delete all plots on the WeeWX machine to force regeneration. Again 
> this can take a long time so for multiple imports it may be more time 
> effective to perform one import, delete and check plot generation and then 
> force plot regeneration once the imports are complete.
>
> Gary 
> On Tuesday, 31 October 2023 at 05:37:41 UTC+10 hinso...@gmail.com wrote:
>
>> Another update. Man have I learned a lot about weewx and databases in 
>> general through this process. I am typing all of this up in the hopes that 
>> it helps someone in the future who encounters a similar issue. 
>>
>> I examined the daily summary databases such as archive_day_outTemp and 
>> they all looked normal. In short, the data import worked as expected with 
>> no issues. All databases have all my data and are up to date.
>>
>> To fix this issue, I deleted everything from */var/www/html/weewx, *stopped 
>> and restarted weewx, and viola! All summaries appeared. It looks like the 
>> NOAA Monthly and yearly summaries did not regenerate since I did the 
>> import. I had assumed that they would have done so when I ran *sudo 
>> wee_database --drop-daily* and *sudo wee_database **--rebuild-daily *but 
>> they did not.
>> On Monday, October 30, 2023 at 2:36:41 PM UTC-4 The Reckoning wrote:
>>
>>> I exported my database (with all imports complete) to a CSV via sqlite3. 
>>>
>>> All the data is there but the Daily/Monthly/Yearly summaries wont 
>>> generate for certain days. I don't see anything different about the data 
>>> for these days/months. See for yourself. CSV Linked below. The file is 
>>> called weewx_db_export.csv.
>>>
>>> Link 
>>> 

[weewx-user] Re: Importing Historical Data from Weatherlink.com

2023-10-30 Thread gjr80
Perhaps a little late as you seem to have solved your issues but a few 
points post importing data.

1. Checking for a successful import by looking at the WeeWX generated web 
pages is a poor choice as it often provides misleading information. When 
folks import data it is often to obtain historical data from some days (or 
months or years) ago; WeeWX typically displays such data in plots or on 
historical stats pages. Many plots (particularly week, month and year) use 
aggregate periods of one, three or 24 hours when obtaining their source 
data. WeeWX plots are updated every aggregate period so some plots may not 
update for one, three or 24 hours. Stats type pages typically update each 
report cycle, so they may well (or may not) give an indication if data was 
successfully imported, but this indication will likely before for a few 
specific points in time rather than an extensive report (such as provided 
in a plot). The best measure of a success import is to look at the data in 
the database (the archive table) and to look at the WeeWX log.

2. '*unable to add record UNIQUE constraint failed*' log entries are 
entirely normal and not considered an error, it is just WeeWX saying that a 
record with the same timestamp as the current imported record already 
exists in the WeeWX database and the imported record has been discarded. 
Unfortunately wee_import cannot tell (well not in an efficient manner) if 
an imported record already exists in the database, so hence the summary 
reporting within wee_import states the number of records processed and the 
number of unique records imported but refers the user to the WeeWX log for 
what actually happened.

3. There is no need for dropping or rebuilding daily summaries when 
importing. wee_import automatically updates the daily summaries. A drop and 
rebuild should only be used where an import failed mid-stream (and then it 
will unlikely be required due to the transactional nature of database 
operations performed by wee_import (and WeeWX)). Arguably, unnecessary 
dropping and rebuilding actually loses data as this can reduce the 
granularity of highs/lows (both in terms of value and time) recorded in the 
daily summaries for each observation - but that is another story.

4. NOAA format reports are updated each report cycle but only the current 
month and year report are updated; WeeWX does not go back and recreate any 
earlier/missing month/year reports. The solution here is to delete all NOAA 
format reports from the WeeWX machine and this will force WeeWX to 
regenerate all NOAA format reports for all time on the next report cycle. 
This can take quite a few minutes (database size dependent) so for multiple 
 imports it may be time effective to perform one import, delete and check 
NOAA format report generation and then force regeneration. Once satisfied 
the first import works, perform the rest of the imports then force NOAA 
format report regeneration once the imports are complete.

5. Plots can suffer a similar problem to the NOAA format reports but due to 
a different mechanism (refer 1. above). The solution; however, is the same; 
delete all plots on the WeeWX machine to force regeneration. Again this can 
take a long time so for multiple imports it may be more time effective to 
perform one import, delete and check plot generation and then force plot 
regeneration once the imports are complete.

Gary 
On Tuesday, 31 October 2023 at 05:37:41 UTC+10 hinso...@gmail.com wrote:

> Another update. Man have I learned a lot about weewx and databases in 
> general through this process. I am typing all of this up in the hopes that 
> it helps someone in the future who encounters a similar issue. 
>
> I examined the daily summary databases such as archive_day_outTemp and 
> they all looked normal. In short, the data import worked as expected with 
> no issues. All databases have all my data and are up to date.
>
> To fix this issue, I deleted everything from */var/www/html/weewx, *stopped 
> and restarted weewx, and viola! All summaries appeared. It looks like the 
> NOAA Monthly and yearly summaries did not regenerate since I did the 
> import. I had assumed that they would have done so when I ran *sudo 
> wee_database --drop-daily* and *sudo wee_database **--rebuild-daily *but 
> they did not.
> On Monday, October 30, 2023 at 2:36:41 PM UTC-4 The Reckoning wrote:
>
>> I exported my database (with all imports complete) to a CSV via sqlite3. 
>>
>> All the data is there but the Daily/Monthly/Yearly summaries wont 
>> generate for certain days. I don't see anything different about the data 
>> for these days/months. See for yourself. CSV Linked below. The file is 
>> called weewx_db_export.csv.
>>
>> Link 
>> 
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To 

[weewx-user] Re: Importing Historical Data from Weatherlink.com

2023-10-30 Thread The Reckoning
I am going to remove the files from the link that I posted above but am 
going to paste the csv.conf file that i used as well as sample of my data 
to help those in the future. 
Basically here are the steps to get historical data off of Weatherlink.com 
and into weewx:

   1. Go to Weatherlink.com. Login. Click the Data tab. Set the start Date 
   and time period accordingly. Click the arrow inside the box above the time 
   period and enter your email address. This will send you a CSV file. I had 
   about 4 years of data so I had to repeat this 4 times.
   2. Follow the instructions here 
    for the rest 
   of it. Thats what I did. The below hints might aid you though.
   3. Modify the CSV files. Make them look like the one I have attached 
   below. 
  1. Remove the rows above there the column headers are. 
  2. Convert the wind direction and high speed wind direction from 
  inter-cardinal to degrees. North is 0 NNE is 22.5. NE is 45...etc. this 
can 
  be done by using a reference table and a vlookup formula. 
  3. Change the column headers to something simple. IDK if this is 
  necessary but i did it. if youre using my CSV.conf file, you can use my 
  headers. 
   4. Change the csv.conf file accordingly making sure the units in the 
   FieldMap section match those of your data.
   5. Follow the rest of the instructions in the link.
   6. Take a backup of your database (as recommended) this can usually be 
   found in */var/lib/weewx/weewx.sdb*
   7. Run *sudo wee_import --import-config=/path/to/csv.conf --dry-run*
first
   8. Resolve any errors. 
   9. Run if for real *sudo wee_import --import-config=/path/to/csv.conf*
   10. After it finishes, wait for the website to refresh and then if you 
   find issues with monthly or yearly reports, remove all data from 
   /var/www/html/weewx. Restart weewx. Wait for the website to refresh.


Hope this helps someone!

On Monday, October 30, 2023 at 3:37:41 PM UTC-4 The Reckoning wrote:

> Another update. Man have I learned a lot about weewx and databases in 
> general through this process. I am typing all of this up in the hopes that 
> it helps someone in the future who encounters a similar issue. 
>
> I examined the daily summary databases such as archive_day_outTemp and 
> they all looked normal. In short, the data import worked as expected with 
> no issues. All databases have all my data and are up to date.
>
> To fix this issue, I deleted everything from */var/www/html/weewx, *stopped 
> and restarted weewx, and viola! All summaries appeared. It looks like the 
> NOAA Monthly and yearly summaries did not regenerate since I did the 
> import. I had assumed that they would have done so when I ran *sudo 
> wee_database --drop-daily* and *sudo wee_database **--rebuild-daily *but 
> they did not.
> On Monday, October 30, 2023 at 2:36:41 PM UTC-4 The Reckoning wrote:
>
>> I exported my database (with all imports complete) to a CSV via sqlite3. 
>>
>> All the data is there but the Daily/Monthly/Yearly summaries wont 
>> generate for certain days. I don't see anything different about the data 
>> for these days/months. See for yourself. CSV Linked below. The file is 
>> called weewx_db_export.csv.
>>
>> Link 
>> 
>>
>>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/fb3012dc-a936-42b9-90c1-50eddcb058dan%40googlegroups.com.
# EXAMPLE CONFIGURATION FILE FOR IMPORTING FROM CSV FILES
#
# Copyright (c) 2009-2022 Tom Keffer  and Gary Roderick.
# See the file LICENSE.txt for your rights.

##

# Specify the source. Available options are:
#   CSV - import obs from a single CSV format file
#   WU - import obs from a Weather Underground PWS history
#   Cumulus - import obs from a one or more Cumulus monthly log files
#   WD - import obs from a one or more WD monthly log files
# Format is:
#   source = (CSV | WU | Cumulus)
source = CSV

##

[CSV]
# Parameters used when importing from a CSV file

# Path and name of our CSV source file. Format is:
#   file = full path and filename
file = /home/jm/Desktop/PWS_All2.csv

# The character used to separate fields. Format is:
#   delimiter = 
# Default is , (comma).
delimiter = ','

# Specify the character used as the decimal point. The character
# must be enclosed in quotes.
# Format is:
#   decimal = '.' (dot)
#   or
#   decimal = ',' 

[weewx-user] Re: Importing Historical Data from Weatherlink.com

2023-10-30 Thread The Reckoning
Another update. Man have I learned a lot about weewx and databases in 
general through this process. I am typing all of this up in the hopes that 
it helps someone in the future who encounters a similar issue. 

I examined the daily summary databases such as archive_day_outTemp and they 
all looked normal. In short, the data import worked as expected with no 
issues. All databases have all my data and are up to date.

To fix this issue, I deleted everything from */var/www/html/weewx, *stopped 
and restarted weewx, and viola! All summaries appeared. It looks like the 
NOAA Monthly and yearly summaries did not regenerate since I did the 
import. I had assumed that they would have done so when I ran *sudo 
wee_database --drop-daily* and *sudo wee_database **--rebuild-daily *but 
they did not.
On Monday, October 30, 2023 at 2:36:41 PM UTC-4 The Reckoning wrote:

> I exported my database (with all imports complete) to a CSV via sqlite3. 
>
> All the data is there but the Daily/Monthly/Yearly summaries wont generate 
> for certain days. I don't see anything different about the data for these 
> days/months. See for yourself. CSV Linked below. The file is called 
> weewx_db_export.csv.
>
> Link 
> 
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/5c8a8bec-e391-4652-89e2-bcb813cc3793n%40googlegroups.com.


Re: [weewx-user] Back up of weexwx.sdb...

2023-10-30 Thread Lorin Tremblay
Yes it ran yesterday as planned on one of my weewx setup and the other loop 
forever hence this revised version stops after 10 attempts..


#!/bin/bash

# Set the script name prefix as a variable
sc_name="BackupDB_Weewx"
attempt=1

# Check if sqlite3 is installed

if ! command -v sqlite3 &>/dev/null; then
logger -t "$sc_name" "Error: sqlite3 is not installed on this system."
exit 1
fi

logger -t "$sc_name" "Starting backup of the Weewx Database."

make_backup_copy() {
db="/var/lib/weewx/weewx.sdb"  # Specify the WeeWX database path
backup_dir="/var/lib/weewx/"  # Specify the directory where backups will be 
stored
timestamp="$(date +"%Y%m%d_%H%M%S")"  # Generate a timestamp

# Create the full path for the temporary copy with the timestamp
tmp_db_copy="$backup_dir/weewxdb_${timestamp}.sdb"

check_sum="`/usr/bin/cksum "$db" | cut -d ' ' -f 1`"
cp "$db" "$tmp_db_copy"
check_sum_after="`/usr/bin/cksum "$tmp_db_copy" | cut -d ' ' -f 1`"  # 
Calculate checksum for the copied file

integrity_check="`echo "pragma integrity_check;" | sqlite3 "$tmp_db_copy"`"
if [ "$integrity_check" != "ok" ] && [ "$attempt" -lt 10 ]; then
logger -t "$sc_name" "$tmp_db_copy failed integrity check!"
return 2
fi
logger -t "$sc_name" "$tmp_db_copy integrity check passed!"
return 0
}

while true; do
make_backup_copy
retval="$?"

if [ "$retval" -eq 0 ]; then
logger -t "$sc_name" "Backup successful."
sudo zip -r "$tmp_db_copy.zip" "$tmp_db_copy"
logger -t "$sc_name" "Zipping successful :)"
sleep 1
sudo rm -r "$tmp_db_copy"
logger -t "$sc_name" "Removal of unzipped copy done"
break  # Exit the loop if the backup is successful
else
logger -t "$sc_name" "Backup failed. Retrying in 10 seconds (Attempt 
$attempt)..."
attempt+=1
sleep 10

if [ "$attempt" -ge 10 ]; then
logger -t "$sc_name" "Maximum retry attempts reached. Exiting."
break  # Exit the loop if maximum retry attempts are reached
fi
fi
done

For remote transfer I use the Ftp skin, like this:

# backing in up the database to an ftp server.
[[backup_DB_FTP]]
skin = Ftp
# Override HTML_ROOT:
HTML_ROOT = /var/lib/weewx
server = www.yourdomain.com
path = /path/of/the/remote/server/location
user = Username
password = password


The script can be triggered via a cron job to the interval that you desire.

My crontab is the following.

1 0 * * * /home/pi/Desktop/backup_DB.sh > /home/pi/Desktop/cron

Run everyday at 00:01

FYI I’m not a programmer just dabble with code and starting to learn how to 
code, but nonetheless it ran and gave the expected results.



> On 30 Oct 23, at 14:22, Ton Karsten  wrote:
> 
> A question,
> Has the script been tested yet?
> Can you also make it a downloadable file?
> can you make it possible to save the copy of the db on google drive?
> 
> Op zondag 29 oktober 2023 om 22:53:43 UTC+1 schreef Lorin Tremblay:
>> Thanks for the info…
>> 
>> Here is my update bash script that run with a cron job.
>> 
>> Any comment is more than appreciated I’m stating to code here and there, so 
>> I appreciate any input…
>> 
>> And yes in the future I’ll do more research before posting anything!!
>>  
>> 
>> #!/bin/bash
>> 
>> # Set the script name prefix as a variable
>> sc_name="BackupDB_Weewx"
>> 
>> # Check if sqlite3 is installed
>> 
>> if ! command -v sqlite3 &>/dev/null; then
>> logger -t "$sc_name" "Error: sqlite3 is not installed on this system."
>> exit 1
>> fi
>> 
>> logger -t "$sc_name" "Starting backup of the Weewx Database."
>> 
>> make_backup_copy() {
>> db="/var/lib/weewx/weewx.sdb"  # Specify the WeeWX database path
>> backup_dir="/var/lib/weewx/"  # Specify the directory where backups will 
>> be stored
>> timestamp="$(date +"%Y%m%d_%H%M%S")"  # Generate a timestamp
>> 
>> # Create the full path for the temporary copy with the timestamp
>> tmp_db_copy="$backup_dir/weewxdb_${timestamp}.sdb"
>> 
>> check_sum="`/usr/bin/cksum "$db" | cut -d ' ' -f 1`"
>> cp "$db" "$tmp_db_copy"
>> check_sum_after="`/usr/bin/cksum "$tmp_db_copy" | cut -d ' ' -f 1`"  # 
>> Calculate checksum for the copied file
>> if [ "$check_sum" != "$check_sum_after" ]; then
>> logger -t "$sc_name" "$db changed during copy process!"
>> return 1
>> fi
>> 
>> integrity_check="`echo "pragma integrity_check;" | sqlite3 
>> "$tmp_db_copy"`"
>> if [ "$integrity_check" != "ok" ]; then
>> logger -t "$sc_name" "$tmp_db_copy failed integrity check!"
>> return 2
>> fi
>> logger -t "$sc_name" "$tmp_db_copy integrity check passed!"
>> return 0
>> }
>> 
>> while true; do
>> make_backup_copy
>> retval="$?"
>> 
>> if [ "$retval" -eq 0 ]; then
>> logger -t "$sc_name" "Backup successful."
>> sudo zip -r 

Re: [weewx-user] Re: wunderground import error

2023-10-30 Thread george kyr
Thank you Gary
it worked fine!

Στις Δευ 30 Οκτ 2023 στις 2:54 μ.μ., ο/η gjr80 
έγραψε:

> 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:
>
> $ wget -P /usr/share/weewx/weeimport
> https://raw.githubusercontent.com/weewx/weewx/V5/src/weeimport/wuimport.py
> $ wget -P/usr/share/weewx/weeimport
> https://raw.githubusercontent.com/weewx/weewx/V5/src/weeimport/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
> On Monday, 30 October 2023 at 17:59:08 UTC+10 geop...@gmail.com wrote:
>
>> 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 
>> 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
>>
>> --
> 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+unsubscr...@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
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAL5k_4nwZgTYAoyhO8-5Yqm7He4Y-F6brSfhqnf199V54-FVmA%40mail.gmail.com.


Re: [weewx-user] Cascading errors for the Seasons base skin.

2023-10-30 Thread Sylvain M
Hello Gary.

Thank you very much for your work !
I updated the weeimport.py file at 6:50 p.m.

I created a small bash script (I'm not a programmer) to download my WU data 
every hour (I didn't dare to be more greedy). The script is triggered by 
the crontab.
My script retrieves the last timestamp from the mysql database and uses it 
as dateFrom=%Y-%m-%dT%H:%M. The recovery date is dateTo=%Y-%m-%dT%H:%M. In 
principle everything works well.

If I understood correctly, the calculation error that you detected can 
explain my mysql errors of this type 1062, "Duplicate entry '1698663292' 
for key 'PRIMARY":

#* journalctl -u weewx.service -p err -b -f --since today*
























*...Oct 30 17:28:01 gandalf python3[1261]: weewx[1261] ERROR weewx.manager: 
Unable to add record 2022-07-12 03:55:00 CEST (1657590900) to database 
'weewx': (1062, " Duplicate entry '1657590900' for key 'PRIMARY'")Oct 30 
17:33:02 gandalf python3[1261]: weewx[1261] ERROR weewx.manager: Unable to 
add record 2022-07-12 04:00:00 CEST (1657591200) to database 'weewx': 
(1062, " Duplicate entry '1657591200' for key 'PRIMARY'")Oct 30 17:38:03 
gandalf python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add 
record 2022-07-12 04:05:00 CEST (1657591500) to database 'weewx': (1062, " 
Duplicate entry '1657591500' for key 'PRIMARY'")Oct 30 17:43:04 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 04:10:00 CEST (1657591800) to database 'weewx': (1062, " 
Duplicate entry '1657591800' for key 'PRIMARY'")Oct 30 17:48:04 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 04:15:00 CEST (1657592100) to database 'weewx': (1062, " 
Duplicate entry '1657592100' for key 'PRIMARY'")Oct 30 17:53:04 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 04:20:00 CEST (1657592400) to database 'weewx': (1062, " 
Duplicate entry '1657592400' for key 'PRIMARY'")Oct 30 17:58:05 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 04:25:00 CEST (1657592700) to database 'weewx': (1062, " 
Duplicate entry '1657592700' for key 'PRIMARY'")Oct 30 18:03:05 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 04:30:00 CEST (1657593000) to database 'weewx': (1062, " 
Duplicate entry '1657593000' for key 'PRIMARY'")Oct 30 18:08:05 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 04:35:00 CEST (1657593300) to database 'weewx': (1062, " 
Duplicate entry '1657593300' for key 'PRIMARY'")Oct 30 18:13:05 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 04:40:00 CEST (1657593600) to database 'weewx': (1062, " 
Duplicate entry '1657593600' for key 'PRIMARY'")Oct 30 18:18:07 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 04:45:00 CEST (1657593900) to database 'weewx': (1062, " 
Duplicate entry '1657593900' for key 'PRIMARY'")Oct 30 18:23:07 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 04:50:00 CEST (1657594200) to database 'weewx': (1062, " 
Duplicate entry '1657594200' for key 'PRIMARY'")Oct 30 18:28:07 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 04:55:00 CEST (1657594500) to database 'weewx': (1062, " 
Duplicate entry '1657594500' for key 'PRIMARY'")Oct 30 18:33:07 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 05:00:00 CEST (1657594800) to database 'weewx': (1062, " 
Duplicate entry '1657594800' for key 'PRIMARY'")Oct 30 18:38:08 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 05:05:00 CEST (1657595100) to database 'weewx': (1062, " 
Duplicate entry '1657595100' for key 'PRIMARY'")Oct 30 18:43:08 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 05:10:00 CEST (1657595400) to database 'weewx': (1062, " 
Duplicate entry '1657595400' for key 'PRIMARY'")Oct 30 18:48:08 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 05:15:00 CEST (1657595700) to database 'weewx': (1062, " 
Duplicate entry '1657595700' for key 'PRIMARY'")Oct 30 18:53:08 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 05:20:00 CEST (1657596000) to database 'weewx': (1062, " 
Duplicate entry '1657596000' for key 'PRIMARY'")Oct 30 18:58:09 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 05:25:00 CEST (1657596300) to database 'weewx': (1062, " 
Duplicate entry '1657596300' for key 'PRIMARY'")Oct 30 19:03:09 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 05:30:00 CEST (1657596600) to database 'weewx': (1062, " 
Duplicate entry '1657596600' for key 'PRIMARY'")Oct 30 19:08:09 gandalf 
python3[1261]: weewx[1261] ERROR 

Re: [weewx-user] Back up of weexwx.sdb...

2023-10-30 Thread p q
*can you make it possible to save the copy of the db on google drive? *---
Not so easy after Google made some changes to their APIs. I used to do this
nightly but haven't been able to figure out how to do it anymore.

On Mon, Oct 30, 2023 at 11:22 AM Ton Karsten  wrote:

> A question,
> Has the script been tested yet?
> Can you also make it a downloadable file?
> can you make it possible to save the copy of the db on google drive?
>
> Op zondag 29 oktober 2023 om 22:53:43 UTC+1 schreef Lorin Tremblay:
>
>> Thanks for the info…
>>
>> Here is my update bash script that run with a cron job.
>>
>> Any comment is more than appreciated I’m stating to code here and there,
>> so I appreciate any input…
>>
>> And yes in the future I’ll do more research before posting anything!!
>>
>>
>> #!/bin/bash
>>
>>
>> # Set the script name prefix as a variable
>>
>> sc_name=*"BackupDB_Weewx"*
>>
>>
>> # Check if sqlite3 is installed
>>
>>
>> if ! command* -v* sqlite3 &>/dev/null; then
>>
>> logger* -t* *"$sc_name"* *"Error: sqlite3 is not installed on this
>> system."*
>>
>> exit 1
>>
>> fi
>>
>>
>> logger* -t* *"$sc_name"* *"Starting backup of the Weewx Database."*
>>
>>
>> *make_backup_copy*() {
>>
>> db=*"/var/lib/weewx/weewx.sdb"*  # Specify the WeeWX database path
>>
>> backup_dir=*"/var/lib/weewx/"*  # Specify the directory where
>> backups will be stored
>>
>> timestamp=*"$(date +"*%Y%m%d_%H%M%S*")"*  # Generate a timestamp
>>
>>
>> # Create the full path for the temporary copy with the timestamp
>>
>> tmp_db_copy=*"$backup_dir/weewxdb_${timestamp}.sdb"*
>>
>>
>> check_sum=*"`/usr/bin/cksum "**$db**" | cut -d ' ' -f 1`"*
>>
>> *cp* *"$db"* *"$tmp_db_copy"*
>>
>> check_sum_after=*"`/usr/bin/cksum "**$tmp_db_copy**" | cut -d ' ' -f
>> 1`"*  # Calculate checksum for the copied file
>>
>> if [ *"$check_sum"* != *"$check_sum_after"* ]; then
>>
>> logger* -t* *"$sc_name"* *"$db changed during copy process!"*
>>
>> return 1
>>
>> fi
>>
>>
>> integrity_check=*"`echo "*pragma integrity_check;*" | sqlite3 "*
>> *$tmp_db_copy**"`"*
>>
>> if [ *"$integrity_check"* != *"ok"* ]; then
>>
>> logger* -t* *"$sc_name"* *"$tmp_db_copy failed integrity check!"*
>>
>> return 2
>>
>> fi
>>
>> logger* -t* *"$sc_name"* *"$tmp_db_copy integrity check passed!"*
>>
>> return 0
>>
>> }
>>
>>
>> while true; do
>>
>> make_backup_copy
>>
>> retval=*"$?"*
>>
>>
>> if [ *"$retval"* -eq 0 ]; then
>>
>> logger* -t* *"$sc_name"* *"Backup successful."*
>>
>> sudo zip* -r* *"$tmp_db_copy.zip"* *"$tmp_db_copy"*
>>
>> logger* -t* *"$sc_name"* *"Zipping succesful :)"*
>>
>> sleep 1
>>
>> sudo *rm** -r* *"$tmp_db_copy"*
>>
>> logger* -t* *"$sc_name"* *"Removal of un zipped copy done"*
>>
>> break  # Exit the loop if the backup is successful
>>
>> else
>>
>> logger* -t* *"$sc_name"* *"Backup failed. Retryingin 10
>> seconds..."*
>>
>> sleep 10
>>
>> fi
>>
>> done
>>
>>
>>
>> On 29 Oct 23, at 16:29, vince  wrote:
>>
>> This has been asked and answered literally dozens of times here over the
>> years. Please do a little searching of the old posts for so many threads
>> and methods that it's impossible to reiterate here.  There are also long
>> discussions of how to validate your backup is good for using to restore
>> your system in the future.
>>
>> Short answer is 'copy' to a temporary file.  Compress the temporary
>> file.  No need to stop/restart weewx if you use sqlite3 typically.
>>
>> On Sunday, October 29, 2023 at 12:59:16 PM UTC-7 Lorin Tremblay wrote:
>>
>>> Hi!
>>>
>>> Was wondering If this bash script is an acceptable method to back up the
>>> weewx database on the daily..
>>>
>>> Here is my bash script to do so and I have a cron job that triggers It
>>> at 00:01 everyday...
>>>
>>> # Stop weewx
>>> sudo systemctl stop weewx
>>>
>>> # Define the date format for backup filename
>>> DATE=$(date +*"%Y%m%d_%H%M%S"*)
>>>
>>> # Backup database (assuming the database is at /var/lib/weewx/weewx.sdb;
>>> adjust if different)
>>> sudo zip* -r* *"/var/lib/weewx/weewxdb_$DATE.zip"*
>>> /var/lib/weewx/weewx.sdb
>>>
>>> # Introduce a short delay as a buffer (for example, 10 seconds). Adjust
>>> as needed.
>>> sleep 10
>>>
>>> # Start weewx again
>>> sudo systemctl start weewx
>>>
>>> is this wrong or can It be improved?
>>>
>>
>> --
>> 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+...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/weewx-user/1b6472b5-c52e-426b-abf1-1829719469c3n%40googlegroups.com
>> 
>> .
>>
>>
>> --
> You received this 

Re: [weewx-user] Cascading errors for the Seasons base skin.

2023-10-30 Thread Sylvain M
Hello Gary.

Thank you very much for your work !
I updated the weeimport.py file at 6:50 p.m.

I created a small bash script to download my WU data every hour (I didn't 
dare to be more greedy). The script is triggered by the crontab.
My script retrieves the last timestamp from the mysql database and uses it 
as dateFrom=%Y-%m-%dT%H:%M. The recovery date is dateTo=%Y-%m-%dT%H:%M. In 
principle everything works well.

If I understood correctly, the calculation error that you detected can 
explain my mysql errors of this type 1062, "Duplicate entry '1698663292' 
for key 'PRIMARY" which I had constantly before.

Now I have another quirk.

#* journalctl -u cron.service -p err -b -f*























*Oct 30 17:28:01 gandalf python3[1261]: weewx[1261] ERROR weewx.manager: 
Unable to add record 2022-07-12 03:55:00 CEST (1657590900) to database 
'weewx': (1062, " Duplicate entry '1657590900' for key 'PRIMARY'")Oct 30 
17:33:02 gandalf python3[1261]: weewx[1261] ERROR weewx.manager: Unable to 
add record 2022-07-12 04:00:00 CEST (1657591200) to database 'weewx': 
(1062, " Duplicate entry '1657591200' for key 'PRIMARY'")Oct 30 17:38:03 
gandalf python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add 
record 2022-07-12 04:05:00 CEST (1657591500) to database 'weewx': (1062, " 
Duplicate entry '1657591500' for key 'PRIMARY'")Oct 30 17:43:04 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 04:10:00 CEST (1657591800) to database 'weewx': (1062, " 
Duplicate entry '1657591800' for key 'PRIMARY'")Oct 30 17:48:04 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 04:15:00 CEST (1657592100) to database 'weewx': (1062, " 
Duplicate entry '1657592100' for key 'PRIMARY'")Oct 30 17:53:04 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 04:20:00 CEST (1657592400) to database 'weewx': (1062, " 
Duplicate entry '1657592400' for key 'PRIMARY'")Oct 30 17:58:05 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 04:25:00 CEST (1657592700) to database 'weewx': (1062, " 
Duplicate entry '1657592700' for key 'PRIMARY'")Oct 30 18:03:05 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 04:30:00 CEST (1657593000) to database 'weewx': (1062, " 
Duplicate entry '1657593000' for key 'PRIMARY'")Oct 30 18:08:05 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 04:35:00 CEST (1657593300) to database 'weewx': (1062, " 
Duplicate entry '1657593300' for key 'PRIMARY'")Oct 30 18:13:05 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 04:40:00 CEST (1657593600) to database 'weewx': (1062, " 
Duplicate entry '1657593600' for key 'PRIMARY'")Oct 30 18:18:07 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 04:45:00 CEST (1657593900) to database 'weewx': (1062, " 
Duplicate entry '1657593900' for key 'PRIMARY'")Oct 30 18:23:07 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 04:50:00 CEST (1657594200) to database 'weewx': (1062, " 
Duplicate entry '1657594200' for key 'PRIMARY'")Oct 30 18:28:07 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 04:55:00 CEST (1657594500) to database 'weewx': (1062, " 
Duplicate entry '1657594500' for key 'PRIMARY'")Oct 30 18:33:07 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 05:00:00 CEST (1657594800) to database 'weewx': (1062, " 
Duplicate entry '1657594800' for key 'PRIMARY'")Oct 30 18:38:08 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 05:05:00 CEST (1657595100) to database 'weewx': (1062, " 
Duplicate entry '1657595100' for key 'PRIMARY'")Oct 30 18:43:08 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 05:10:00 CEST (1657595400) to database 'weewx': (1062, " 
Duplicate entry '1657595400' for key 'PRIMARY'")Oct 30 18:48:08 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 05:15:00 CEST (1657595700) to database 'weewx': (1062, " 
Duplicate entry '1657595700' for key 'PRIMARY'")Oct 30 18:53:08 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 05:20:00 CEST (1657596000) to database 'weewx': (1062, " 
Duplicate entry '1657596000' for key 'PRIMARY'")Oct 30 18:58:09 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 05:25:00 CEST (1657596300) to database 'weewx': (1062, " 
Duplicate entry '1657596300' for key 'PRIMARY'")Oct 30 19:03:09 gandalf 
python3[1261]: weewx[1261] ERROR weewx.manager: Unable to add record 
2022-07-12 05:30:00 CEST (1657596600) to database 'weewx': (1062, " 
Duplicate entry '1657596600' for key 'PRIMARY'")Oct 30 19:08:09 gandalf 
python3[1261]: 

[weewx-user] Re: Importing Historical Data from Weatherlink.com

2023-10-30 Thread The Reckoning
I exported my database (with all imports complete) to a CSV via sqlite3. 

All the data is there but the Daily/Monthly/Yearly summaries wont generate 
for certain days. I don't see anything different about the data for these 
days/months. See for yourself. CSV Linked below. The file is called 
weewx_db_export.csv.

Link 


-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/f5be1259-a2bd-43ea-ae01-8baa44e76236n%40googlegroups.com.


Re: [weewx-user] Back up of weexwx.sdb...

2023-10-30 Thread Ton Karsten
A question,
Has the script been tested yet?
Can you also make it a downloadable file?
can you make it possible to save the copy of the db on google drive?

Op zondag 29 oktober 2023 om 22:53:43 UTC+1 schreef Lorin Tremblay:

> Thanks for the info…
>
> Here is my update bash script that run with a cron job.
>
> Any comment is more than appreciated I’m stating to code here and there, 
> so I appreciate any input…
>
> And yes in the future I’ll do more research before posting anything!!
>  
>
> #!/bin/bash
>
>
> # Set the script name prefix as a variable
>
> sc_name=*"BackupDB_Weewx"*
>
>
> # Check if sqlite3 is installed
>
>
> if ! command* -v* sqlite3 &>/dev/null; then
>
> logger* -t* *"$sc_name"* *"Error: sqlite3 is not installed on this 
> system."*
>
> exit 1
>
> fi
>
>
> logger* -t* *"$sc_name"* *"Starting backup of the Weewx Database."*
>
>
> *make_backup_copy*() {
>
> db=*"/var/lib/weewx/weewx.sdb"*  # Specify the WeeWX database path
>
> backup_dir=*"/var/lib/weewx/"*  # Specify the directory where backups 
> will be stored
>
> timestamp=*"$(date +"*%Y%m%d_%H%M%S*")"*  # Generate a timestamp
>
>
> # Create the full path for the temporary copy with the timestamp
>
> tmp_db_copy=*"$backup_dir/weewxdb_${timestamp}.sdb"*
>
>
> check_sum=*"`/usr/bin/cksum "**$db**" | cut -d ' ' -f 1`"*
>
> *cp* *"$db"* *"$tmp_db_copy"*
>
> check_sum_after=*"`/usr/bin/cksum "**$tmp_db_copy**" | cut -d ' ' -f 
> 1`"*  # Calculate checksum for the copied file
>
> if [ *"$check_sum"* != *"$check_sum_after"* ]; then
>
> logger* -t* *"$sc_name"* *"$db changed during copy process!"*
>
> return 1
>
> fi
>
>
> integrity_check=*"`echo "*pragma integrity_check;*" | sqlite3 "*
> *$tmp_db_copy**"`"*
>
> if [ *"$integrity_check"* != *"ok"* ]; then
>
> logger* -t* *"$sc_name"* *"$tmp_db_copy failed integrity check!"*
>
> return 2
>
> fi
>
> logger* -t* *"$sc_name"* *"$tmp_db_copy integrity check passed!"*
>
> return 0
>
> }
>
>
> while true; do
>
> make_backup_copy
>
> retval=*"$?"*
>
>
> if [ *"$retval"* -eq 0 ]; then
>
> logger* -t* *"$sc_name"* *"Backup successful."*
>
> sudo zip* -r* *"$tmp_db_copy.zip"* *"$tmp_db_copy"*
>
> logger* -t* *"$sc_name"* *"Zipping succesful :)"*
>
> sleep 1
>
> sudo *rm** -r* *"$tmp_db_copy"*
>
> logger* -t* *"$sc_name"* *"Removal of un zipped copy done"*
>
> break  # Exit the loop if the backup is successful
>
> else
>
> logger* -t* *"$sc_name"* *"Backup failed. Retryingin 10 
> seconds..."*
>
> sleep 10
>
> fi
>
> done
>
>
>
> On 29 Oct 23, at 16:29, vince  wrote:
>
> This has been asked and answered literally dozens of times here over the 
> years. Please do a little searching of the old posts for so many threads 
> and methods that it's impossible to reiterate here.  There are also long 
> discussions of how to validate your backup is good for using to restore 
> your system in the future.
>
> Short answer is 'copy' to a temporary file.  Compress the temporary file. 
>  No need to stop/restart weewx if you use sqlite3 typically.
>  
> On Sunday, October 29, 2023 at 12:59:16 PM UTC-7 Lorin Tremblay wrote:
>
>> Hi!
>>
>> Was wondering If this bash script is an acceptable method to back up the 
>> weewx database on the daily..
>>
>> Here is my bash script to do so and I have a cron job that triggers It at 
>> 00:01 everyday...
>>
>> # Stop weewx
>> sudo systemctl stop weewx
>>
>> # Define the date format for backup filename
>> DATE=$(date +*"%Y%m%d_%H%M%S"*)
>>
>> # Backup database (assuming the database is at /var/lib/weewx/weewx.sdb; 
>> adjust if different)
>> sudo zip* -r* *"/var/lib/weewx/weewxdb_$DATE.zip"* 
>> /var/lib/weewx/weewx.sdb
>>
>> # Introduce a short delay as a buffer (for example, 10 seconds). Adjust 
>> as needed.
>> sleep 10
>>
>> # Start weewx again
>> sudo systemctl start weewx
>>
>> is this wrong or can It be improved?
>>
>
> -- 
> 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+...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/weewx-user/1b6472b5-c52e-426b-abf1-1829719469c3n%40googlegroups.com
>  
> 
> .
>
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/0521ea33-a5f6-490d-b8c3-5ca13a2e91aen%40googlegroups.com.


[weewx-user] Re: Access WEEWX_ROOT in weewx.conf

2023-10-30 Thread michael.k...@gmx.at
Thanks, but relative to which location? The current dir weewxd was startet 
from?

bell...@gmail.com schrieb am Montag, 30. Oktober 2023 um 00:41:27 UTC+1:

> A bit of background information is here, 
> https://groups.google.com/g/weewx-development/c/SGSkmxi5L6Y/m/8k9Jk_aSAwAJ
> I ended up using a relative path like, filename = log/weewxd.log.
> rich
>
> On Sunday, 29 October 2023 at 13:31:18 UTC-4 michael.k...@gmx.at wrote:
>
>> Let's assume this is from my weewx.conf (it is not working this way):
>>
>> WEEWX_ROOT = /home/pi/weewx-data
>> [Logging]
>> ...
>> [[handlers]]
>> ... 
>> [[[rotate]]]
>> filename =  WEEWX_ROOT/log/weewxd.log
>>
>> Can I access the above defined WEEWX_ROOT in a section below? If yes, 
>> how, and is this a weewx or a configobj feature?
>>
>>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/5fcfe20c-c5c4-43d5-a1d8-83ec74c44716n%40googlegroups.com.


[weewx-user] Re: Importing Historical Data from Weatherlink.com

2023-10-30 Thread The Reckoning
Okay so i have made some progress but will need the communities help on 
this. I have tried to include as much information as possible but please 
let me know if you need anything else. Also find the link to a folder 
containing relevant files below.

I downloaded my data from WeatherLink.com 1 year at a time in CSV format. I 
have data from 7/28/2019 through 10/25/2023. 

I then modified the CSV to fit the formatting requested by Weewx. This 
included changing the inter-cardinal wind directions to degree (done with 
excel formula), deleting some header rows, and changing the names of the 
column headers. I copied these column headers into my import config file 
and changed other settings in there. 

I stopped Weewx and ran a dry-run. There were no errors on the --dry-run so 
ran it for real for the first year of data (July-2019-June-2020). This 
worked fine. I could see all the new data on the webpage. 

Great. Now onto the next year: (July-2020-June-2021). Same process as above 
but the data never showed up on the webpage. I tried it again but same 
result. 

After this happened, I loaded a backup of the weewx database and combined 
all data into 1 file and imported that. 

Again, are huge holes in the data. I now have data from July-2019 to 
June-2020. No data from July-2020 to December-2022. Then I have normal data 
in all of 2023 (January-present). 

I cant figure out whats wrong. I looked the data over again but can find no 
differences between years. While the import was happening I saw lots of 
these logs saying, (as an example):
Oct 30 09:43:37 jm-Virtual-Machine wee_import[195988] INFO weewx.manager: 
Added record 2022-04-27 19:00:00 EDT (1651100400) to database 'weewx.sdb'

But I also saw lots of these logs: 

Oct 30 10:53:18 jm-Virtual-Machine wee_import[199232] ERROR *weewx*.manager: 
Unable to add record 2022-01-31 05:00:00 EST (1643623200) to database '
*weewx*.sdb': UNIQUE constraint failed: archive.dateTime

Oct 30 10:53:18 jm-Virtual-Machine wee_import[199232] ERROR *weewx*.manager: 
Unable to add record 2022-01-31 05:30:00 EST (1643625000) to database '
*weewx*.sdb': UNIQUE constraint failed: archive.dateTime

Oct 30 10:53:18 jm-Virtual-Machine wee_import[199232] ERROR *weewx*.manager: 
Unable to add record 2022-01-31 06:00:00 EST (1643626800) to database '
*weewx*.sdb': UNIQUE constraint failed: archive.dateTime

Oct 30 10:53:18 jm-Virtual-Machine wee_import[199232] ERROR *weewx*.manager: 
Unable to add record 2022-01-31 06:30:00 EST (1643628600) to database '
*weewx*.sdb': UNIQUE constraint failed: archive.dateTime

Oct 30 10:53:18 jm-Virtual-Machine wee_import[199232] ERROR *weewx*.manager: 
Unable to add record 2022-01-31 07:00:00 EST (1643630400) to database '
*weewx*.sdb': UNIQUE constraint failed: archive.dateTime

Oct 30 10:53:18 jm-Virtual-Machine wee_import[199232] ERROR *weewx*.manager: 
Unable to add record 2022-01-31 07:30:00 EST (1643632200) to database '
*weewx*.sdb': UNIQUE constraint failed: archive.dateTime

Oct 30 10:53:18 jm-Virtual-Machine wee_import[199232] ERROR *weewx*.manager: 
Unable to add record 2022-01-31 08:00:00 EST (1643634000) to database '
*weewx*.sdb': UNIQUE constraint failed: archive.dateTime

Oct 30 10:53:18 jm-Virtual-Machine wee_import[199232] ERROR *weewx*.manager: 
Unable to add record 2022-01-31 08:30:00 EST (1643635800) to database '
*weewx*.sdb': UNIQUE constraint failed: archive.dateTime

Oct 30 10:53:18 jm-Virtual-Machine wee_import[199232] ERROR *weewx*.manager: 
Unable to add record 2022-01-31 09:00:00 EST (1643637600) to database '
*weewx*.sdb': UNIQUE constraint failed: archive.dateTime
Not sure what these mean but there were a LOT of them. Maybe these are the 
cause of my issues. Below is a link to:

   1. csv.conf
   2. PWS_All2.csv - all of my historical weather data
   3. Weewx_log_Import_All.txt - Log of the full import showing the above 
   mentioned errors and successes
   4. wee_debug --info output
   
Link to Files 


Any help I can get in resolving this is much appreciated. 

Here is the command output from the combined import 
jm@jm-Virtual-Machine:/var/lib/weewx$ sudo wee_import --import-config=/etc/
weewx/import/csv.conf
/usr/share/weewx/wee_import:719: DeprecationWarning: The distutils package 
is deprecated and slated for removal in Python 3.12. Use setuptools or 
check PEP 632 for potential alternatives
from distutils.version import StrictVersion
Using WeeWX configuration file /etc/weewx/weewx.conf
Starting wee_import...
A CSV import from source file '/home/jm/Desktop/PWS_All2.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.
All WeeWX UV fields will be set to None.
All WeeWX radiation fields will be set to None.
Starting 

Re: [weewx-user] Pillow and textsize/textwidth

2023-10-30 Thread Greg Troxel
Tom Keffer  writes:

> One of the reasons why I have come to prefer using pip and virtual
> environments over the package installers. It's super easy to maintain
> "known-good" versions of the Python run environment.

Yes, but this leads to having multiple copies of everything and no way
to audit that any of them are out of date.  And when they are, you can't
update them without breaking the property you want, that they are the
known-working ones.  Once a library is no longer maintained, there's no
reason to expect any vulnerabilities to be noticed or reported, so I
consider no-longer-maintained versions as basically unsafe (in a mild
perhaps kind of way, but still).

The real issue is that projects maintaining libraries break backwards
compatibility, and on the other hand LTS distributions have egregiously
old code.  Thus projects like weewx have to support the current as well
as very old releases, or users have trouble.  If that ends up being too
hard, I lean to supporting the current release and as far back as isn't
painful, not worrying too much about LTS.  That's what I've done
maintaining unison, where we've desupported quite old ocaml versions
still in LTS distributions.

In this case, it seems the source adaptation wasn't that hard, which was
fortunate.  If this is hard for some library, that's a clue that the
library is too unstable to use, which I realize is easier said than
actually switching away from.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/rmi7cn4maul.fsf%40s1.lexort.com.


Re: [weewx-user] Pillow and textsize/textwidth

2023-10-30 Thread Tom Keffer
One of the reasons why I have come to prefer using pip and virtual
environments over the package installers. It's super easy to maintain
"known-good" versions of the Python run environment.

On Mon, Oct 30, 2023 at 7:21 AM Greg Troxel  wrote:

> Tom Keffer  writes:
>
> > I've done exactly this. The fix is in the master branch.
>
> Great, thanks.  I've rebased and git has nicely decided that my
> cherry-pick and yours don't actually conflict and just taken yours.
>
> > I'm curious why you can't rollback your version of Pillow.
>
> I'm not the one asking, but generally it makes sense to follow along
> with one's packaging system, and for every program that thinks that
> version is too new, there is another that thinks the previous is too
> old.  And while I'm not explicitly aware of CVEs for Pillow, in general
> the only reasonable approach is to run maintained versions of
> everything, and most upstreams do not maintain anything except the most
> recent release.  So while somebody could go back to old Pillow, I feel
> that this isn't a good strategy, and intentionally being on an old
> version is a situation that needs a get-well plan.
>
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEBJ7f5cWcNQXnrRtxqU6XEFSyzWSaPqkpvSHEqqxBfzxA%40mail.gmail.com.


Re: [weewx-user] Pillow and textsize/textwidth

2023-10-30 Thread Greg Troxel
Tom Keffer  writes:

> I've done exactly this. The fix is in the master branch.

Great, thanks.  I've rebased and git has nicely decided that my
cherry-pick and yours don't actually conflict and just taken yours.

> I'm curious why you can't rollback your version of Pillow.

I'm not the one asking, but generally it makes sense to follow along
with one's packaging system, and for every program that thinks that
version is too new, there is another that thinks the previous is too
old.  And while I'm not explicitly aware of CVEs for Pillow, in general
the only reasonable approach is to run maintained versions of
everything, and most upstreams do not maintain anything except the most
recent release.  So while somebody could go back to old Pillow, I feel
that this isn't a good strategy, and intentionally being on an old
version is a situation that needs a get-well plan.


-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/rmio7ggmbs4.fsf%40s1.lexort.com.


Re: [weewx-user] Pillow and textsize/textwidth

2023-10-30 Thread Tom Keffer
I've done exactly this. The fix is in the master branch.

Cat22: replace your version of genplot.py with this one

.

I'm curious why you can't rollback your version of Pillow.

On Mon, Oct 30, 2023 at 5:28 AM Greg Troxel  wrote:

> [top posting repaired]
>
> Cat22  writes:
>
> > On Tuesday, October 24, 2023 at 9:43:55 AM UTC-7 Greg Troxel wrote:
> >
> >> Tom Keffer  writes:
> >>
> >> > This was fixed in commit dc4ab54
> >> > <
> >>
> https://github.com/weewx/weewx/commit/dc4ab54b9a5935e7334dc0e9de97e5854204d6e7
> >> >,
> >> > to appear in V5.
> >>
> >> I did a cherry-pick of this onto master, which succeeded with no
> >> conflicts. Rerunning setup.py build/install, and then reinstalling
> >> Pillow 10.0.1 (updating it from 9.x), I am able to run wee_reports with
> >> no issues.
> >>
> >> I rebooted and waited for a new archive interval, and I am getting new
> >> graphs reliably, as far as I can tell.
> >>
> >> So cherry-pick/push on master should be safe.
>
> > How do i get this fix? and how do i install it so it only upgrades my
> weewx
> > without loss of configuration data?
> > I don't have the option to roll back pillow and I am currently on pillow
> > 10.0.1-1
> >
>
> Ideally, someone who can write the repo would cherry-pick and push to
> the stable branch, and then you'd just check that out and build.
> Until then, you'll need to clone the repo, and
> ```
> git cherry-pick dc4ab54b9a5935e7334dc0e9de97e5854204d6e7
> ```
> and then build.
>
> If this sounds mysterious, read this book carefully, and then it will
> make sense:
>
>   https://git-scm.com/book/en/v2
>
>
>
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/rmibkcgnvkk.fsf%40s1.lexort.com
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zECdvR3v%2B7VJ-wT-qMAVaHSSC4zBpdm2odT%2BhJQtRYHp_g%40mail.gmail.com.


Re: [weewx-user] Rsyc Error

2023-10-30 Thread Tom -KQ5S
Thanks to Vince and Chris for the help.  At this point I am giving up. 
 I'll try a fresh install and see what happens. 

Tom.  

On Sunday, October 29, 2023 at 9:20:23 PM UTC-5 vince wrote:

> Tom - I'm at a loss at this point as to why you're not working (or 
> failing) consistently.
>
> I did a setup of rsync over ssh on a clean pi and here are the steps.
> Worked first time for me :-)
>
> (this example uses weewx v5.0b15 as user 'pi')
>
> # reimaged a raspberry pi
> # installed rsyslog to get traditional syslogging rather than systemd
> sudo apt-get install -y rsyslog
>
> # logged into the pi as unprivileged user pi (for this example)
>
> # installed weewx with the simulator driver
>
> # created a new ssh keypair for the user pi
> # taking the defaults to make a passwordless keypair
> # which will be ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub
> ssh-keygen
>
> # added this key to the appropriate user@host for my server host
> ssh-copy-id vince@nuc2
>
> # verified I could log into the remote server
> ssh vince@nuc2
> # at this point ssh is known to work using the new ssh key
>
> # edited weewx.conf to set debug=1 for more verbose logging
>
> # edited weewx.conf to configure the RSYNC uploader
> # so this will upload the default public_html to the specified path
>
>[[RSYNC]]
> skin = Rsync
> enable = true
> server = nuc2
> user = vince
> path = /home/vince/weehtml
> log_success = true
> log_failure = true
> delete = 0
>
> # restarted weewx, waited 5 minutes, I see the successful rsync of the 
> Seasons skin in syslog
>
> 2023-10-29T19:00:20.236994-07:00 raspberrypi weewx[2416] DEBUG 
> weeutil.rsyncupload: rsyncupload: cmd: [['rsync', '--archive', '--stats', 
> '-e', 'ssh', '/home/pi/weewx-data/public_html/', 
> 'vince@nuc2:/home/vince/weehtml']]
>
> 2023-10-29T19:00:20.680310-07:00 raspberrypi weewx[2416] INFO 
> weeutil.rsyncupload: rsync'd 73 files (526,454 bytes) in 0.44 seconds
>
> # Notes:
> #  - no /home/pi/.ssh/config file was needed on a pi as long as the 
> specified 'server' resolves
> #   because ssh on the pi defaults to using ~/.ssh/id_rsa as the 
> private key
> #  - weewx assumes the local user is the one it is running as
> #  - weewx uses the RSYNC 'user' as the remote user it connects to
>
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/35a7269d-d653-4c7f-b24a-69d427de27c1n%40googlegroups.com.


[weewx-user] Re: wunderground import error

2023-10-30 Thread gjr80
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:

$ wget -P 
/usr/share/weewx/weeimport 
https://raw.githubusercontent.com/weewx/weewx/V5/src/weeimport/wuimport.py
$ wget 
-P/usr/share/weewx/weeimport 
https://raw.githubusercontent.com/weewx/weewx/V5/src/weeimport/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
On Monday, 30 October 2023 at 17:59:08 UTC+10 geop...@gmail.com wrote:

> 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 
> 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
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/abc0cd51-4530-448c-a270-7b0e6a2e3134n%40googlegroups.com.


Re: [weewx-user] Cascading errors for the Seasons base skin.

2023-10-30 Thread gjr80
I have been able to reproduce your symptoms and I now believe I understand 
what is happening.

In terms of why wee_import wants to import from 27 and 28 October Vince has 
covered the main point. So as far as WeeWX is concerned (and assuming a 
five minute archive period) the first archive record of the 27 October 
covers the five minute period from midnight at the start of 27 October 
until 00:05, so the first archive period of the day is timestamped at five 
minutes after midnight. The last archive period covers the five minute 
period from 23:55 until (and including) midnight at the end of 27 October, 
so the last archive period of 27 October is timestamped at midnight on 28 
October. 

The other factor at play is how WU provides data via its API. The WU API 
call used by wee_import provides one full day of data at a time, the 
problem being that WU defines a day as starting at midnight at the start of 
the day though until (but not including) midnight at the end of the day. So 
when the WU API responds with data for 27 October the first record provided 
is the archive record timestamped at midnight at the start of 27 October, 
this archive record actually contains data from 26 October so it is 
discarded. The last record provided by WU is timestamped at 23:55 27 
October, which is only the second last archive record for the day. WU does 
not provide the last archive record of the day, to get that archive record 
we need to ask WU for the data for 28 October. The first record from the WU 
28 October data is used and the rest are discarded.

That is why when you attempt to import a given day of data from WU you will 
actually see wee_import obtain two days data from WU.

Now for your error message. To cut a long story short there was a flaw in 
how wee_import calculated the total elapsed time for an import. I believe I 
have fixed it. You can use the new code by downloading the updated 
weeimport.py and replacing weeimport.py on your system with the downloaded 
version. In an earlier post I gave you instructions for replacing 
wuimport.py, this time you need to replace weeimport.py, it is in the same 
directory as wuimport.py and the process is the same just a different file. 
You can download the updated weeimport.py via the following command:

$ wget -P /var/tmp 
https://raw.githubusercontent.com/weewx/weewx/V5/src/weeimport/weeimport.py

Do not get weeimport.py confused with wee_import.py, they are in different 
directories but if you replace the wrong file you will break wee_import.

Once you have replaced weeimport.py wee_import should work without error.

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/6ba2a0b7-1b18-4794-bc64-5c4d54e89023n%40googlegroups.com.


Re: [weewx-user] Pillow and textsize/textwidth

2023-10-30 Thread Greg Troxel
[top posting repaired]

Cat22  writes:

> On Tuesday, October 24, 2023 at 9:43:55 AM UTC-7 Greg Troxel wrote:
>
>> Tom Keffer  writes:
>>
>> > This was fixed in commit dc4ab54
>> > <
>> https://github.com/weewx/weewx/commit/dc4ab54b9a5935e7334dc0e9de97e5854204d6e7
>> >,
>> > to appear in V5.
>>
>> I did a cherry-pick of this onto master, which succeeded with no
>> conflicts. Rerunning setup.py build/install, and then reinstalling
>> Pillow 10.0.1 (updating it from 9.x), I am able to run wee_reports with
>> no issues.
>>
>> I rebooted and waited for a new archive interval, and I am getting new
>> graphs reliably, as far as I can tell.
>>
>> So cherry-pick/push on master should be safe.

> How do i get this fix? and how do i install it so it only upgrades my weewx 
> without loss of configuration data?
> I don't have the option to roll back pillow and I am currently on pillow 
> 10.0.1-1
>

Ideally, someone who can write the repo would cherry-pick and push to
the stable branch, and then you'd just check that out and build.
Until then, you'll need to clone the repo, and
```
git cherry-pick dc4ab54b9a5935e7334dc0e9de97e5854204d6e7
```
and then build.

If this sounds mysterious, read this book carefully, and then it will
make sense:

  https://git-scm.com/book/en/v2




-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/rmibkcgnvkk.fsf%40s1.lexort.com.


Re: [weewx-user] Pillow and textsize/textwidth

2023-10-30 Thread Cat22
How do i get this fix? and how do i install it so it only upgrades my weewx 
without loss of configuration data?
I don't have the option to roll back pillow and I am currently on pillow 
10.0.1-1

On Tuesday, October 24, 2023 at 9:43:55 AM UTC-7 Greg Troxel wrote:

> Tom Keffer  writes:
>
> > This was fixed in commit dc4ab54
> > <
> https://github.com/weewx/weewx/commit/dc4ab54b9a5935e7334dc0e9de97e5854204d6e7
> >,
> > to appear in V5.
>
> I did a cherry-pick of this onto master, which succeeded with no
> conflicts. Rerunning setup.py build/install, and then reinstalling
> Pillow 10.0.1 (updating it from 9.x), I am able to run wee_reports with
> no issues.
>
> I rebooted and waited for a new archive interval, and I am getting new
> graphs reliably, as far as I can tell.
>
> So cherry-pick/push on master should be safe.
>
> Thanks,
> Greg
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/ab523fea-98f7-4d75-a2fc-de6ec225f24cn%40googlegroups.com.


[weewx-user] Re: Rain Underreading: Discrepancies even when importing from csv

2023-10-30 Thread Marlon
Oct 30 13:08:42 goatbox weewx[116207] DEBUG weewx.reportengine: Report 
'FTP' not enabled. Skipping.
Oct 30 13:08:42 goatbox weewx[116207] DEBUG weewx.reportengine: Report 
'RSYNC' not enabled. Skipping.
Oct 30 13:08:49 goatbox weewx[116207] DEBUG user.interceptor: empty queue
Oct 30 13:08:59 goatbox weewx[116207] DEBUG user.interceptor: empty queue
Oct 30 13:09:01 goatbox weewx[116207] DEBUG user.interceptor: POST: 
b'PASSKEY==EasyWeatherV1.6.6=2023-10-30+11:08:59=76.6=46=29.661=29.723=71.6=44=72=3.1=4.5=15.9=0.000=0.000=0.000=0.000=0.008=1.118=32.445=32.445=831.15=8=0=868M=WS2900_V2.01.08'
Oct 30 13:09:01 goatbox weewx[116207] DEBUG user.interceptor: raw data: 
b'PASSKEY=660D031A3A77C1332DFA76B2C975573C=EasyWeatherV1.6.6=2023-10-30+11:08:59=76.6=46=29.661=29.723=71.6=44=72=3.1=4.5=15.9=0.000=0.000=0.000=0.000=0.008=1.118=32.445=32.445=831.15=8=0=868M=WS2900_V2.01.08'
Oct 30 13:09:01 goatbox weewx[116207] DEBUG user.interceptor: using 
rain_total 32.445 from yearlyrainin
Oct 30 13:09:01 goatbox weewx[116207] INFO user.interceptor: unrecognized 
parameter b'PASSKEY=660D031A3A77C1332DFA76B2C975573C
Oct 30 13:09:01 goatbox weewx[116207] INFO user.interceptor: unrecognized 
parameter stationtype=EasyWeatherV1.6.6
Oct 30 13:09:01 goatbox weewx[116207] INFO user.interceptor: unrecognized 
parameter baromrelin=29.661
Oct 30 13:09:01 goatbox weewx[116207] INFO user.interceptor: unrecognized 
parameter maxdailygust=15.9
Oct 30 13:09:01 goatbox weewx[116207] INFO user.interceptor: unrecognized 
parameter rainratein=0.000
Oct 30 13:09:01 goatbox weewx[116207] INFO user.interceptor: unrecognized 
parameter eventrainin=0.000
Oct 30 13:09:01 goatbox weewx[116207] INFO user.interceptor: unrecognized 
parameter hourlyrainin=0.000
Oct 30 13:09:01 goatbox weewx[116207] DEBUG user.interceptor: ignored 
parameter weeklyrainin=0.008
Oct 30 13:09:01 goatbox weewx[116207] DEBUG user.interceptor: ignored 
parameter monthlyrainin=1.118
Oct 30 13:09:01 goatbox weewx[116207] INFO user.interceptor: unrecognized 
parameter totalrainin=32.445
Oct 30 13:09:01 goatbox weewx[116207] INFO user.interceptor: unrecognized 
parameter wh65batt=0
Oct 30 13:09:01 goatbox weewx[116207] INFO user.interceptor: unrecognized 
parameter freq=868M
Oct 30 13:09:01 goatbox weewx[116207] INFO user.interceptor: unrecognized 
parameter model=WS2900_V2.01.08'
Oct 30 13:09:01 goatbox weewx[116207] DEBUG user.interceptor: raw packet: 
{'dateTime': 1698664139, 'usUnits': 1, 'rain_total': 32.445, 
'temperature_in': 76.6, 'humidity_in': 46.0, 'pressure': 29.723, 
'temperature_out': 71.6, 'humidity_out': 44.0, 'wind_dir': 72.0, 
'wind_speed': 3.1, 'wind_gust': 4.5, 'solar_radiation': 831.15, 'uv': 8.0, 
'rain': 0.0}
Oct 30 13:09:01 goatbox weewx[116207] DEBUG user.interceptor: mapped 
packet: {'dateTime': 1698664139, 'usUnits': 1, 'pressure': 29.723, 
'outHumidity': 44.0, 'inHumidity': 46.0, 'outTemp': 71.6, 'inTemp': 76.6, 
'windSpeed': 3.1, 'windGust': 4.5, 'windDir': 72.0, 'radiation': 831.15, 
'rain': 0.0, 'UV': 8.0}
Oct 30 13:09:01 goatbox weewx[116207] INFO weewx.manager: Added record 
2023-10-30 13:08:30 SAST (1698664110) to database 'weewx'
Oct 30 13:09:01 goatbox weewx[116207] INFO weewx.manager: Added record 
2023-10-30 13:08:30 SAST (1698664110) to daily summary in 'weewx'

On Monday, 30 October 2023 at 12:53:37 UTC+2 Marlon wrote:

> Hello
> I recently started using weewx to collect my own weather data (instead of 
> relying on external sites). The problem is strange. I tried for days, 
> exhaustively, to fix this - wanted to avoid another support issue here that 
> wastes your time, but alas.
>
> My station is a froggit WH3000 and has always (still does), accurately 
> posted to ecowitt, WU and WeatherCloud. 
>
> I added weewx on my vps now, and it uses interceptor to get the data using 
> my stations 'custom' posting (it has a choice of ecowitt vs wu protocol).
>
> The data on weewx is all fine, accurate, except it underreads rain by a 
> few millimeters everytime. All the data on the station console, WU and 
> ecowitt matches, but weewx underreads.
>
> For october for instance: 28.4mm is the correct value. Weewx has 23.7mm
> I can see it happen on daily rainfall as well. Yesterday we had 0.2mm 
> drizzle, but weewx still thinks we had 0.0
>
> On a sidenote, I tried to import historic data from ecowitt (csv) to 
> weewx, and I see the same thing happening.  
>
> I feel bested. It got the better of me. Advice or ideas could go a long 
> way.
> Thanks in advance
> Marlon
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/52c312f2-c53c-44f8-896d-371da431c651n%40googlegroups.com.


[weewx-user] Rain Underreading: Discrepancies even when importing from csv

2023-10-30 Thread Marlon
Hello
I recently started using weewx to collect my own weather data (instead of 
relying on external sites). The problem is strange. I tried for days, 
exhaustively, to fix this - wanted to avoid another support issue here that 
wastes your time, but alas.

My station is a froggit WH3000 and has always (still does), accurately 
posted to ecowitt, WU and WeatherCloud. 

I added weewx on my vps now, and it uses interceptor to get the data using 
my stations 'custom' posting (it has a choice of ecowitt vs wu protocol).

The data on weewx is all fine, accurate, except it underreads rain by a few 
millimeters everytime. All the data on the station console, WU and ecowitt 
matches, but weewx underreads.

For october for instance: 28.4mm is the correct value. Weewx has 23.7mm
I can see it happen on daily rainfall as well. Yesterday we had 0.2mm 
drizzle, but weewx still thinks we had 0.0

On a sidenote, I tried to import historic data from ecowitt (csv) to weewx, 
and I see the same thing happening.  

I feel bested. It got the better of me. Advice or ideas could go a long way.
Thanks in advance
Marlon

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/8cac8a8a-3bcf-42fb-bf18-5fc0e7b22dbdn%40googlegroups.com.


[weewx-user] wunderground import error

2023-10-30 Thread george kyr
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 
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

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/e0272f44-aeae-433f-a5e4-2c03622195f8n%40googlegroups.com.