Re: [weewx-user] weewx 5.0 upgrade trouble

2023-11-21 Thread Frank Frommelt

Hmm, after downgrading back to 4.10.2 everything is running smooth as before.
I guess the virtual env. for 5.0 is running a different python version as 
4.10.2



--- Original Nachricht ---
Von: Tom Keffer tkef...@gmail.com
Datum: 21. November 2023 22:19:57
An: Frank Frommelt f.fromm...@gmail.com
CC: weewx-user@googlegroups.com
Betreff: Re: [weewx-user] weewx 5.0 upgrade trouble


v4.10.2 will have the same problem. It's Python 3.12 that's causing the 
problem.


On Tue, Nov 21, 2023 at 1:16 PM Frank Frommelt  wrote:
Hi Tom,
thanks for that tip.
I managed to downgrade to 4.10.2 in the meantime to re-gain my weather station.
I will try your workaround next weekend.
Take care
Frank

--- Original Nachricht ---
Von: Tom Keffer tkef...@gmail.com
Datum: 21. November 2023 14:51:33
An: weewx-user@googlegroups.com
Betreff: Re: [weewx-user] weewx 5.0 upgrade trouble


This is a problem with the Fine Offset driver that we're aware of. It's 
caused by the deprecation of the function datetime.utcnow() in Python 3.12.


The fix for now is to downgrade to Python 3.11.

-tk


On Tue, Nov 21, 2023 at 3:26 AM Frank Frommelt  wrote:
Hi there,

OK, I have taken the risk in updatting weewx from 4.10.2 to the latest 5.0 
(beta) version.


I followed the update guide and everything looked fine.

When finally starting the service I am getting the following error:

Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   TypeError: 
can't subtract offset-naive and offset-aware datetimes


So, it looks like some data is time-zone aware and some is not.

Basically I found something to cure the problem, but as I have no idea on 
programming, I need some help...


https://toptechtips.github.io/2023-04-03-python-offset-aware-offset-naive-timezones/


Here is the full log down to the error message...

(weewx-venv) pi@raspi:/home/weewx $ sudo systemctl start weewx
(weewx-venv) pi@raspi:/home/weewx $ tail -f /var/log/weewx.log
Nov 21 12:03:48 raspi weewx[18165] INFO user.mqtt: binding to archive
Nov 21 12:03:48 raspi weewx[18165] INFO user.mqtt: topic is weather
Nov 21 12:03:48 raspi weewx[18165] INFO user.mqtt: desired unit system is 
METRIC
Nov 21 12:03:48 raspi weewx[18165] INFO user.mqtt: data will be uploaded to 
mqtt://weewx:xxx@192.168.1.140:1883
Nov 21 12:03:48 raspi weewx[18165] INFO weewx.engine: 'pyephem' detected, 
extended almanac data is available
Nov 21 12:03:48 raspi weewx[18165] INFO __main__: Starting up weewx version 
5.0.0b15
Nov 21 12:03:48 raspi weewx[18165] INFO weewx.engine: Using binding 
'wx_binding' to database 'weewx.sdb'
Nov 21 12:03:48 raspi weewx[18165] INFO weewx.manager: Starting backfill of 
daily summaries
Nov 21 12:03:48 raspi weewx[18165] INFO weewx.manager: Daily summaries up 
to date
Nov 21 12:03:49 raspi weewx[18165] INFO weewx.drivers.fousb: synchronising 
to the weather station (quality=0)
Nov 21 12:03:52 raspi weewx[18165] INFO weewx.engine: Main loop exiting. 
Shutting engine down.
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: Caught unrecoverable 
exception:
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   can't 
subtract offset-naive and offset-aware datetimes
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   Traceback 
(most recent call last):
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File 
"/home/pi/weewx-venv/lib/python3.9/site-packages/weewxd.py", line 157, in main
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   
engine.run()
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File 
"/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/engine.py", line 
175, in run
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   
self.dispatchEvent(weewx.Event(weewx.STARTUP))
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File 
"/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/engine.py", line 
242, in dispatchEvent
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   
callback(event)
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File 
"/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/engine.py", line 
581, in startup
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   
self._catchup(self.engine.console.genStartupRecords)
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File 
"/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/engine.py", line 
694, in _catchup
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   for 
record in generator(lastgood_ts):
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File 
"/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/drivers/fousb.py", 
line 1094, in genArchiveRecords
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   records 
= self.get_records(since_ts)
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File 

[weewx-user] Smartphone skin oddities

2023-11-21 Thread Nate Bargmann
I'll admit that I rarely, if ever, check the Smartphone skin even though
I have it enabled.  Today I was checking it (I'm staring at the WeeWX
pages a lot recently because of an odd Davis ISS issue) and saw there
was no radar image.  The variables in the associated skin.conf were
commented out so I added the links for the Topeka, KS NWS radar:

[Extras]
# Set this URL to display a radar image
#radar_img = http://radar.weather.gov/ridge/lite/N0R/RTX_loop.gif
radar_img = https://radar.weather.gov/ridge/standard/KTWX_loop.gif
# Set this URL for the radar image link
#radar_url = 
http://radar.weather.gov/ridge/radar.php?product=NCR=RTX=yes
radar_url = https://radar.weather.gov/station/ktwx/standard

Even though those links work without issue in the Seasons and Standard
skins, all I get from the generated Web page is, "Sorry, no radar image."

I've attached a screenshot.

Secondly, looking at the rain page I see that it is showing, "Max rate:
655.35 in/h at 10:40:59 AM".  Wow!  That value looks rather suspicious
as being the max integer of a 16 bit variable.  I've attached a
screenshot of that as well.

Until today I never attempted any customization of the Smartphone skin
and other than adding the radar URLs, I did nothing else.  For those
curious the URL is:

https://www.n0nb.us/weather/smartphone/index.html

If these issues aren't worth resolving I'll just disable the skin.  This
is with version 4.10.2.

- Nate

-- 
"The optimist proclaims that we live in the best of all
possible worlds.  The pessimist fears this is true."
Web: https://www.n0nb.us
Projects: https://github.com/N0NB
GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819

-- 
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/20231122003535.aorrrhexhsw4crla%40n0nb.us.


signature.asc
Description: PGP signature


Re: [weewx-user] Problem registering my weather station in the WeeWX global station map

2023-11-21 Thread Tom Keffer
Unless, like Remy, you are not running weewxd, I doubt you're having the
same problem.

To avoid confusion, please start a new email thread. Set debug=1, then
restart weewxd. Post the log from startup through the first reporting
cycle. We'll see if we can figure out the problem.


On Tue, Nov 21, 2023 at 9:36 AM Δημήτρης Βήχος 
wrote:

> i have the same problem. suddenly without reason my weather station in
> kolxiko thessalonikis not appears in map. while the other weather station
> who i have in moudania halkidiki with just same settings same weather
> hardware same linux dist apeears!
>
> Στις Τρίτη 21 Νοεμβρίου 2023 στις 12:31:37 π.μ. UTC+2, ο χρήστης Tom
> Keffer έγραψε:
>
>> It's a good question. One would have to modify fileparse to either stat
>> the file to see if it's new, or look at the timestamp (field "dateTime") of
>> the resultant LOOP packet. Something fancier would use pyinotify
>>  to block until the file changes.
>>
>> On Mon, Nov 20, 2023 at 1:50 PM Remy LAVABRE  wrote:
>>
>>> Thanks for your response Tom.
>>>
>>> just a clarification on the use of fileparse:
>>>
>>> if the fileparse setting for the loop packet recovery timeout in
>>> weewx.conf is 10 seconds and the file containing the loop packet is only
>>> updated after 60 seconds (this is an example), what happens during the 50
>>> seconds where weewx will retrieve the same packet loop 5 times?
>>>
>>> Does Weewx know how to manage the recovery of a same packet loop
>>> recovered several times ?
>>>
>>> THANKS
>>>
>>> Le lun. 20 nov. 2023, 13:54, Tom Keffer  a écrit :
>>>
 The simplest would be to go back to using WeeWX, but this time using a
 driver that reads from your file.

 The WeeWX distribution includes an example, fileparse
 , that
 reads from a file using key=value pairs. Either change your file format to
 match, or modify fileparse to use a CSV input.

 On Mon, Nov 20, 2023 at 12:31 AM Remy Lavabre 
 wrote:

> Good morning,
> I previously used weeWX connected to the USB output of my weather
> station. No problem, the station was well referenced on the world map of
> WeeWX weather stations.
>
> Unfortunately my station broke down and an exchange was carried out
> under warranty with a new station without a USB port. This station sends
> data to AWEKAS.
>
> I was therefore forced to modify everything, to stop the WeeWX daemon
> permanently, to automatically retrieve the data from the AWEKAS site every
> 5 minutes, save it in CSV format and run wee_import at the same frequency
> to update my weewx.sdb database and generate all the graphics, html pages
> etc...
>
> It works perfectly EXCEPT that my weather station is no longer
> referenced on the WeeWX map! :-(
> Is there a way to reference it again although only using wee_import
> (which nevertheless uses the weewx.conf configuration file)?
>
> Thank you...
>
> --
> 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/1b7247b6-4b94-4ff4-8160-006f54faff2fn%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+...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/weewx-user/CAPq0zEDrGDyL3f3nROcRq2X0qQQZFNZ_gR6fevGGPqzjxCWPzQ%40mail.gmail.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+...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/weewx-user/CADhm9Yen3ra4wpHx3FkpPkaX4gqj3P8r5yLHNEpC40_0RfASXA%40mail.gmail.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 

Re: [weewx-user] weewx 5.0 upgrade trouble

2023-11-21 Thread Tom Keffer
v4.10.2 will have the same problem. It's Python 3.12 that's causing the
problem.

On Tue, Nov 21, 2023 at 1:16 PM Frank Frommelt  wrote:

> Hi Tom,
> thanks for that tip.
> I managed to downgrade to 4.10.2 in the meantime to re-gain my weather
> station.
> I will try your workaround next weekend.
> Take care
>Frank
>
> --- Original Nachricht ---
> *Von: * Tom Keffer tkef...@gmail.com
> *Datum: * 21. November 2023 14:51:33
> *An: * weewx-user@googlegroups.com
> *Betreff: * Re: [weewx-user] weewx 5.0 upgrade trouble
>
>> This is a problem with the Fine Offset driver that we're aware of. It's
>> caused by the deprecation of the function datetime.utcnow() in Python 3.12.
>>
>> The fix for now is to downgrade to Python 3.11.
>>
>> -tk
>>
>> On Tue, Nov 21, 2023 at 3:26 AM Frank Frommelt 
>> wrote:
>>
>>> Hi there,
>>>
>>> OK, I have taken the risk in updatting weewx from 4.10.2 to the latest
>>> 5.0 (beta) version.
>>>
>>> I followed the update guide and everything looked fine.
>>>
>>> When finally starting the service I am getting the following error:
>>>
>>> *Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: 
>>>  TypeError: can't subtract offset-naive and offset-aware datetimes*
>>>
>>> So, it looks like some data is time-zone aware and some is not.
>>>
>>> Basically I found something to cure the problem, but as I have no idea
>>> on programming, I need some help...
>>>
>>>
>>> https://toptechtips.github.io/2023-04-03-python-offset-aware-offset-naive-timezones/
>>>
>>>
>>> Here is the full log down to the error message...
>>>
>>> (weewx-venv) pi@raspi:/home/weewx $ sudo systemctl start weewx
>>> (weewx-venv) pi@raspi:/home/weewx $ tail -f /var/log/weewx.log
>>> Nov 21 12:03:48 raspi weewx[18165] INFO user.mqtt: binding to archive
>>> Nov 21 12:03:48 raspi weewx[18165] INFO user.mqtt: topic is weather
>>> Nov 21 12:03:48 raspi weewx[18165] INFO user.mqtt: desired unit system
>>> is METRIC
>>> Nov 21 12:03:48 raspi weewx[18165] INFO user.mqtt: data will be uploaded
>>> to mqtt://weewx:xxx@192.168.1.140:1883
>>> Nov 21 12:03:48 raspi weewx[18165] INFO weewx.engine: 'pyephem'
>>> detected, extended almanac data is available
>>> Nov 21 12:03:48 raspi weewx[18165] INFO __main__: Starting up weewx
>>> version 5.0.0b15
>>> Nov 21 12:03:48 raspi weewx[18165] INFO weewx.engine: Using binding
>>> 'wx_binding' to database 'weewx.sdb'
>>> Nov 21 12:03:48 raspi weewx[18165] INFO weewx.manager: Starting backfill
>>> of daily summaries
>>> Nov 21 12:03:48 raspi weewx[18165] INFO weewx.manager: Daily summaries
>>> up to date
>>> Nov 21 12:03:49 raspi weewx[18165] INFO weewx.drivers.fousb:
>>> synchronising to the weather station (quality=0)
>>> Nov 21 12:03:52 raspi weewx[18165] INFO weewx.engine: Main loop exiting.
>>> Shutting engine down.
>>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: Caught
>>> unrecoverable exception:
>>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   can't
>>> subtract offset-naive and offset-aware datetimes
>>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: 
>>>  Traceback (most recent call last):
>>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File
>>> "/home/pi/weewx-venv/lib/python3.9/site-packages/weewxd.py", line 157, in
>>> main
>>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: 
>>>  engine.run()
>>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File
>>> "/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/engine.py", line
>>> 175, in run
>>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: 
>>>  self.dispatchEvent(weewx.Event(weewx.STARTUP))
>>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File
>>> "/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/engine.py", line
>>> 242, in dispatchEvent
>>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: 
>>>  callback(event)
>>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File
>>> "/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/engine.py", line
>>> 581, in startup
>>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: 
>>>  self._catchup(self.engine.console.genStartupRecords)
>>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File
>>> "/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/engine.py", line
>>> 694, in _catchup
>>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   for
>>> record in generator(lastgood_ts):
>>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File
>>> "/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/drivers/fousb.py",
>>> line 1094, in genArchiveRecords
>>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: 
>>>  records = self.get_records(since_ts)
>>> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File
>>> "/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/drivers/fousb.py",
>>> line 1303, in get_records
>>> Nov 21 12:03:52 

Re: [weewx-user] weewx 5.0 upgrade trouble

2023-11-21 Thread Frank Frommelt

Hi Tom,
thanks for that tip.
I managed to downgrade to 4.10.2 in the meantime to re-gain my weather station.
I will try your workaround next weekend.
Take care
  Frank

--- Original Nachricht ---
Von: Tom Keffer tkef...@gmail.com
Datum: 21. November 2023 14:51:33
An: weewx-user@googlegroups.com
Betreff: Re: [weewx-user] weewx 5.0 upgrade trouble


This is a problem with the Fine Offset driver that we're aware of. It's 
caused by the deprecation of the function datetime.utcnow() in Python 3.12.


The fix for now is to downgrade to Python 3.11.

-tk


On Tue, Nov 21, 2023 at 3:26 AM Frank Frommelt  wrote:
Hi there,

OK, I have taken the risk in updatting weewx from 4.10.2 to the latest 5.0 
(beta) version.


I followed the update guide and everything looked fine.

When finally starting the service I am getting the following error:

Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   TypeError: 
can't subtract offset-naive and offset-aware datetimes


So, it looks like some data is time-zone aware and some is not.

Basically I found something to cure the problem, but as I have no idea on 
programming, I need some help...


https://toptechtips.github.io/2023-04-03-python-offset-aware-offset-naive-timezones/


Here is the full log down to the error message...

(weewx-venv) pi@raspi:/home/weewx $ sudo systemctl start weewx
(weewx-venv) pi@raspi:/home/weewx $ tail -f /var/log/weewx.log
Nov 21 12:03:48 raspi weewx[18165] INFO user.mqtt: binding to archive
Nov 21 12:03:48 raspi weewx[18165] INFO user.mqtt: topic is weather
Nov 21 12:03:48 raspi weewx[18165] INFO user.mqtt: desired unit system is 
METRIC
Nov 21 12:03:48 raspi weewx[18165] INFO user.mqtt: data will be uploaded to 
mqtt://weewx:xxx@192.168.1.140:1883
Nov 21 12:03:48 raspi weewx[18165] INFO weewx.engine: 'pyephem' detected, 
extended almanac data is available
Nov 21 12:03:48 raspi weewx[18165] INFO __main__: Starting up weewx version 
5.0.0b15
Nov 21 12:03:48 raspi weewx[18165] INFO weewx.engine: Using binding 
'wx_binding' to database 'weewx.sdb'
Nov 21 12:03:48 raspi weewx[18165] INFO weewx.manager: Starting backfill of 
daily summaries
Nov 21 12:03:48 raspi weewx[18165] INFO weewx.manager: Daily summaries up 
to date
Nov 21 12:03:49 raspi weewx[18165] INFO weewx.drivers.fousb: synchronising 
to the weather station (quality=0)
Nov 21 12:03:52 raspi weewx[18165] INFO weewx.engine: Main loop exiting. 
Shutting engine down.
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: Caught unrecoverable 
exception:
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   can't 
subtract offset-naive and offset-aware datetimes
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   Traceback 
(most recent call last):
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File 
"/home/pi/weewx-venv/lib/python3.9/site-packages/weewxd.py", line 157, in main
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   
engine.run()
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File 
"/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/engine.py", line 
175, in run
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   
self.dispatchEvent(weewx.Event(weewx.STARTUP))
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File 
"/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/engine.py", line 
242, in dispatchEvent
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   
callback(event)
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File 
"/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/engine.py", line 
581, in startup
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   
self._catchup(self.engine.console.genStartupRecords)
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File 
"/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/engine.py", line 
694, in _catchup
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   for 
record in generator(lastgood_ts):
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File 
"/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/drivers/fousb.py", 
line 1094, in genArchiveRecords
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   records 
= self.get_records(since_ts)
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File 
"/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/drivers/fousb.py", 
line 1303, in get_records
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   dts, 
ptr = self.sync(read_period=fixed_block['read_period'])
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File 
"/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/drivers/fousb.py", 
line 1380, in sync
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   if 
last_date - prev_date > datetime.timedelta(seconds=50):
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   

Re: [weewx-user] Is WeeWx 5.0 beta stable enough for non-experts to fool around with?

2023-11-21 Thread vince
Paul - I updated my script to be more flexible for vagrant vs. running on 
top of a native os, if you wanted to give the new one a try.

In the updated script I switched gears a little to have weewx write through 
a symlink into a new /var/www/hmtl/weewx subdirectory which is safer from a 
security standpoint.   The commands it runs to do so are down around line 
160 in the updated script if you wanted to do them manually.  It points 
weewx at a new subdirectory in nginx's document root.

A little cleanup would be needed to run those commands if you've previously 
run the earlier version of my script that symlinks the other way (points 
nginx at weewx $HOME).

A run on a clean system with no $HOME/weewx-data or $HOME/weewx-venv tree 
will work fine (tested on a pi) with the weewx web pages via 
http://yourhost_or_ip/weewx as the URL and the actual data being written to 
/var/www/html/weewx on the filesystem.

-- 
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/8f47f194-dc44-4203-9ee0-844a0cf1218bn%40googlegroups.com.


Re: [weewx-user] Is WeeWx 5.0 beta stable enough for non-experts to fool around with?

2023-11-21 Thread vince
[...long answer follows just so it can be searched for in the future...]

Multiple ways to connect weewx and nginx up under the hood:

   - edit weewx.conf to set the document root to point to nginx's location
   - edit nginx/sites-enabled/default to point the document root to the 
   weewx location
   - or symlink them in one direction or the other so weewx writes to the 
   nginx tree, or so nginx reads from the weewx tree

I tend to use symlinks because then I don't need to change either nginx 
'or' weewx config files.  But there's no wrong way probably.

So since I use a symlink to connect weewx and nginx, for me the url would 
be http://yourhostname/weewx with one caveatthere's currently an error 
in the script that I need to fix.  On line 138 it creates a symlink to link 
the weewx public_html into the nginx server's document root.

# for a user 'vagrant'
sudo ln -s /home/vagrant/weewx-data/public_html /var/www/html/weewx

That's good for vagrant/VirtualBox which typically runs as user 
'vagrant'.but a pi user typically would run as user 'pi'
So for a user 'pi' which I'm guessing you are using on a pi, try this:

# for a user 'pi'
sudo ln -s /home/pi/weewx-data/public_html /var/www/html/weewx

[...shorter answer of what to do...]

   - For a user 'pi' run the revised command above and see if "ls 
   /var/www/html/weewx" resolves and shows you all the files weewx created. 
If so you're likely good.


   - Then try to open http://yourhostname_or_ip/weewx/ and see if the weewx 
   stuff is returned.
   

Note - you 'might' see permission denied messages in your nginx logs 
initially.  If so that is because the user/group nginx runs as can't read 
files in the pi user home directory.   One brute-force way to fix it would 
be "sudo chmod 755 /home/pi" which lets all accounts read stuff in the 'pi' 
home directory.  That's less than a great production thing to do from a 
security standpoint, but for a quick test locally it's probably ok.

I need to tweak the script a little to be more flexible and more ok 
security-wise, but this should get you going.


On Tuesday, November 21, 2023 at 9:43:05 AM UTC-8 WindnFog wrote:

That works great, Vince.  It seems to be running smoothly on Debian-12. Now 
for the dumb question.  It looks like the web page is under 
/root/weewx-data/public_html/ . . . how does a person view the web page 
using a browser?  I'm just using the Simulator for now on a Pi 4B.

-- 
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/5fb9a20b-0ee0-48b6-bfd7-25e7d6974f66n%40googlegroups.com.


Re: [weewx-user] Is WeeWx 5.0 beta stable enough for non-experts to fool around with?

2023-11-21 Thread WindnFog
That works great, Vince.  It seems to be running smoothly on Debian-12. Now 
for the dumb question.  It looks like the web page is under 
/root/weewx-data/public_html/ . . . how does a person view the web page 
using a browser?  I'm just using the Simulator for now on a Pi 4B.

- Paul VE1DX
On Thursday, August 31, 2023 at 3:34:10 PM UTC-3 vince wrote:

> FWIW, I have a github repo (here) 
>  with a bash 
> script that automates the v5 pip install, installs and configures nginx and 
> my 'mem' extension, hooks weewx into the nginx web, and starts it all up. 
>  I use this on pi and vagrant virtual machines to fiddle with the v5 beta.
>
> Works for me as a one-step installer on a 'clean' sacrificial system and 
> it's tested on several os variants.
>
>  Please read the toplevel readme file and do a quick read of the example 
> logfile it generates to see what it does step-by-step.
>
>

-- 
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/5a41a6a4-363a-46c3-a54e-5fea3a64eb2en%40googlegroups.com.


Re: [weewx-user] Problem registering my weather station in the WeeWX global station map

2023-11-21 Thread Δημήτρης Βήχος
i have the same problem. suddenly without reason my weather station in 
kolxiko thessalonikis not appears in map. while the other weather station 
who i have in moudania halkidiki with just same settings same weather 
hardware same linux dist apeears!

Στις Τρίτη 21 Νοεμβρίου 2023 στις 12:31:37 π.μ. UTC+2, ο χρήστης Tom Keffer 
έγραψε:

> It's a good question. One would have to modify fileparse to either stat 
> the file to see if it's new, or look at the timestamp (field "dateTime") of 
> the resultant LOOP packet. Something fancier would use pyinotify 
>  to block until the file changes.
>
> On Mon, Nov 20, 2023 at 1:50 PM Remy LAVABRE  wrote:
>
>> Thanks for your response Tom.
>>
>> just a clarification on the use of fileparse:
>>
>> if the fileparse setting for the loop packet recovery timeout in 
>> weewx.conf is 10 seconds and the file containing the loop packet is only 
>> updated after 60 seconds (this is an example), what happens during the 50 
>> seconds where weewx will retrieve the same packet loop 5 times?
>>
>> Does Weewx know how to manage the recovery of a same packet loop 
>> recovered several times ?
>>
>> THANKS
>>
>> Le lun. 20 nov. 2023, 13:54, Tom Keffer  a écrit :
>>
>>> The simplest would be to go back to using WeeWX, but this time using a 
>>> driver that reads from your file. 
>>>
>>> The WeeWX distribution includes an example, fileparse 
>>> , that 
>>> reads from a file using key=value pairs. Either change your file format to 
>>> match, or modify fileparse to use a CSV input.
>>>
>>> On Mon, Nov 20, 2023 at 12:31 AM Remy Lavabre  
>>> wrote:
>>>
 Good morning,
 I previously used weeWX connected to the USB output of my weather 
 station. No problem, the station was well referenced on the world map of 
 WeeWX weather stations.

 Unfortunately my station broke down and an exchange was carried out 
 under warranty with a new station without a USB port. This station sends 
 data to AWEKAS.

 I was therefore forced to modify everything, to stop the WeeWX daemon 
 permanently, to automatically retrieve the data from the AWEKAS site every 
 5 minutes, save it in CSV format and run wee_import at the same frequency 
 to update my weewx.sdb database and generate all the graphics, html pages 
 etc...

 It works perfectly EXCEPT that my weather station is no longer 
 referenced on the WeeWX map! :-(
 Is there a way to reference it again although only using wee_import 
 (which nevertheless uses the weewx.conf configuration file)?

 Thank you...

 -- 
 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/1b7247b6-4b94-4ff4-8160-006f54faff2fn%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+...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/weewx-user/CAPq0zEDrGDyL3f3nROcRq2X0qQQZFNZ_gR6fevGGPqzjxCWPzQ%40mail.gmail.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+...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/CADhm9Yen3ra4wpHx3FkpPkaX4gqj3P8r5yLHNEpC40_0RfASXA%40mail.gmail.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/27a0f5ec-576e-4cac-a7e3-09c571941787n%40googlegroups.com.


Re: [weewx-user] weewx 5.0 upgrade trouble

2023-11-21 Thread Tom Keffer
This is a problem with the Fine Offset driver that we're aware of. It's
caused by the deprecation of the function datetime.utcnow() in Python 3.12.

The fix for now is to downgrade to Python 3.11.

-tk

On Tue, Nov 21, 2023 at 3:26 AM Frank Frommelt  wrote:

> Hi there,
>
> OK, I have taken the risk in updatting weewx from 4.10.2 to the latest 5.0
> (beta) version.
>
> I followed the update guide and everything looked fine.
>
> When finally starting the service I am getting the following error:
>
> *Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: 
>  TypeError: can't subtract offset-naive and offset-aware datetimes*
>
> So, it looks like some data is time-zone aware and some is not.
>
> Basically I found something to cure the problem, but as I have no idea on
> programming, I need some help...
>
>
> https://toptechtips.github.io/2023-04-03-python-offset-aware-offset-naive-timezones/
>
>
> Here is the full log down to the error message...
>
> (weewx-venv) pi@raspi:/home/weewx $ sudo systemctl start weewx
> (weewx-venv) pi@raspi:/home/weewx $ tail -f /var/log/weewx.log
> Nov 21 12:03:48 raspi weewx[18165] INFO user.mqtt: binding to archive
> Nov 21 12:03:48 raspi weewx[18165] INFO user.mqtt: topic is weather
> Nov 21 12:03:48 raspi weewx[18165] INFO user.mqtt: desired unit system is
> METRIC
> Nov 21 12:03:48 raspi weewx[18165] INFO user.mqtt: data will be uploaded
> to mqtt://weewx:xxx@192.168.1.140:1883
> Nov 21 12:03:48 raspi weewx[18165] INFO weewx.engine: 'pyephem' detected,
> extended almanac data is available
> Nov 21 12:03:48 raspi weewx[18165] INFO __main__: Starting up weewx
> version 5.0.0b15
> Nov 21 12:03:48 raspi weewx[18165] INFO weewx.engine: Using binding
> 'wx_binding' to database 'weewx.sdb'
> Nov 21 12:03:48 raspi weewx[18165] INFO weewx.manager: Starting backfill
> of daily summaries
> Nov 21 12:03:48 raspi weewx[18165] INFO weewx.manager: Daily summaries up
> to date
> Nov 21 12:03:49 raspi weewx[18165] INFO weewx.drivers.fousb: synchronising
> to the weather station (quality=0)
> Nov 21 12:03:52 raspi weewx[18165] INFO weewx.engine: Main loop exiting.
> Shutting engine down.
> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: Caught unrecoverable
> exception:
> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   can't
> subtract offset-naive and offset-aware datetimes
> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   Traceback
> (most recent call last):
> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File
> "/home/pi/weewx-venv/lib/python3.9/site-packages/weewxd.py", line 157, in
> main
> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: 
>  engine.run()
> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File
> "/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/engine.py", line
> 175, in run
> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: 
>  self.dispatchEvent(weewx.Event(weewx.STARTUP))
> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File
> "/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/engine.py", line
> 242, in dispatchEvent
> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: 
>  callback(event)
> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File
> "/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/engine.py", line
> 581, in startup
> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: 
>  self._catchup(self.engine.console.genStartupRecords)
> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File
> "/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/engine.py", line
> 694, in _catchup
> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   for
> record in generator(lastgood_ts):
> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File
> "/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/drivers/fousb.py",
> line 1094, in genArchiveRecords
> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: 
>  records = self.get_records(since_ts)
> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File
> "/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/drivers/fousb.py",
> line 1303, in get_records
> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   dts,
> ptr = self.sync(read_period=fixed_block['read_period'])
> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File
> "/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/drivers/fousb.py",
> line 1380, in sync
> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   if
> last_date - prev_date > datetime.timedelta(seconds=50):
> *Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: 
>  TypeError: can't subtract offset-naive and offset-aware datetimes*
> Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   Exiting.
>
> --
> You received this message because you are subscribed to the Google Groups
> 

[weewx-user] weewx 5.0 upgrade trouble

2023-11-21 Thread Frank Frommelt
Hi there,

OK, I have taken the risk in updatting weewx from 4.10.2 to the latest 5.0 
(beta) version.

I followed the update guide and everything looked fine.

When finally starting the service I am getting the following error:

*Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   TypeError: 
can't subtract offset-naive and offset-aware datetimes*

So, it looks like some data is time-zone aware and some is not.

Basically I found something to cure the problem, but as I have no idea on 
programming, I need some help...

https://toptechtips.github.io/2023-04-03-python-offset-aware-offset-naive-timezones/


Here is the full log down to the error message... 

(weewx-venv) pi@raspi:/home/weewx $ sudo systemctl start weewx
(weewx-venv) pi@raspi:/home/weewx $ tail -f /var/log/weewx.log
Nov 21 12:03:48 raspi weewx[18165] INFO user.mqtt: binding to archive
Nov 21 12:03:48 raspi weewx[18165] INFO user.mqtt: topic is weather
Nov 21 12:03:48 raspi weewx[18165] INFO user.mqtt: desired unit system is 
METRIC
Nov 21 12:03:48 raspi weewx[18165] INFO user.mqtt: data will be uploaded to 
mqtt://weewx:xxx@192.168.1.140:1883
Nov 21 12:03:48 raspi weewx[18165] INFO weewx.engine: 'pyephem' detected, 
extended almanac data is available
Nov 21 12:03:48 raspi weewx[18165] INFO __main__: Starting up weewx version 
5.0.0b15
Nov 21 12:03:48 raspi weewx[18165] INFO weewx.engine: Using binding 
'wx_binding' to database 'weewx.sdb'
Nov 21 12:03:48 raspi weewx[18165] INFO weewx.manager: Starting backfill of 
daily summaries
Nov 21 12:03:48 raspi weewx[18165] INFO weewx.manager: Daily summaries up 
to date
Nov 21 12:03:49 raspi weewx[18165] INFO weewx.drivers.fousb: synchronising 
to the weather station (quality=0)
Nov 21 12:03:52 raspi weewx[18165] INFO weewx.engine: Main loop exiting. 
Shutting engine down.
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: Caught unrecoverable 
exception:
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   can't 
subtract offset-naive and offset-aware datetimes
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   Traceback 
(most recent call last):
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File 
"/home/pi/weewx-venv/lib/python3.9/site-packages/weewxd.py", line 157, in 
main
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:  
 engine.run()
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File 
"/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/engine.py", line 
175, in run
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:  
 self.dispatchEvent(weewx.Event(weewx.STARTUP))
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File 
"/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/engine.py", line 
242, in dispatchEvent
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:  
 callback(event)
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File 
"/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/engine.py", line 
581, in startup
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:  
 self._catchup(self.engine.console.genStartupRecords)
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File 
"/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/engine.py", line 
694, in _catchup
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   for 
record in generator(lastgood_ts):
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File 
"/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/drivers/fousb.py", 
line 1094, in genArchiveRecords
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   records 
= self.get_records(since_ts)
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File 
"/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/drivers/fousb.py", 
line 1303, in get_records
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   dts, 
ptr = self.sync(read_period=fixed_block['read_period'])
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__: File 
"/home/pi/weewx-venv/lib/python3.9/site-packages/weewx/drivers/fousb.py", 
line 1380, in sync
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   if 
last_date - prev_date > datetime.timedelta(seconds=50):
*Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   TypeError: 
can't subtract offset-naive and offset-aware datetimes*
Nov 21 12:03:52 raspi weewx[18165] CRITICAL __main__:   Exiting.

-- 
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/905eb6cb-ebf0-4e70-8dd1-279db3a47750n%40googlegroups.com.