Re: [weewx-user] Re: Exclude list or Overwrite behaviour for RSync Report

2024-04-02 Thread Glenn McKechnie
On Tue, 2 Apr 2024 at 15:00, Chris Alemany  wrote:

> Thanks for the hints Vince. I ended up looking through the old Wiki and
> came upon this page about backing up databases with the rsync report and
> how you can spit rsync into multiple skins.
>
>
> https://github.com/weewx/weewx/wiki/Using-the-RSYNC-skin-as-a-backup-solution
>

That was a good solution for a while, until - like you - I wanted more.

I eventually pulled the rsyncupload.py code from the main tree and stuffed
it into a skin.
The following was written a while ago. I still use it as is, but it's rough
and untidy.  Really does need a clean up but I haven't and still don't have
the time do that, so you get it warts and all...

https://github.com/glennmckechnie/weewx-rsynctransfer

It should install  *Gulp*, it should be self explanatory *Gulp*
There are plenty of notes and examples in it that show it can handle the
additional rsync command line options.

my email address is in the code, there's the  issues tab on github and I
always read this group.

Cheers
 Glenn

Various WeeWx addons at
https://github.com/glennmckechnie

-- 
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/CAAraAzijTtyrqxW_5CT3XQz_XM33NOLgrV2LGHtV11F-nQFuZQ%40mail.gmail.com.


Re: [weewx-user] CWOP Stopped Working (Breaks WeeWx)

2024-03-26 Thread Glenn McKechnie
In your CWOP section you have enable = and station = specified twice.

Comment out those two example lines and restart weewx.

On Wed, 27 Mar 2024, 08:42 Chris Maness, 
wrote:

> CWOP reporting breaks my WeeWx setup.  This has been working fine for
> a couple of years until about 9 days ago.  I did not do an update
> unless PIP did something in the background that I am not aware of.
>
> With these lines in my config:
>
> [[CWOP]]
> # This section is for configuring posts to CWOP.
>
> # If you wish to post to CWOP, set the option 'enable' to true,
> # then specify the station ID (e.g., CW1234).
> enable = false
> station = replace_me
> # If this is an APRS (radio amateur) station, specify the
> # passcode (e.g., 12345). Otherwise, ignore.
> # passcode = replace_me
> # uncomment below as this is my stuff.
> enable = true
> station = kq6up
> passcode = XX
> server_list = noam.aprs2.net:14580,
>
> My "systemctl status weewx" outputs this:
>
> × weewx.service - WeeWX
>  Loaded: loaded (/lib/systemd/system/weewx.service; enabled;
> preset: enabled)
>  Active: failed (Result: exit-code) since Tue 2024-03-26 14:40:31
> PDT; 6s ago
>Duration: 294ms
>Docs: https://weewx.com/docs
> Process: 30288 ExecStart=weewxd /etc/weewx/weewx.conf
> (code=exited, status=3)
>Main PID: 30288 (code=exited, status=3)
> CPU: 293ms
>
> Mar 26 14:40:30 RADIOpi weewxd[30288]: config_dict =
> configobj.ConfigObj(config_path,
> Mar 26 14:40:30 RADIOpi weewxd[30288]:
> 
> Mar 26 14:40:30 RADIOpi weewxd[30288]:   File
> "/usr/lib/python3/dist-packages/configobj/__init__.py", line 1229, in
> __init__
> Mar 26 14:40:30 RADIOpi weewxd[30288]: self._load(infile, configspec)
> Mar 26 14:40:30 RADIOpi weewxd[30288]:   File
> "/usr/lib/python3/dist-packages/configobj/__init__.py", line 1318, in
> _load
> Mar 26 14:40:30 RADIOpi weewxd[30288]: raise error
> Mar 26 14:40:30 RADIOpi weewxd[30288]: configobj.ConfigObjError:
> Parsing failed with several errors.
> Mar 26 14:40:30 RADIOpi weewxd[30288]: First error at line 129. File
> '/etc/weewx/weewx.conf'.
> Mar 26 14:40:31 RADIOpi systemd[1]: weewx.service: Main process
> exited, code=exited, status=3/NOTIMPLEMENTED
> Mar 26 14:40:31 RADIOpi systemd[1]: weewx.service: Failed with result
> 'exit-code'.
>
> I just updated my system to bookworm, and reinstalled EVERYTHING from
> scratch, and I am
> having the same issue.  Can anyone reproduce this?
>
> -Chris KQ6UP
>
>
>
>
> --
> Thanks,
> Chris Maness
>
> --
> 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/CANnsUMFYjm%2Be5cVSdHbRO0HQj%2BHSU5i3paUCJo7sCn5JAZiZEQ%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/CAAraAziaJtWBW54YgQ85CNF6bpQQs3FjZG%2Bw8goNAHt7eZkitg%40mail.gmail.com.


Re: [weewx-user] Re: Weewx 5.0.2, saving sql-backups on a usb stick fails.

2024-03-04 Thread Glenn McKechnie
And that research will benefit you, so it's worth doing - always.

But as you've found this issue, and as I need to add some notes to the
README for weewx-sqlbackup - that cover this new issue. You get the first
draft and if it needs adjusting, tell me.

So; In brief, and as the root user (or sudo it) .

*mkdir   /mnt/sqlbackup*
*chown weewx:weewx   /mnt/sqlbackup *(or chmod whatever)

plug your usb drive in, ( and hopefully the system auto mount will get out
of our way).
Use *dmesg* to identify the partition on this backup drive, then use *fdisk
-l* to confirm it (optional).
This example uses */dev/sd?1* - you will have something more meaningful.

test it by mounting the drive.

*mount   /dev/sd?1   /mnt/sqlbackup*
*ls -al   /mnt/sqlbackup*

All okay? Is it what you expect? Then ...

*umount   /mnt/sqlbackup.*

Now, add the following line to your */etc/fstab*  file; perhaps with an
appropriate comment

# added a weewx sql backup drive. RTFM with *man fstab*
*/dev/sd?1   /mnt/sqlbackup   ext4   errors=remount-ro   0   0*

Save the file and mount it (and everything else - redundantly) with
*  mount -a*

I'm assuming it's formatted as *ext4* - adjust as required; and I've
specified* 0 0* on that fstab entry to remind me that there are no file /
boot up checks on that drive.

That's the gist of it. Tweak as you like.

Ah, and change the skin.conf entry to point to it.



Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie


On Mon, 4 Mar 2024 at 22:13, Pierre-Yves  wrote:

> Thanks a lot Glenn.
> I need to dig a little deeper into this story of connection under mnt and
> mounting via fstab. My knowledge of these tools is a little limited ;-)
> Pierre-Yves
>
> Le lundi 4 mars 2024 à 10:54:26 UTC+1, Glenn McKechnie a écrit :
>
>>
>> On Mon, 4 Mar 2024 at 19:07, Pierre-Yves  wrote:
>>
>>> [...]
>>
>>
>>>
>>> pi@raspberrypi:~ $ ps -adelf | grep [Ww]eewxd
>>> 4 S *weewx*14866 1  2  80   0 - 26178 -  mars03 ?
>>> 00:14:55 python3 /usr/share/weewx/weewxd.py /etc/weewx/weewx.conf
>>>
>>> ls -al '/media/pi/WEEWX-BU' returns:
>>>
>>> pi@raspberrypi:~ $ ls -al '/media/pi/WEEWX-BU'
>>> total 273976
>>> *drwxr-xr-x   5 pi   pi4096  1 janv.  1970  .*
>>> *drwxrwxrwx+  3 root root  4096  3 mars  17:59  ..*
>>> -rw-r--r--   1 pi   pi8622 22 déc.  16:46
>>> 'as3935(min_strikes).py'
>>> drwxr-xr-x  12 pi   pi4096  2 mars  14:18  Belchertown
>>> drwxr-xr-x  12 pi   pi4096  1 mars  18:27  Belchertown-old
>>> -rw-r--r--   1 pi   pi4156  6 févr. 23:27  bme280wx.py
>>> -rw-r--r--   1 pi   pi1616  7 févr. 00:00  Commandes-usuelles.txt
>>> -rw-r--r--   1 pi   pi   40148  1 mars  21:50  graphs.conf
>>> -rw-r--r--   1 pi   pi  148331 28 juin   2023 'sdr(last).py'
>>> drwxr-xr-x   5 pi   pi4096 28 oct.  18:04  Seasons202310281704
>>> -rw-r--r--   1 pi   pi   40047  1 mars  21:28  skin.conf
>>> -rw-r--r--   1 pi   pi   36467  1 mars  09:00  weewx.conf
>>> -rw-r--r--   1 pi   pi   280235008  2 mars  15:26  weewx.sdb.backup
>>>
>>> PS: I use also this usb drive for manually saving various files and
>>> folders without any problem (skins, database...)
>>>
>>> It seems, in view of the table above, that the drive is not properly
>>> mounted with regards to the weewx 5.0.2 rules. I tried to change using
>>> chown, but I got an "operation denied"...
>>>
>>
>> This has me perplexed.
>>
>> The /media directory seems to be treated differently by the system. I've
>> tried to change ownership / permissions on a test drive and it's not
>> behaving as I expect.
>> I'm able to make those same changes under /mnt so I'm missing something.
>> I need an up-slap to the back of the head, a far stronger cup of coffee or
>> probably just a hefty dose of RTFM. In the meantime, I'll blame systemd :P
>>
>> If you don't want to relocate that drive (understandable), and you have a
>> spare USB slot then I'd be plugging a fresh drive in under /mnt and
>> mounting it via fstab. You can then manually set the permissions to weewx
>> and they'll stick.
>>
>> And, if someone knows the answer. I'm all ears
>>
>> Cheers
>>  Glenn
>>
>> rorpi - read only raspberry pi & various weewx addons
>> https://github.com/glennmckechnie
>>
> --
> 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

Re: [weewx-user] Re: Weewx 5.0.2, saving sql-backups on a usb stick fails.

2024-03-04 Thread Glenn McKechnie
On Mon, 4 Mar 2024 at 19:07, Pierre-Yves  wrote:

> [...]
>
> pi@raspberrypi:~ $ ps -adelf | grep [Ww]eewxd
> 4 S *weewx*14866 1  2  80   0 - 26178 -  mars03 ?
> 00:14:55 python3 /usr/share/weewx/weewxd.py /etc/weewx/weewx.conf
>
> ls -al '/media/pi/WEEWX-BU' returns:
>
> pi@raspberrypi:~ $ ls -al '/media/pi/WEEWX-BU'
> total 273976
> *drwxr-xr-x   5 pi   pi4096  1 janv.  1970  .*
> *drwxrwxrwx+  3 root root  4096  3 mars  17:59  ..*
> -rw-r--r--   1 pi   pi8622 22 déc.  16:46 'as3935(min_strikes).py'
> drwxr-xr-x  12 pi   pi4096  2 mars  14:18  Belchertown
> drwxr-xr-x  12 pi   pi4096  1 mars  18:27  Belchertown-old
> -rw-r--r--   1 pi   pi4156  6 févr. 23:27  bme280wx.py
> -rw-r--r--   1 pi   pi1616  7 févr. 00:00  Commandes-usuelles.txt
> -rw-r--r--   1 pi   pi   40148  1 mars  21:50  graphs.conf
> -rw-r--r--   1 pi   pi  148331 28 juin   2023 'sdr(last).py'
> drwxr-xr-x   5 pi   pi4096 28 oct.  18:04  Seasons202310281704
> -rw-r--r--   1 pi   pi   40047  1 mars  21:28  skin.conf
> -rw-r--r--   1 pi   pi   36467  1 mars  09:00  weewx.conf
> -rw-r--r--   1 pi   pi   280235008  2 mars  15:26  weewx.sdb.backup
>
> PS: I use also this usb drive for manually saving various files and
> folders without any problem (skins, database...)
>
> It seems, in view of the table above, that the drive is not properly
> mounted with regards to the weewx 5.0.2 rules. I tried to change using
> chown, but I got an "operation denied"...
>

This has me perplexed.

The /media directory seems to be treated differently by the system. I've
tried to change ownership / permissions on a test drive and it's not
behaving as I expect.
I'm able to make those same changes under /mnt so I'm missing something. I
need an up-slap to the back of the head, a far stronger cup of coffee or
probably just a hefty dose of RTFM. In the meantime, I'll blame systemd :P

If you don't want to relocate that drive (understandable), and you have a
spare USB slot then I'd be plugging a fresh drive in under /mnt and
mounting it via fstab. You can then manually set the permissions to weewx
and they'll stick.

And, if someone knows the answer. I'm all ears

Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzhOC51kjpa2nwMn1vUMGdYx4oE0VtuFUYuRiqboTcN%2B5g%40mail.gmail.com.


Re: [weewx-user] Re: Weewx 5.0.2, saving sql-backups on a usb stick fails.

2024-03-03 Thread Glenn McKechnie
As the author of sql-backup, I should probably step up here.

I haven't been able to set up a V5 installation yet, so therefore I'm
unfamiliar with the changes required but that group change Vince mentioned
should be enough - the disk needs rw (read write) for the weewx user, or
dialout group.

Did you login/logout to set the group changes that vince mentioned.

https://github.com/weewx/weewx/wiki/Understanding-permissions#how-to-fix-device-permissions

further comments inline below...


On Mon, 4 Mar 2024 at 09:39, Pierre-Yves  wrote:

> Thanks Vince for feedback but I remember I already sent this comment.
> However, I sent it again. Same result...
>
> How can I check I am running weewx as user weewx ?
>

  ps -adelf | grep [Ww]eewxd

The 3rd column will show the user.


Pierre-Yves
>
> Mar  3 23:30:31 raspberrypi weewxd[13195]: INFO user.sqlbackup: version is
> 0.5
> Mar  3 23:30:31 raspberrypi weewxd[13195]: DEBUG user.sqlbackup:  starting
> from 2024-02-25 23:15:31
> Mar  3 23:30:31 raspberrypi weewxd[13195]: DEBUG user.sqlbackup:
>  databases, sqlite 1 named ['weewx.sdb']
> Mar  3 23:30:31 raspberrypi weewxd[13195]: ERROR user.sqlbackup: [Errno
> 13] Permission non accordée: '/media/pi/WEEWX-BU'
>



and also,  what's the details for the USB drive
  ls -al '/media/pi/WEEWX-BU'

You could always manually mount that drive as the weewx user under (for
eg:) /mnt/sql-backup and add an entry to fstab - with suitable permissions.
And reflect that change in the skin.conf file
p.s. I found thumb drives unreliable for backups. They eventually go
read-only - the Sans-disk ones I had did that.


> Mar  3 23:30:31 raspberrypi weewxd[13195]: DEBUG weewx.manager: Daily
> summary version is 4.0
> [...]
>



> Mar  3 23:30:31 raspberrypi weewxd[13195]: ERROR weewx.cheetahgenerator:
>   return os.stat(filename).st_mtime
> Mar  3 23:30:31 raspberrypi weewxd[13195]: ERROR weewx.cheetahgenerator:
>   FileNotFoundError: [Errno 2] Aucun fichier ou dossier de ce type:
> '/tmp/sqlbackup/syslinks.inc'
>

That error should disappear after the first run - it's due to the manual
steps in configuration.


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAziTeV273Wn6YtQ3PODMJ9etMBfabiTN81DBrUX5cotE4g%40mail.gmail.com.


Re: [weewx-user] Importing data from awair sensor

2024-01-12 Thread Glenn McKechnie
Hi,
As the author of the previously mentioned uradmon, I probably should pitch
in.

At first glance your json data and fields look very similar to uradmons,
and that's without looking at the uradmon code (it's been a while!)
Reviewing the code confirms that.
It should be a fairly straight forward to adapt it, with the bonus that the
extra uradmon specific code (retries and timeouts) can hopefully be ignored
in your case.
One difference is your data supplies a timestamp. uradmon.py generates its
own timestamp as the unit doesn't supply one. The choices begin!

The uradmon.py was written pretty much as a standalone service, under weewx
control of course.
It defines the units / groups  / formats /  labels and conversions etc that
it uses because at the time these weren't included in weewx itself, plus it
uses some oddball ones - Pa, cpm. I believe some of them are now included
in weewx.

It writes to its own database primarily because I didn't want to go adding
or co-opting weewx fields for uradmon purposes, and then live with the
consequences at upgrade time. It also seemed the simplest method to prevent
stomping on other users choices.  It was also written before the new schema
although looking at your fields there are some rather awair specific names?

The uradmon code is fairly well commented with example data (there are at
least 4 different types of urad units) and if you go down that path and
have any queries then you can contact me directly - if you read this via an
email client my address should be visible.


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie


On Sat, 13 Jan 2024 at 08:21, sting ray  wrote:

> the uradman example looks promising  Am also using seasons 4.10.2.
> another possibility https://github.com/jonathankoren/weewx-aqi
> On Friday, January 12, 2024 at 7:29:48 AM UTC-5 michael.k...@gmx.at wrote:
>
>> Write an extension that queries the device every archive_interval
>>
>> or
>>
>> Get the device to publish it's value per MQTT (if it supports anything
>> such this) and use mqttsubscribe
>>
>> or
>>
>> find a third party that queries the device and publishes the value per
>> MQTT (node red should work) and use mqttsubscribe
>>
>> I'd go for the first option, if the second option isn't available, since
>> I've done something like this already: (Get JSON, parse it and put the
>> values into a desired column of the weewx database):
>> https://github.com/mKainzbauer/weewx_extensions/blob/master/fronius.py
>> John Smith schrieb am Freitag, 12. Januar 2024 um 12:57:29 UTC+1:
>>
>>> On Fri, 12 Jan 2024 at 22:41, sting ray  wrote:
>>>
 Any advice how to import and display data from awair element
 sensors?These are intended for indoor aqi monitoring but appear to
 function in covered outdoor locations like a back porch.

>>>
>>> If no one else replies with a better answer you could look at
>>> https://github.com/glennmckechnie/weewx-uradmon which takes json values
>>> on a uradmon and injects it into a DB and then has a skin to display
>>> graphs.
>>>
>> --
> 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/181df546-7bb9-427c-94ba-23b4c8b41cdan%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/CAAraAzh%2BxQ289k4mMYXd7qCkeFKhqrORGSR_SQ_iS20%3DgA8yLg%40mail.gmail.com.


Re: [weewx-user] How to get the daily rain sum

2023-09-02 Thread Glenn McKechnie
Hi Axelle,

Good to see it's working, and that dev_mode helped.

On 02/09/2023, Invisible Man  wrote:
> Ok, I enabled dev mode, and it helped me spot the error : it was treating
> my 4 images as a single file. In weewx.conf, we should not put the 4 images
>
> between ' ... '.

Indeed. We are expecting a list (of images) and I really shouldn't
have put quotes in the example.

I've edited the repo to reflect that ...
 install.py: Update install.py with image notes

> And now it works :))
> Thanks for this great extension, and your help!

And for the feed back.

-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzgnsARn8etihtpsB47z1w-qt8N78YP149%2B41HZke5%3Dq_A%40mail.gmail.com.


Re: [weewx-user] How to get the daily rain sum

2023-08-31 Thread Glenn McKechnie
On 01/09/2023, Invisible Man  wrote:
> Glenn,
> How am I meant to publish images on Mastodon?
> I have this in weewx.conf for the Mastodon extension:
>
> ```
> # comma separated list of up to 4 images
> images =
> '/home/weewx/external_html/daytempdew.png,/home/weewx/external_html/dayrain.png,/home/weewx/external_html/dayuv.png'
> ```
>
> Those paths lead to graphs. I thought they would be appended to the toot,
> like in the image of the README.md
> of https://github.com/glennmckechnie/weewx-mastodon, but that's not the
> case. So, how does it work?

paths and images are declared separately.

In the weewx.conf section, [[Mastodon]] , there are 3 lines relating to images.
In your example, you want these 2.

# complete if uploading images from a local directory
image_directory = /home/weewx/external_html
# comma separated list of up to 4 images
images = daytempdew.png, dayrain.png, dayuv.png

That should work for you, and if it doesn't then review the log for
wxtoot specific messages and include them in a reply.

> This is my mastodon account: https://piaille.fr/@biotmeteo
>
> Thanks,
> Axelle

-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzjUMV%2BfjBAatY72zqYYWYk0Ojb3gLqTdj6esG5B6BVM9A%40mail.gmail.com.


Re: [weewx-user] How to get the daily rain sum

2023-08-29 Thread Glenn McKechnie
On 30/08/2023, Invisible Man  wrote:
> Thanks to both of you for your replies.
>
> - since.py etc are in /usr/share/weewx/user already so indeed I can try and

since.py is part of the weewx-mastodon install.

> use them. I tried to directly use since in the format line of
> weewx-mastodon, but haven't succeeded yet:
> `{since($hour=24).rain.sum:%.3f}` , `{since(hour=24).rain.sum:%.3f}`... not
> sure I can do it like that.

As you found, these won't work on the raw (archive) data.

> - I'll look in the template file.

The example template I mentioned already uses since.py to format the
rain value as ...
$since($hour=9).rain.sum (Australian reporting times)

According to the weewx manual at
http://www.weewx.com/docs.html/latest/customizing.htm#Formatting_examples
A format method to use for your example could be...
$since($hour=9).rain.sum.format("%.3f")
I just tested that method and it works. Apparently we've had 7.429 mm of rain!

> - final option is that I directly tweak wxtoot.py ...
> I'll investigate and post back if I have a question... or with my solution
> if I succeed :)

Done :)

-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzicBAehHGmpVc0rjLRw_hoquWyApmB%2B%3DO_hxzjNCkP7TA%40mail.gmail.com.


Re: [weewx-user] How to get the daily rain sum

2023-08-28 Thread Glenn McKechnie
Short answer, when using the inbuilt FORMAT strings - no.
Long answer - see the templates - which are lacking instruction but
follow standard weewx methods - I believe.

Despite being the author / maintainer of weewx-mastodon I had to go
back and check on the code.

It gets its units directly from the raw data, the archive values.

day.rain.sum is generated at a later stage of the weewx cycle by the
StdReport engine.

If however you use the template method, whereby you generate a
StdReport in your skins DATA directory - eg:-
skins/Seasons/DATA/mastodon.txt.tmpl then you should be able to do
what you are asking.

It's been a long while since I've looked at it, but I believe that will do it .
The README notes for 24th Jan 2023 v0.04 outline one hiccup when
testing the templates but it should be straight forward.
Use the default as is then start tweaking it.


On 29/08/2023, Invisible Man  wrote:
> I am using the Mastodon extension for
> Weewx. https://github.com/glennmckechnie/weewx-mastodon.
> I believe my question is however not strictly related to this extension,
> see below.
>
> It is possible to format the message which is tooted regularly and supply a
>
> specific format.
> One of the default formats is:
>
> ```
> format = '{station:%s} ' \
>  '\n Windspeed: {windSpeed:%.1f} ' \
>  '\n Winddir: {windDir:%03.0f} ' \
>  '\n Windgust: {windGust:%.1f} ' \
>  '\n outTemp: {outTemp:%.1f} ' \
>  '\n outHumidity: {outHumidity:%.2f} ' \
>  '\n Pressure: {barometer:%.3f} ' \
>  '\n Rain: {rain:%.3f} ' \
>  '\n Date Time: {dateTime:%d %b %Y %H:%M}'
> ```
>
> The value of the rain does not work well for me, because, to my
> understanding, it's the current rain, and I seldom have rain, so I rather
> want to have at least the daily sum of rain. I thought I could perhaps
> change the format to {day.rain.sum:%.3f}, but it is not understood...
>
> So, how can I get this daily sum?
>
> The code imports the following modules.
>
> ```python
> import weewx
> import weewx.restx
> import weewx.units
> from weeutil.weeutil import to_bool
> ```
>
> -- Axelle.
>
> --
> 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/6d7873c7-f325-414a-9471-d9387b469802n%40googlegroups.com.
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzicMF23ZNYq1cQrhBDaAZBwJtiBExKqszTp9n6N9gXHfA%40mail.gmail.com.


Re: [weewx-user] Weewx to Mastodon/ActivityPub?

2023-05-07 Thread Glenn McKechnie
On 07/05/2023, Jarmo Seppänen  wrote:
> Thank you Glen for the hints.
> I got it working.
> When I added unit_system = METRICWX to StdReport the error disappeared.
> Perhaps the best place for it would be in
> [StdRESTful]
> [[Mastodon]]
> ...
> unit_system = US, METRIC, METRICWX
> if that is possible as that way one could configure it for Mastodon only.

Yep. Sounds like a good fallback solution.
I'll still keep the original as it should be there in a standard
install , and it still exists in that location with Weewx v5;  but I
will set that location as a 'report specific' option - which it
probably should have anyway.

[...]

> Oh, one thing I discovered when trying to report the UV readings.
> I got an error:
> weewx[30835] CRITICAL weewx.restx: Mastodon: Thread terminating. Reason:
> can only concatenate str (not "NoneType") to str
> After digging around I noticed that in file
> /home/weewx/bin/user/wxtoot.py in line 481
> 'uv_index': 'None', was causing the issue.
> I changed it to:
> 'uv_index': '',

You are correct. There is no unit for UV so '"" covers it.

> As I'm a lousy developer I don't know if this breaks something else but at
> least "it works for me" :)

It is the fix, and consider yourself a value adding bug reporter. :)
That feedback is always appreciated.

> Perhaps you can take a look at that too for the coming releases.

Indeed I will.

-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzgv-sZ-AD4h2EjXvDiHAhhjP6eCMVwbsKAFPKH2SjHR%3DQ%40mail.gmail.com.


Re: [weewx-user] Weewx to Mastodon/ActivityPub?

2023-05-05 Thread Glenn McKechnie
On 05/05/2023, Jarmo Seppänen  wrote:
> After installation I'm getting the following error to logs:
> May  5 10:57:35 raspi3b weewx[19058] CRITICAL __main__: Caught
> unrecoverable exception:
> May  5 10:57:35 raspi3b weewx[19058] CRITICAL __main__: 
>  'unit_system'
> May  5 10:57:35 raspi3b weewx[19058] CRITICAL __main__:   Traceback
> (most recent call last):
> May  5 10:57:35 raspi3b weewx[19058] CRITICAL __main__: File
> "/home/weewx/bin/weewxd", line 148, in main
> May  5 10:57:35 raspi3b weewx[19058] CRITICAL __main__: 
>  engine = weewx.engine.StdEngine(config_dict)
> May  5 10:57:35 raspi3b weewx[19058] CRITICAL __main__: File
> "/home/weewx/bin/weewx/engine.py", line 93, in __init__
> May  5 10:57:35 raspi3b weewx[19058] CRITICAL __main__: 
>  self.loadServices(config_dict)
> May  5 10:57:35 raspi3b weewx[19058] CRITICAL __main__: File
> "/home/weewx/bin/weewx/engine.py", line 161, in loadServices
> May  5 10:57:35 raspi3b weewx[19058] CRITICAL __main__:   obj =
> weeutil.weeutil.get_object(svc)(self, config_dict)
> May  5 10:57:35 raspi3b weewx[19058] CRITICAL __main__: File
> "/home/weewx/bin/user/wxtoot.py", line 290, in __init__
> May  5 10:57:35 raspi3b weewx[19058] CRITICAL __main__:   usn =
>
> config_dict['StdReport']['Defaults']['unit_system']
> May  5 10:57:35 raspi3b weewx[19058] CRITICAL __main__: File
> "/usr/lib/python3/dist-packages/configobj.py", line 554, in __getitem__
> May  5 10:57:35 raspi3b weewx[19058] CRITICAL __main__:   val =
> dict.__getitem__(self, key)
> May  5 10:57:35 raspi3b weewx[19058] CRITICAL __main__:   KeyError:
> 'unit_system'
> May  5 10:57:35 raspi3b weewx[19058] CRITICAL __main__:   Exiting.
> Any hints?

It's looking for the unit_system section in your weewx.conf file.
In the default weewx.conf for Weewx 4.10.2 it appears as follows...
[StdReport]
[...]
[[Defaults]]
[...]
unit_system = us

Do you have an entry for unit_system in your weewx.conf file?
If it's missing, then put one in and see if that fixes that hiccup
(and I'll rethink if that's the best place to discover the
unit_system, or what to do if it goes missing)

Which leads to...
 What version of weewx are you running,
 What's the version of wxtoot.py (at line 177)
 Have you edited the weewx.conf file and removed that entry?

> Also the parameter: server_url_mastodon = 'replace_me' confuses me. What is
> this exactly?

See the README, but to recap, it is as follows.

You are going to post to a Mastodon server. It lives somewhere and has
an address.
So, which one? What is its address? URL, IP?

That information replaces the place-holder  'replace_me' within your
weewx.conf file, as follows.

[StdRESTful]
[...]
[Mastodon]
[...]
server_url_mastodon = 'replace_me'

You will also need a 'key_access_token' which you can only get by
following the instructions on that server. It's available from your
account there.

Review the README.md , in particular the last section, after 'Options'

https://github.com/glennmckechnie/weewx-mastodon

If you are still having problems then attach the log and a sanitised
(password free) copy of weewx.conf to your next post, or send it
directly to me.

-- 

Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzjY8OqF9hUqxvPN%3DjO8dvedTi9hhGum7fLjNcTi2YPCiA%40mail.gmail.com.


Re: [weewx-user] SSH

2023-02-24 Thread Glenn McKechnie
Okay, they are in the right place.

Do they have the correct permissions? If those are screwed up it will
ask for a password regardless of any public key.

What happens when you - from your terminal - enter the following...

ssh jensjk...@linux83.unoeuro.com

If it asks for a password then it's not setup correctly. Try...

ssh -v  jensjk...@linux83.unoeuro.com

That will return some info (add more 'v' s for more info) . Any
obvious errors in the output that returns?



On 22/02/2023, Jens-Jørgen Kjærgaard  wrote:
> I have given rsync a try, suggested by tk as a much better option than ftp.
> However, I get
>
> Feb 21 17:31:22 raspberrypi weewx[3741] DEBUG weewx.reportengine: Running
> report 'RSYNC'
> Feb 21 17:31:22 raspberrypi weewx[3741] DEBUG weewx.reportengine: Found
> configuration file /home/jjk/weewx/skins/Rsync/skin.conf for report 'RSYNC'
> Feb 21 17:31:22 raspberrypi weewx[3741] DEBUG weewx.reportengine: Cannot
> read localization file /home/jjk/weewx/skins/Rsync/lang/en.conf for report
> 'RSYNC': Config file not found: "/home/jjk/weewx/skins/Rsync/lang/en.conf".
> Feb 21 17:31:22 raspberrypi weewx[3741] DEBUG weewx.reportengine: 
> Using defaults instead.
> Feb 21 17:31:22 raspberrypi weewx[3741] DEBUG weeutil.rsyncupload:
> rsyncupload: cmd: [['rsync', '--archive', '--stats', '-e', 'ssh',
> '/home/jjk/weewx/public_html/',
> 'jensjk...@linux83.unoeuro.com:/public_html/hytte']]
> Feb 21 17:31:22 raspberrypi weewx[3741] ERROR weeutil.rsyncupload: rsync
> reported errors. Original command: ['rsync', '--archive', '--stats', '-e',
> 'ssh', '/home/jjk/weewx/public_html/',
> 'jensjk...@linux83.unoeuro.com:/public_html/hytte']
> Feb 21 17:31:22 raspberrypi weewx[3741] ERROR weeutil.rsyncupload: 
> Permission denied, please try again.
> Feb 21 17:31:22 raspberrypi weewx[3741] ERROR weeutil.rsyncupload: 
> Permission denied, please try again.
> Feb 21 17:31:22 raspberrypi weewx[3741] ERROR weeutil.rsyncupload: 
> jensjk...@linux83.unoeuro.com: Permission denied (password).
> Feb 21 17:31:22 raspberrypi weewx[3741] ERROR weeutil.rsyncupload: 
> rsync: connection unexpectedly closed (0 bytes received so far) [sender]
> Feb 21 17:31:22 raspberrypi weewx[3741] ERROR weeutil.rsyncupload: 
> rsync error: unexplained error (code 255) at io.c(235) [sender=3.1.3]
> Feb 21 17:31:23 raspberrypi weewx[3741] DEBUG weewx.restx: StationRegistry:
>
> Failed upload attempt 3: b'FAIL: Server is undergoing maintenance\n'
> Feb 21 17:31:23 raspberrypi weewx[3741] ERROR weewx.restx: StationRegistry:
>
> Failed to publish record 2023-02-21 17:30:00 CET (1676997000): Failed
> upload after 3 tries
>
> Apparently, something is wrong with my permissions - I have the private and
>
> public keys in the right place for passwordless ssh - but nevertheless get:
>
> Permission denied (password).
>
> --
> 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/8bcb1036-9f07-40ed-901c-da560b571de8n%40googlegroups.com.
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzjNMKwgwE8BXMwNodYygU1dvkCx9na8NmwdLZOYYMM3Jg%40mail.gmail.com.


Re: [weewx-user] Re: Weewx Send data to Twitter Account

2023-01-23 Thread Glenn McKechnie
There may be other ways, but use tags. This is the approach I've taken
with weewx-mastodon.

Using weewx tags ( https://weewx.com/docs/customizing.htm#Tags) in a
template will  generate the desired text output.
You would however need to modify the twitter extension to post the
output from a weewx generated template. (see below)

eg:- template (snippet)...

#Weather summary for Yesterday ($yesterday.dateTime.format("%A
%d-%b-%Y")) at
$station.location, Australia: \n
Temp: (min: $yesterday.outTemp.min at $yesterday.outTemp.mintime)
(max: $yesterday.outTemp.max at $yesterday.outTemp.maxtime)

will generate the following text...

#Weather summary for Yesterday (Monday 23-Jan-2023) at
Messmate Farm, Broomfield, Victoria, Australia: \n
Temp: (min: 11.6C at 06:35:01) (max: 35.1C at 16:46:02)

https://github.com/glennmckechnie/weewx-mastodon

If you're familiar with python it should offer a few hints ho w to
post the template rather than the hardcoded format string, especially
as it's a fork of Mathews weewx-twitter extension.

I haven't incoporated the summary in weewx-mastodon - yet. It was on
the mental ToDo list, but it would only need a timing section and some
selection magic.






On 24/01/2023, Jon B  wrote:
> Does anyone have any ideas for this? I guess one way may be to read from
> the previous day's archive_day entries in the database e.g.
> archive_day_rain, although I'm not sure how easy/practical this would be
>
> On Saturday, 7 January 2023 at 02:33:15 UTC Jon B wrote:
>
>> Is it possible to use this Twitter extension to post the daily archived
>> values for a given day? Ideally I'd like to set it to automatically tweet
>>
>> once a day (say at 10am local time) giving the stats for the previous day,
>>
>> e.g.:
>>
>> 06/01/2023: Max temperature: 12.3C, Min temperature: 2.3C, Max wind gust:
>>
>> 35 mph, Total rainfall: 12.2 mm
>>
>> I have it working so that it only tweets once a day at 10am, but giving
>> instantaneous values is a bit pointless at that tweet frequency
>>
>>
>> On Saturday, 7 January 2023 at 02:24:33 UTC Jon B wrote:
>>
>>> I managed this by modifying Axelle's code above in process_record():
>>>
>>> ts = time.localtime()
>>> if ts.tm_hour not in (0,6,12,18) or ts.tm_min != 0:
>>>
>>> logdbg("This is not hour to tweet: %d" % ts.tm_hour)
>>> return
>>>
>>> That should tweet at 00:00, 06:00, 12:00 and 18:00. I'm not sure if this
>>>
>>> will necessarily work if the archive interval is longer than 1 minute
>>> though (my station is set to 1 minute)
>>> On Monday, 28 March 2022 at 21:00:45 UTC+1 arnaud...@gmail.com wrote:
>>>
 Hello, I installed the twitter extension 'weewx-twitter' on my install
 (Debian 11 + WeeWX 4.7.0 + weewx-twitter 0.15) and it works fine. I
 modified the 'twitter.py' file to post a tweet to my weather twitter
 account and I wish the extension sends a tweet at a fixed time (0:00,
 6:00,
 12:00, 18:00). But if WeeWX or the computer restarts, tweets are sent
 the minutes the software starts (Ex: If WeeWX restarts at 4:12, the
 tweet is sent at 6:12, then 12:12, 18:12).

 Here is my part of the file:

 ```ts = time.localtime()
 if (ts.tm_hour != 0 and ts.tm_hour != 6 and ts.tm_hour != 12 and

 ts.tm_hour != 18):

 logdbg("This is not hour to tweet: %d" % ts.tm_hour)
 return
 ```

>>>
>
> --
> 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/9fcf620c-45f2-499d-8d9f-d91d1861160bn%40googlegroups.com.
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzjruCCystWeBZ677wH-ON3aVHgo1DT2QYDiEk%2B78%2BQz8g%40mail.gmail.com.


Re: [weewx-user] weewx.4.6.0 : since.py : KeyError: 'trend'

2023-01-02 Thread Glenn McKechnie
It is a non-standard file . It doesn't come with weewx.

And, it belongs in the Weewx user directory - /usr/share/weewx/user

There are installation notes in the files header - although
abbreviated there as  weewx/user/.

On 03/01/2023, Derek Harding  wrote:
> I can't find a copy of since.py anywhere on my installations (I have two
> weather stations in different locations). Both of them only have
> inigo-since.py.
> I'm running raspberry pi's with version 4.7.0 and 4.9.1
> Can someone suggest into which directory I should place Glen's version of
> since.py?
>
> On Thursday, 6 October 2022 at 02:58:33 UTC+13 Greg from Oz wrote:
>
>> Thanks Glenn your copy of since.py works with version 4.8.0.
>> https://weather.ubeaut.work/
>>
>> On Sunday, 2 October 2022 at 21:54:49 UTC+11 Glenn McKechnie wrote:
>>
>>> Looks like I'm still using this once - with WeeWX 4.6.0
>>> See attached
>>>
>>> On 02/10/2022, Greg from Oz  wrote:
>>> > Hi,
>>> >
>>> > Is there a copy of the since.py that works with the later versions of
>>> > weewx?
>>> > I cannot find a working copy of it anywhere.
>>> > I tried adding the bits that Tom suggested but obviously I didn't do
>>> > it
>>> > correctly and it didn't work.
>>> >
>>> > Thanks
>>> >
>>> > On Monday, 7 February 2022 at 09:45:55 UTC+11 Glenn McKechnie wrote:
>>> >
>>> >> Thanks Tom, for the explanation and the quick fix. It's applied and
>>> >> working.
>>> >>
>>> >> I'll mull over your explanation, bits of it make sense - I'll need
>>> >> more time for the rest ;-)
>>> >>
>>> >> Thanks again.
>>> >>
>>> >> On 07/02/2022, Tom Keffer  wrote:
>>> >> > The problem here is a little technical, so bear with me.
>>> >> >
>>> >> > The way things work normally is that the default configuration for
>>> the
>>> >> > Cheetah generator includes a TimeBinder in the search list. Because
>>> >> > a
>>> >> > TimeBinder includes an attribute 'trend', the tag $trend works.
>>> >> >
>>> >> > The problem is that the extension since.py also includes a
>>> TimeBinder,
>>> >> but
>>> >> > one that has not been properly initialized. It needs a keyword
>>> argument
>>> >> > "trend".
>>> >> >
>>> >> > Why did it work before, but not now? Because the order of evaluation
>>> >> >
>>> of
>>> >> >
>>> >> the
>>> >> > search list changed. Before, it searched built-in objects first,
>>> >> > then
>>> >> user
>>> >> > extensions. V4.6 does it the other way around: it searches user
>>> >> extensions
>>> >> > first, then the built-ins. This is to allow overriding the behavior
>>> >> >
>>> of
>>> >> the
>>> >> > built-in search list, which the since.py extension inadvertently
>>> >> > did.
>>> >> > So,
>>> >> > when evaluating the tag $trend, the custom, not properly
>>> >> > initialized,
>>> >> > version of TimeBinder is hit first, and the built-in version is
>>> >> > never
>>> >> seen.
>>> >> > This re-ordering should have been mentioned in the Upgrade Guide.
>>> >> >
>>> >> > There are two ways to fix:
>>> >> >
>>> >> > 1. Properly initialize the instance of TimeBinder in since.py.
>>> >> > 2. Change the logic of since.py. Frankly, I don't know why it
>>> returns a
>>> >> > TimeBinder at all. It's way more complicated than it needs to be,
>>> >> > and
>>> >> > has
>>> >> > the side effect that it's basically overriding all of the tags,
>>> >> > including
>>> >> > such mundane tags as $day, $week, etc. It gets away with this
>>> >> > because
>>> >> > its
>>> >> > semantics are identical for these other tags.
>>> >> >
>>> >> > If you want a quick fix, do option #1. Here's the delta
>>> >> >
>>> >> >
>>> >> > --- since.py 2022-02-06 04:59:19.0 -0800
>>>

Re: [weewx-user] Weewx to Mastodon/ActivityPub?

2022-12-27 Thread Glenn McKechnie
Okay,

https://github.com/glennmckechnie/weewx-mastodon

The rough edges have been filed smooth. You shouldn't need to wear
gloves anymore!

To see it in action...
https://mastodon.au/@BroomfieldWeatherBot



On 22/12/2022, Chris Alemany  wrote:
> Oh! Elegant solution.
>
> My “bot” is at @alberniweather...@mstdn.ca
> http://mstdn.ca/@alberniweatherBot
> Note, the instance has been extremely busy lately so don’t be surprised if
> the connection times out.
>
> Cheers
> Chris
>
>> On Dec 21, 2022, at 06:16, Mark Fraser  wrote:
>>
>> On 21/12/2022 07:45, Glenn McKechnie wrote:
>>> Hi Chris,
>>> Nothing like finding a day where you can plunge, guilt free, into the
>>> ToDo list.  I didn't have a Snow day, but I borrowed yours!
>>> I started re-purposing Matthew Walls twitter extension (which runs
>>> uses RestX - [StdRESTful] ) and have had good success with it in the
>>> half day or so that it's been runnng. Still some work to do on it
>>> (phttt) but the text part works well enough.
>>> Your use of the template is interesting - that gives it a bit of
>>> flexibility.
>>> I'll mull that one over while I continue down the media (image) path.
>>> Alpha is at ...
>>> https://github.com/glennmckechnie/weewx-mastodon
>>> On 21/12/2022, Chris Alemany  wrote:
>>>> The snowy weather here on Vancouver Island has given me some unexpected
>>>> time to work on this.  I now have a working template file and python
>>>> script
>>>>
>>>> that will produce and post weewx data to a Mastodon account.
>>>> Just setup an account on your favourite Mastodon server,
>>>> mark it as a bot,
>>>> create an API/Client Key (under development in your account's
>>>> preferences)
>>>> install the template file to one of your skins (I just added it to the
>>>> Standard skin.
>>>> put the python file somewhere it can be run with cron
>>>> run the python file with a command like this:
>>>>
>>>> sudo python3  weewx_to_mastodon.py --server https://mstdn.ca --wxdata
>>>> https://mywebpage.com/mastodon.json --api_key biglongstring234fssdf
>>>>
>>>> I've attached my working files if anyone is itching to have it, excuse
>>>> the
>>>> messy code but it should be fairly self explanatory. You should only
>>>> really
>>>>
>>>> need to modify the values in the json.tmpl file.
>>>>
>>>> On Sunday, December 18, 2022 at 3:40:31 PM UTC-8 Chris Alemany wrote:
>>>>
>>>>> Here is the promised link to the fellow who created a Python script
>>>>> from
>>>>> cumulus on Mac to Mastodon/ActivityPub:
>>>>> https://github.com/buffaloseven/CumulusMX-Customizations/tree/main/integrations
>>>>>
>>>>> Sent from my iPhone
>>>>>
>>>>> On Dec 15, 2022, at 6:24 AM, Chris Alemany  wrote:
>>>>>
>>>>> Hi all,
>>>>>
>>>>>
>>>>>
>>>>> Has anyone had a go at having weewx post to Mastodon/Fediverse, either
>>>>> to
>>>>>
>>>>> an existing @user@server or as an independent instance?
>>>>>
>>>>> There is at least one fellow who has written some Python to do it from
>>>>> his
>>>>>
>>>>> cumulus based system. I will share his GitHub project if someone
>>>>> thinks
>>>>> they can do it.
>>>>>
>>>>> Cheers
>>>>> Chris
>>>>>
>>>>> Sent from my iPhone
>>
>> I've been posting to Mastodon for a while now and I've done it a bit
>> differently.
>>
>> In skin.conf of what ever skin you are using (Seasons for me) I added:
>>[[MastodonHourly]]
>>encoding = strict_ascii
>>template = mastodon.out.tmpl
>>
>> mastodon.out.tmpl contains:
>> Temp: $current.outTemp Humidity: $current.outHumidity\nPressure:
>> $current.barometer\nWind: $current.windDir.ordinal_compass,
>> $current.windSpeed (ave), $current.windGust (gust)\nRain Rate:
>> $current.rainRate Rain Total: $day.rain.sum\nSolar Radiation:
>> $current.radiation UV: $current.UV\nSoil Moisture: $current.soilMoist1
>>
>> Lastly I have this python script run hourly from a Crontab using
>> Mastodon.py and I can upload an image from my webcam at the same time:
>>
>> #!/usr/bin/env python3
>&g

Re: [weewx-user] Re: Weewx to Mastodon/ActivityPub?

2022-12-20 Thread Glenn McKechnie
Hi Chris,

Nothing like finding a day where you can plunge, guilt free, into the
ToDo list.  I didn't have a Snow day, but I borrowed yours!

I started re-purposing Matthew Walls twitter extension (which runs
uses RestX - [StdRESTful] ) and have had good success with it in the
half day or so that it's been runnng. Still some work to do on it
(phttt) but the text part works well enough.

Your use of the template is interesting - that gives it a bit of flexibility.

I'll mull that one over while I continue down the media (image) path.

Alpha is at ...
https://github.com/glennmckechnie/weewx-mastodon


On 21/12/2022, Chris Alemany  wrote:
> The snowy weather here on Vancouver Island has given me some unexpected
> time to work on this.  I now have a working template file and python script
>
> that will produce and post weewx data to a Mastodon account.
> Just setup an account on your favourite Mastodon server,
> mark it as a bot,
> create an API/Client Key (under development in your account's preferences)
> install the template file to one of your skins (I just added it to the
> Standard skin.
> put the python file somewhere it can be run with cron
> run the python file with a command like this:
>
> sudo python3  weewx_to_mastodon.py --server https://mstdn.ca --wxdata
> https://mywebpage.com/mastodon.json --api_key biglongstring234fssdf
>
> I've attached my working files if anyone is itching to have it, excuse the
> messy code but it should be fairly self explanatory. You should only really
>
> need to modify the values in the json.tmpl file.
>
> On Sunday, December 18, 2022 at 3:40:31 PM UTC-8 Chris Alemany wrote:
>
>> Here is the promised link to the fellow who created a Python script from
>> cumulus on Mac to Mastodon/ActivityPub:
>> https://github.com/buffaloseven/CumulusMX-Customizations/tree/main/integrations
>>
>> Sent from my iPhone
>>
>> On Dec 15, 2022, at 6:24 AM, Chris Alemany  wrote:
>>
>> Hi all,
>>
>>
>>
>> Has anyone had a go at having weewx post to Mastodon/Fediverse, either to
>>
>> an existing @user@server or as an independent instance?
>>
>> There is at least one fellow who has written some Python to do it from his
>>
>> cumulus based system. I will share his GitHub project if someone thinks
>> they can do it.
>>
>> Cheers
>> Chris
>>
>> Sent from my iPhone
>>
>>
>
> --
> 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/aa08bcaa-6e19-4e39-b0bc-16093034a910n%40googlegroups.com.
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzgkfz%3Dc6g0ighmL5TVxUkmxFNsMY5iNvShy9PaPFYhy2A%40mail.gmail.com.


Re: [weewx-user] Re: Weewx does not update website with new data.

2022-11-17 Thread Glenn McKechnie
On 18/11/2022, Bob Rose  wrote:
> Glen, During the initial install I did not see a option for the
> ecowitt/gw1000. After the install I found :  Add Ecowitt Data to WeeWX
> (cougar.eu.com)
> <https://www.cougar.eu.com/useful-guides/weewx-guides/rasberry-pi/add-ecowitt/modify-weewx.html>.

Yes. That's Mike Revitt's site so that would match his driver
(mentioned previously) which does indeed use tempf for ExtraTemp2

> And used that. So, I probably have it all wrong.

Yep. Mixing instructions, like drinks; never ends well!

If you are using Gary's GW1000 driver then follow his instructions. I
note that he has a wiki with the driver so it should be very well
documented.

https://github.com/gjr80/weewx-gw1000/wiki

And if it's not - I'm sure he would appreciate a heads up as I have no
doubt he would fix / clarify it.

> On Thursday, November 17, 2022 at 5:39:43 PM UTC-7 Glenn McKechnie wrote:
>
>> Agree with Vince; but...
>>
>> Where does the file /usr/share/weewx/user/ecowitt.py come from?
>>
>> It's not in the driver that weewx reports as
>> user.gw1000: GatewayDriver: version is 0.5.0b5
>>
>> The ecowitt.py drivers I tripped over don't sync with the line 44
>> number but there is a tempf in ...
>>
>> https://github.com/MRevitt/Weewx/blob/8cb89587017ecb87419a384b68647850b1a50c7f/bin/user/ecowitt.py
>>
>> and a temp2f in
>>
>> https://github.com/MRevitt/Weewx/blob/8cb89587017ecb87419a384b68647850b1a50c7f/bin/user/ecowitt.py
>>
>> Have you configured the GW1000 driver or used an old setup - ie;
>> different driver.
>>
>> You also mention reusing an old database - ExtraTemp2 was tempf under
>> the MRevitt driver - do you need to rename that field?
>>
>> Yes, Questions with no real answers.
>> Only you or Gary will have the answers ;-)
>>
>> I'll go now.


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzig%2BdTxsq_z7S5P2N7KS_Zp2C%2BcLELXvZ%3DA%2Bypy6wR-mg%40mail.gmail.com.


Re: [weewx-user] Re: Weewx does not update website with new data.

2022-11-17 Thread Glenn McKechnie
Agree with Vince; but...

Where does the file /usr/share/weewx/user/ecowitt.py come from?

It's not in the driver that weewx reports as
user.gw1000: GatewayDriver: version is 0.5.0b5

The ecowitt.py drivers I tripped over don't sync with the line 44
number but there is a tempf in ...
https://github.com/MRevitt/Weewx/blob/8cb89587017ecb87419a384b68647850b1a50c7f/bin/user/ecowitt.py

and a temp2f in
https://github.com/MRevitt/Weewx/blob/8cb89587017ecb87419a384b68647850b1a50c7f/bin/user/ecowitt.py

Have you configured the GW1000 driver or used an old setup - ie;
different driver.

You also mention reusing an old database - ExtraTemp2 was tempf under
the MRevitt driver - do you need to rename that field?

Yes, Questions with no real answers.
Only you or Gary will have the answers ;-)

I'll go now.




On 18/11/2022, vince  wrote:
> Gonna have to defer to Gary many timezones Down Under on this one, but it
> would be prudent to post your GW1000 stanza from weewx.conf so he has a
> complete picture of your setup.
>
> And a couple crazy ideas/questions in the interim:
>
>- stop weewx, delete (or move aside) your db, and restart weewx ... does
>
>it work now ?
>- if not, verify you did step 3 of https://github.com/gjr80/weewx-gw1000
>- then run step 4 of https://github.com/gjr80/weewx-gw1000 and see what
>that reports
>
>
> The reason I'm suggesting the first test is that v4 of weewx uses the
> wview_extended schema which is different than the v3 defaults.  The other
> two tests (and posting your weewx.conf excerpt) are for trying to diagnose
> what's up.
>
>
> On Thursday, November 17, 2022 at 3:20:34 PM UTC-8 rose0...@gmail.com
> wrote:
>
>> Sorry. It was just the way the logview I was using is set up. Here is an
>> oldest at the top cut.
>>
>> Nov 17 16:13:44 ubuntserver weewx[720010]:  * Starting weewx weather
>> system weewx
>> Nov 17 16:13:44 ubuntserver weewx[720021] INFO __main__: Initializing
>> weewx version 4.9.1
>> Nov 17 16:13:44 ubuntserver weewx[720021] INFO __main__: Using Python
>> 3.10.6 (main, Nov  2 2022, 18:53:38) [GCC 11.3.0]
>> Nov 17 16:13:44 ubuntserver weewx[720021] INFO __main__: Located at
>> /bin/python3
>> Nov 17 16:13:44 ubuntserver weewx[720021] INFO __main__: Platform
>> Linux-5.15.0-53-generic-x86_64-with-glibc2.35
>> Nov 17 16:13:44 ubuntserver weewx[720021] INFO __main__: Locale is
>> 'en_US.UTF-8'
>> Nov 17 16:13:44 ubuntserver weewx[720021] INFO __main__: Using
>> configuration file /etc/weewx/weewx.conf
>> Nov 17 16:13:44 ubuntserver weewx[720021] INFO __main__: Debug is 1
>> Nov 17 16:13:44 ubuntserver weewx[720021] INFO __main__: PID file is
>> /var/run/weewx.pid
>> Nov 17 16:13:44 ubuntserver weewx[720039] DEBUG __main__: Initializing
>> engine
>> Nov 17 16:13:44 ubuntserver weewx[720039] INFO weewx.engine: Loading
>> station type GW1000 (user.gw1000)
>> Nov 17 16:13:44 ubuntserver weewx[720010]:...done.
>> Nov 17 16:13:44 ubuntserver systemd[1]: Started LSB: weewx weather
>> system.
>> Nov 17 16:13:44 ubuntserver weewx[720039] INFO user.gw1000: Legacy WH40
>> detected, WH40 battery state data will be ignored
>> Nov 17 16:13:44 ubuntserver weewx[720039] INFO user.gw1000: GatewayDriver:
>>
>> version is 0.5.0b5
>> Nov 17 16:13:44 ubuntserver weewx[720039] INFO user.gw1000: GatewayDriver:
>>
>> GW1000 address is 192.168.1.204:45000
>> Nov 17 16:13:44 ubuntserver weewx[720039] INFO user.gw1000: GatewayDriver:
>>
>> poll interval is 60 seconds
>> Nov 17 16:13:44 ubuntserver weewx[720039] DEBUG user.gw1000:
>> GatewayDriver: max tries is 3, retry wait time is 10 seconds
>> Nov 17 16:13:44 ubuntserver weewx[720039] DEBUG user.gw1000:
>> GatewayDriver: broadcast address is 255.255.255.255:46000, broadcast
>> timeout is 5 seconds
>> Nov 17 16:13:44 ubuntserver weewx[720039] DEBUG user.gw1000:
>> GatewayDriver: socket timeout is 2 seconds
>> Nov 17 16:13:44 ubuntserver weewx[720039] DEBUG user.gw1000:
>> GatewayDriver: field map is {'co2': 'co2', 'co2_24h_avg': 'co2_24h_avg',
>> 'dateTime': 'datetime', 'daymaxwind': 'daymaxwind', 'dayRain':
>> 't_rainday',
>> 'dewpoint': 'dewpoint', 'extraHumid1': 'humid1', 'extraHumid2': 'humid2',
>>
>> 'extraHumid3': 'humid3', 'extraHumid4': 'humid4', 'extraHumid5': 'humid5',
>>
>> 'extraHumid6': 'humid6', 'extraHumid7': 'humid7', 'extraHumid8': 'humid8',
>>
>> 'extraHumid17': 'humid17', 'extraTemp1': 'temp1', 'extraTemp2': 'temp2',
>> 'extraTemp3': 'temp3', 'extraTemp4': 'temp4', 'extraTemp5': 'temp5',
>> 'extraTemp6': 'temp6', 'extraTemp7': 'temp7', 'extraTemp8': 'temp8',
>> 'extraTemp9': 'temp9', 'extraTemp10': 'temp10', 'extraTemp11': 'temp11',
>> 'extraTemp12': 'temp12', 'extraTemp13': 'temp13', 'extraTemp14': 'temp14',
>>
>> 'extraTemp15': 'temp15', 'extraTemp16': 'temp16', 'extraTemp17': 'temp17',
>>
>> 'heatindex': 'heatindex', 'inHumidity': 'inhumid', 'inTemp': 'intemp',
>> 'leafWet1': 'leafwet1', 'leafWet2': 'leafwet2', 'leafWet3': 'leafwet3',
>> 'leafWet4': 'leafwet4', 'leafWet5': 'leafwet5', 'leafWet6': 

Re: [weewx-user] Re: calculate rainRate for second rain gauge...?

2022-11-16 Thread Glenn McKechnie
Hi Gary,

Thanks for that.
I can appreciate that other things can often rank higher on the ever
changing ToDo list; such is its nature.

Will bookmark #813, and happy to test any code.
I can probably fire up a separate instance of weewx with another ow
adapter and rain ( hail / snow) counter if need be.

Hope you (and others) are high and dry in this wet summer we are
having. Seems odd to be in the middle of fire preparations but Aus
really is a country of extremes.


On 17/11/2022, gjr80  wrote:
> Glenn,
>
> Other things and a need to reacquaint myself with #491
> <https://github.com/weewx/weewx/issues/491> have delayed me getting back to
>
> you. You are correct that StdWXCalculate cannot calculate rate based fields
>
> other than rainRate. #491 considered a number of approaches for calculating
>
> delta fields from total fields (the case in hand being field rain from a
> rain total field) and a number of approaches were considered, these
> approaches impacted on some of the other StdWXCalculate functions and I
> suspect my comment earlier in this thread was based on some of the early
> development code written under #491. As it turned out the final #491
> solution resulted in the current hard coded rainRate approach.
>
> Happy you look at generalising rate based calculation in StdWXCalculate and
>
> I have raised issue #813 <https://github.com/weewx/weewx/issues/813> to
> track this. Should have some time in the next week to work on this.
>
> Gary
>
> On Sunday, 13 November 2022 at 16:16:11 UTC+10 Glenn McKechnie wrote:
>
>> On 29/06/2020, gjr80 <...> wrote:
>> > I would not worry about raising anything Christian, the code I am
>> working on
>> > would allow something like a rate based field to be calculated from
>> > some
>> > other (user specified) field. You still have to add any necessary extra
>> > fields to your database yourself, but StdWXCalculate could be configured
>> >
>> to
>> > create the rate based field. No guarantees as it needs the Tom-tick but
>> >
>> it
>> > looks good so far.
>>
>> Breathing life into an old thread...
>>
>> Did this idea get the "Tom-tick"?
>>
>> I'm using hail and hailrate.
>>
>> I've had a look at issue #491 and the new wxxtypes and wondering if
>> that is what was being referenced here. I can't see a way to make hail
>> (or snow!) work with it (RainRater) though. Hopefully some simple
>> stanza under [StdWXCalculate] [[WXXTypes]]?
>>
>> I co-opted the hail field a while ago and have 5 years of data
>> supplied via a modified OWFS driver.
>>
>> It would be helpful to have the hailrate to compare with the rainrate
>> from the original rain gauge as I'm cleaning up some extreme rain
>> values; which also means that issue #787 (wee_database --calc-missing
>> does not correctly calculate rainRate) bites if I want the historical
>> values?
>> --
>>
>>
>> Cheers
>> Glenn
>>
>> rorpi - read only raspberry pi & various weewx addons
>> https://github.com/glennmckechnie
>>
>
> --
> 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/1e8d4083-e7ae-4c9c-bc54-36efb147c886n%40googlegroups.com.
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzh%2BniajXu5%2B4eAumU_Rp4F%2BiUKb0XxTB%2BNPSb-qLrJhUw%40mail.gmail.com.


Re: [weewx-user] Re: calculate rainRate for second rain gauge...?

2022-11-12 Thread Glenn McKechnie
On 29/06/2020, gjr80 <...> wrote:
> I would not worry about raising anything Christian, the code I am working on
> would allow something like a rate based field to be calculated from some
> other (user specified) field. You still have to add any necessary extra
> fields to your database yourself, but StdWXCalculate could be configured to
> create the rate based field. No guarantees as it needs the Tom-tick but it
> looks good so far.

Breathing life into an old thread...

Did this idea get the "Tom-tick"?

I'm using hail and hailrate.

I've had a look at issue #491 and the new wxxtypes and wondering if
that is what was being referenced here. I can't see a way to make hail
(or snow!) work with it (RainRater) though.Hopefully some simple
stanza under [StdWXCalculate] [[WXXTypes]]?

I co-opted the hail field a while ago and have 5 years of data
supplied via a modified OWFS driver.

It would be helpful to have the hailrate to compare with the rainrate
from the original rain gauge as I'm cleaning up some extreme rain
values; which also means that issue #787 (wee_database --calc-missing
does not correctly calculate rainRate) bites if I want the historical
values?
-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzhgrmRhRmkYF-xMYRewrH02H68dQjdkyGfyVH%3DY3NZT8A%40mail.gmail.com.


Re: [weewx-user] Time and date format in Weewx database

2022-11-04 Thread Glenn McKechnie
unixepoch, epochtime, unixtime

from a linux terminal...

$ date -d now +'%s'
1667553105

$ date -d @1667553105
Fri 04 Nov 2022 20:11:45 AEDT

man date

within a mysql (mariadb)...
SELECT FROM_UNIXTIME(datetime, '%d-%m-%Y %H:%i') from archive WHERE
dateTime = 166734;

there'll be something similar for sqlite

On 04/11/2022, Phillip Fischer  wrote:
> I hope that someone would be able to point me in the right direction.
>
> I am aiming to use Weewx to log data from a weather station console of a
> station that is set up in a remote, out of the way area as part of my
> research. Due to an oversight in Station specs, I was given a station that
> will need to be downloaded every two weeks or else the data is overwritten,
>
> but getting to the site every two weeks is not going to happen!
>
> I've got the station running, connected to a Raspberry Pi Zero 2 and it is
> working and logging data without issue.
>
> It is easy to get into the .sdb and convert the data to .csv for export to
> analyse the data off site. There is no cell signal, wifi or any other way
> of connectivity at the site so the data needs to be physically downloaded.
>
> I am however a bit stumped as I cannot figure out in what format the date
> and time is stored as. It seems to be a serial number, but I am not sure
> how to convert that back to Date and Time.
>
> Does anyone perhaps have an idea on how to get the conversion done? I
> cannot find any explanation in the documentation about the units of the
> database values.
>
> dateTime
> 1667481600
> 1667481900
> 1667483700
> 1667484000
> 1667484300
> 1667484600
> 1667484900
> 1667485200
> 1667485500
> 1667485800
> 1667486100
>
> --
> 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/88e58150-35a5-4841-bea2-452d573b6f6dn%40googlegroups.com.
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzi8A02nYOkcwdDuz0ig_omcGZpWEKdTr%2B1fy9Oda1Pvog%40mail.gmail.com.


Re: [weewx-user] Current Weather Conditions Weather Graphic

2022-10-07 Thread Glenn McKechnie
Hmmm,

v0.6.3 used commas, from v0.6.4 spaces are used.

The latest release is v0.6.6, use that one.

Or direct from the repo which has some minor fixes. (lang file and
README.md  tweaked)

What it is doing in that image is showing the first space separated
field for TEMP that it reads from wxgraphic_weewx.txt : ie: the whole
string,  as it sees just one long string.

I'll reply offlist and get you to send me some files.


On 07/10/2022, Scott Danville  wrote:
> Added both commas or semicolons and get the following result between
> variables in wxgraphic_weewx.txt.tmpl
> The new default, just a space between variables, renders no graphic.
> *How do I get the data to fill in the appropriate location in the
> wxgraphic?*
> *This is what I get with either commas or semicolons between variables in *
> wxgraphic_weewx.txt.tmpl
> [image: download.png]
>
> On Saturday, October 1, 2022 at 7:20:31 AM UTC-4 hesf...@gmail.com wrote:
>
>> supplement // Nachtrag
>>
>> if the values in /wxgraphic/DATA/wxgraphic_weewx.txt  = in format
>> ""13:00:00 01.10.2022 10,1 9,7 10,1 96,0 9,5 998,3 langsam_fallend 11,3 S
>>
>> 4,8 19,3  07:15:41 18:51:55
>> i.e. with spaces, then the value for windchill or heatindex is wrong
>> I changed this in config.txt as follows:
>>
>> Die Werte in wxgraphic_weewx.txt mit Leerzeichen getrennt  und dazu noch
>> als Komma-Werte gespeichert werden
>> können diese Werte mit Komma und Punkt nicht  verglichen werden, dann ist
>>
>> das Ergebnis  für WindChill und HeatIndex nicht definiert oder falsch
>> darum habe ich in der config.txt die folgenden Ergänzungen vorgenommen
>> ($windchill_us
>> und $heatindex_us)
>> Beispiel bei CUSTOM
>>
>>
>> /**/
>> /* write_custom: This function writes your values onto a custom 500X80
>> banner.*/
>> /*  imagecenteredtext($x, $y, $text, $size, $ttfsize, $color, $angle);
>>
>>*/
>>
>> /**/
>> function write_custom() {
>>
>>   // let's start by defining some global variables that will be passed
>> between
>>   // functions. This is kind of clunky!
>>   // NOTE: IF YOU ADD ADDITIONAL COLORS YOU'LL NEED TO ADD THEM HERE TOO!
>>   global $color1, $color2, $color3, $color4, $color5, $date, $t_ime,
>> $temp,
>>  $degree_units, $winds, $wind_units, $gust, $raintoday,
>> $rain_units,
>>  $barom, $barom_units, $baromtrendwords, $dewpt, $humidity,
>> $heatindex,
>>  $heat_index_threshold, $windchill, $wind_chill_threshold,
>>  $banner_icon_x, $banner_icon_y, $anti_alias,
>>  $windchill_us, $heatindex_us;
>>
>>   // this section does the heat index and wind chill
>>   // it figures out what to show, wind chill, heatindex or nothing
>>   // depending upon your settings
>>
>>   $windchill_us = number_format($windchill, 1, '.', '');
>>   $heatindex_us = number_format($heatindex, 1, '.', '');
>>
>>   switch (TRUE){
>>   // if windchill is <= $wind_chill_threshold we'll output it
>>   case ($windchill_us <= $wind_chill_threshold):
>>$feelslike = "Wind Chill: $windchill$degree_units";
>>imagecenteredtext(90, 52, "$feelslike", 2, 8, $color3, 0);
>>   break;
>>   // if heat index >= $heat_index_threshold we'll output it
>>   case ($heatindex_us >= $heat_index_threshold):
>>$feelslike = "Heat Idx: $heatindex$degree_units";
>>imagecenteredtext(90, 52, "$feelslike", 2, 8, $color1, 0);
>>   break;
>>   } // end switch
>>
>> ---
>> There is certainly a better way, but for now it works
>>
>> Gruss
>> Hartmut
>>
>>
>> steep...@btinternet.com schrieb am Freitag, 30. September 2022 um
>> 21:49:07 UTC+2:
>>
>>> Hi Glen,
>>> I managed to do a sneaky update on my phone using your latest fix and I
>>> am pleased to say it is all working now.
>>> Thanks for the prompt update and keep up the good work.
>>> Cheers,
>>> Ian
>>>
>>> On Friday, September 30, 2022 at 1:59:29 PM UTC+2 an oldman wrote:
>>>
>>>> the clientraw.txt.tmpl is from gjr80 WeeWX-WD skin
>>>> take a look at this page it might help
>>>> https://saratoga-weather.org/wdparser/index.php?site=https%3A%2F%2Fsaratoga-weather.org=Submit
>>>> On Friday, September 30, 2022 at 6:47:40 AM UTC-5 Glenn McKechnie
>>&

Re: [weewx-user] weewx.4.6.0 : since.py : KeyError: 'trend'

2022-10-02 Thread Glenn McKechnie
Looks like I'm still using this once - with WeeWX 4.6.0
See attached

On 02/10/2022, Greg from Oz  wrote:
> Hi,
>
> Is there a copy of the since.py that works with the later versions of
> weewx?
> I cannot find a working copy of it anywhere.
> I tried adding the bits that Tom suggested but obviously I didn't do it
> correctly and it didn't work.
>
> Thanks
>
> On Monday, 7 February 2022 at 09:45:55 UTC+11 Glenn McKechnie wrote:
>
>> Thanks Tom, for the explanation and the quick fix. It's applied and
>> working.
>>
>> I'll mull over your explanation, bits of it make sense - I'll need
>> more time for the rest ;-)
>>
>> Thanks again.
>>
>> On 07/02/2022, Tom Keffer  wrote:
>> > The problem here is a little technical, so bear with me.
>> >
>> > The way things work normally is that the default configuration for the
>> > Cheetah generator includes a TimeBinder in the search list. Because a
>> > TimeBinder includes an attribute 'trend', the tag $trend works.
>> >
>> > The problem is that the extension since.py also includes a TimeBinder,
>> but
>> > one that has not been properly initialized. It needs a keyword argument
>> > "trend".
>> >
>> > Why did it work before, but not now? Because the order of evaluation of
>> >
>> the
>> > search list changed. Before, it searched built-in objects first, then
>> user
>> > extensions. V4.6 does it the other way around: it searches user
>> extensions
>> > first, then the built-ins. This is to allow overriding the behavior of
>> the
>> > built-in search list, which the since.py extension inadvertently did.
>> > So,
>> > when evaluating the tag $trend, the custom, not properly initialized,
>> > version of TimeBinder is hit first, and the built-in version is never
>> seen.
>> > This re-ordering should have been mentioned in the Upgrade Guide.
>> >
>> > There are two ways to fix:
>> >
>> > 1. Properly initialize the instance of TimeBinder in since.py.
>> > 2. Change the logic of since.py. Frankly, I don't know why it returns a
>> > TimeBinder at all. It's way more complicated than it needs to be, and
>> > has
>> > the side effect that it's basically overriding all of the tags,
>> > including
>> > such mundane tags as $day, $week, etc. It gets away with this because
>> > its
>> > semantics are identical for these other tags.
>> >
>> > If you want a quick fix, do option #1. Here's the delta
>> >
>> >
>> > --- since.py 2022-02-06 04:59:19.0 -0800
>> > ***
>> > *** 160,169 
>> >
>> > formatter=self.formatter,
>> >
>> > converter=self.converter)
>> >
>> > tspan_binder = NewBinder(db_lookup,
>> > ! timespan.stop,
>> > ! self.generator.formatter,
>> > ! self.generator.converter)
>> >
>> > t2 = time.time()
>> > logdbg2("Since SLE executed in %0.3f seconds" % (t2-t1))
>> > --- 160,176 
>> >
>> > formatter=self.formatter,
>> >
>> > converter=self.converter)
>> >
>> > + try:
>> > + trend_dict = self.generator.skin_dict['Units']['Trend']
>> > + except KeyError:
>> > + trend_dict = {'time_delta': 10800,
>> > + 'time_grace': 300}
>> > +
>> > tspan_binder = NewBinder(db_lookup,
>> > ! timespan.stop,
>> > ! self.generator.formatter,
>> > ! self.generator.converter,
>> > ! trend=trend_dict)
>> >
>> > t2 = time.time()
>> > logdbg2("Since SLE executed in %0.3f seconds" % (t2-t1))
>> >
>> > But, really, since.py should be fixed so that it doesn't override
>> > default
>> > behavior.
>> >
>> > -tk
>> >
>> >
>> >
>> > On Sat, Feb 5, 2022 at 10:21 PM Glenn McKechnie 
>> > wrote:
>> >
>> >> Just a heads up to anyone out there that uses since.py (used to shift
>> >> the rain window)
>> >> and has upgraded to weewx.4.6.0
>> >>
>> >> I went through the process (I needed the new lang option) and for the
>> >> life of me couldn't work out why it kept falling over when generating
>> >> various skins.
>> >>
>> >> Switching to a plain skin and adding my cruft back in and lo and
>> >> behold it falls over when since.py is slotted back into skin.conf
>> >>
>> &

Re: [weewx-user] Current Weather Conditions Weather Graphic

2022-09-30 Thread Glenn McKechnie
On 30/09/2022, an oldman  wrote:
> it's from saratoga-weather.org Legacy Weather PHP scripts Anole's
> wxgraphic.php script version 6.3
> the only way i found to get past that utf-8 for ° was to move it to the php
> file

Yeah. I'll give it another go but it's fallen down the list somewhat :-)

> also i used the clientraw.txt file
> yes the $station.location was to long for type=avatar, but then i like the
> banners better

Yep, banners for the win!

Can you send me a clientraw.txt file.  It appears you aren't using the
icons but I can see if my changes will still work, and also make
better sense of what the code is referencing.

Thanks In Advance.

-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzgwBLGzH1FO6eftnBJ1-Lc1S-TrbEEDpnsPZ94HaOJ2pg%40mail.gmail.com.


Re: [weewx-user] Current Weather Conditions Weather Graphic

2022-09-30 Thread Glenn McKechnie
On 30/09/2022, an oldman <> wrote:
> i ran the config.txt through cheetah as config.txt.tmpl
>
> #raw
> ..
> #end raw
> $barom_units = "$unit.label.pressure";
> $rain_units = "$unit.label.rain";
> $degree_units_type = "$unit_system";
> $wind_units = "$unit.label.wind";
> #raw
> #raw
>
> in wxgraphic.php added

wxgraphic.php ?

That's an early version. If it's from this repo then you're an early
adopter - no medal, but definitely a 'nod and a tip of the hat' to
you.

If it's not then you're an even earlier adopter ! ;-)

> if ($degree_units_type === 'us' || $degree_units_type === 'US') {
> $degree_units = ' °F';
> } else {
> $degree_units = ' °C';
> }
>


That's a neat way of doing it . I'm pulling them from the
weewx-wxgraphic.txt file but having trouble with the utf-8 for °


> #end raw
> imagecenteredtext(90, 12, "$station.location", 3, 10, $color2, 0);
> #raw

I was avoiding that one as there is a possibility that the string is
too long for the graphic (mine is).
Entering it as an option is a chance to reword it to suit the space.
It could / should  be offered as the default value, then overwritten
if desired.




-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzhF-2o_hpGsgAxUqYXuecWNDPxrYGZURHsKritmyJrq7g%40mail.gmail.com.


Re: [weewx-user] Current Weather Conditions Weather Graphic

2022-09-30 Thread Glenn McKechnie
On 30/09/2022, hesf...@gmail.com  wrote:
> Hallo,
>
> in germany the wxgraphic_weewx.txt.tmpl =
> 11:50:00,29.09.2022,13,3,12,8,13,3,80,0,9,9,999,0,langsam steigend,11,3,
> SSW,19,3, 0, 0, ,07:12:09,18:56:45
> the error is ',' notation

Well. That is interesting. I wonder how others have dealt with the
decimal separator being a comma - especially in csv files. I assume
that is what's causing the issue?

The simplest solution would seem be to offer a choice early in the
process about the delimiter , but has that always been required?
I had a quick look in the weewx csv file generator but nothing leapt
out there. I need to look harder, or get hit hard with a clue stick.


> i have it in wxgraphic.txt.temp and index.php (line 278) from ',' to ";"
> changed.
>
> now it works

Nice image ;-) That was the farm before the grass fire - we lost 36 of
those magnificent trees - not that you notice in a distance shot. Up
close we miss them - so do the cockatoos.

Great that it is working for you too.


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzhhSFVM5wqeZKMing%3D-ZRQ6gyTTmjVAoEraNJJSnjE0ew%40mail.gmail.com.


Re: [weewx-user] Current Weather Conditions Weather Graphic

2022-09-30 Thread Glenn McKechnie
Okay.

Pushed a fix for that issue - and hopefully that was the issue!

It retains the ability to display the current condition icons, if they
are available, while ignoring the null field that is currently being
sent.

If that all works without issue, or all remains quiet, I'll roll that
up as release v0.6.4

v0.6.5 is patiently waiting in the queue. It offers the ability to
pick up the units (barom, temp, wind, rain) directly from weewx rather
than entering them by hand into skin.conf.
ie;- the WeeWX way :-)


On 30/09/2022, Glenn McKechnie  wrote:
> That does help. Most definitely!
>
> I get a similar error message but it still generates the image,
> regardless of curr_cond_icon setting
>
> What is different is that mine is a Warning, yours is Fatal so it
> likely comes down to how strict php is set - in it's ini file
>
> PHP Notice:  Undefined index:  in
> /tmp/var/www/html/weewx/wxgraphic/index.php on line 480
> PHP Warning:  imagecreatefrompng(): Filename cannot be empty in
> /tmp/var/www/html/weewx/wxgraphic/index.php
> on line 480
>
> I've had a look at that problem spot before,  line 480 - looks like
> I'm running with a few extra lines?? - but i couldn't see anything
> obvious, and as it was running okay so I left it for later. Mea culpa.
>
> Looks like 'later' has now arrived!
>
> Your wxgraphic_weewx.txt output appears similar. I don't have AM in my
> timestamp as I'm running 24hr time. Looks like the script compensates
> for it.
>
> So Yes. It could well come down to my /etc/php/7.0/apache2/php.ini
> settings masking it.
>
> error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
> display_startup_errors = Off
> log_errors = On
>
> But that aside, now has become later. I need to investigate and fix it.
>
> In the meantime I'll edit the repo and turn that off, with a note.
>
> Thanks for the heads up.
>
>
>
>
>
> On 30/09/2022, an oldman  wrote:
>> see if this helps
>> PHP Version: 8.1.10
>> weewx 4.8.0 using weewx-sdr driver
>>
>> wxgraphic_weewx.txt has 08:55:00
>> AM,09/29/2022,48.8,45.0,45.0,73.8,40.8,30.1,Steady,3.1,ESE,0.0,4.0,,07:40:44,19:27:56
>> skin.conf curr_cond_icon = 'yes'
>> php log
>> [30-Sep-2022 07:11:21 UTC] PHP Warning:  Undefined array key "" in
>> /var/www/html/weewx/wxgraphic/index.php on line 473
>> [30-Sep-2022 07:11:21 UTC] PHP Fatal error:  Uncaught ValueError: Path
>> cannot be empty in /var/www/html/weewx/wxgraphic/index.php:473
>> Stack trace:
>> #0 /var/www/html/weewx/wxgraphic/index.php(473): imagecreatefrompng()
>> #1 {main}
>>   thrown in /var/www/html/weewx/wxgraphic/index.php on line 473
>>
>> now if i change skin.conf curr_cond_icon = 'no' all works
>>
>> hope this helps
>> On Friday, September 30, 2022 at 1:40:22 AM UTC-5 Glenn McKechnie wrote:
>>
>>> A road trip! Bonus points.
>>>
>>> I've added a troubleshooting section to the README at
>>> https://github.com/glennmckechnie/weewx-WXgraphic
>>>
>>> Basically what was outlined in my last message but I've uploaded my
>>> working wxgraphic_weewx.txt and config.txt to the
>>> skins/WXgraphic/examples directory.
>>>
>>> I suspect wxgraphic_weewx.txt more than config.txt, but we shall see.
>>>
>>> My email address is in the header of skin.conf If you need to send
>>> any files send them there.
>>>
>>> --
>>>
>>>
>>> Cheers
>>> Glenn
>>>
>>> rorpi - read only raspberry pi & various weewx addons
>>> https://github.com/glennmckechnie
>>>
>>
>> --
>> 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/5d928a27-d9a1-4604-a934-aed14e368956n%40googlegroups.com.
>>
>
>
> --
>
>
> Cheers
>  Glenn
>
> rorpi - read only raspberry pi & various weewx addons
> https://github.com/glennmckechnie
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAziGTo3V7rjCcja%2Bg2MurNc-0iY1TtqZUVgKc%2B49HK5zkQ%40mail.gmail.com.


Re: [weewx-user] Current Weather Conditions Weather Graphic

2022-09-30 Thread Glenn McKechnie
That does help. Most definitely!

I get a similar error message but it still generates the image,
regardless of curr_cond_icon setting

What is different is that mine is a Warning, yours is Fatal so it
likely comes down to how strict php is set - in it's ini file

PHP Notice:  Undefined index:  in
/tmp/var/www/html/weewx/wxgraphic/index.php on line 480
PHP Warning:  imagecreatefrompng(): Filename cannot be empty in
/tmp/var/www/html/weewx/wxgraphic/index.php
on line 480

I've had a look at that problem spot before,  line 480 - looks like
I'm running with a few extra lines?? - but i couldn't see anything
obvious, and as it was running okay so I left it for later. Mea culpa.

Looks like 'later' has now arrived!

Your wxgraphic_weewx.txt output appears similar. I don't have AM in my
timestamp as I'm running 24hr time. Looks like the script compensates
for it.

So Yes. It could well come down to my /etc/php/7.0/apache2/php.ini
settings masking it.

error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
display_startup_errors = Off
log_errors = On

But that aside, now has become later. I need to investigate and fix it.

In the meantime I'll edit the repo and turn that off, with a note.

Thanks for the heads up.





On 30/09/2022, an oldman  wrote:
> see if this helps
> PHP Version: 8.1.10
> weewx 4.8.0 using weewx-sdr driver
>
> wxgraphic_weewx.txt has 08:55:00
> AM,09/29/2022,48.8,45.0,45.0,73.8,40.8,30.1,Steady,3.1,ESE,0.0,4.0,,07:40:44,19:27:56
> skin.conf curr_cond_icon = 'yes'
> php log
> [30-Sep-2022 07:11:21 UTC] PHP Warning:  Undefined array key "" in
> /var/www/html/weewx/wxgraphic/index.php on line 473
> [30-Sep-2022 07:11:21 UTC] PHP Fatal error:  Uncaught ValueError: Path
> cannot be empty in /var/www/html/weewx/wxgraphic/index.php:473
> Stack trace:
> #0 /var/www/html/weewx/wxgraphic/index.php(473): imagecreatefrompng()
> #1 {main}
>   thrown in /var/www/html/weewx/wxgraphic/index.php on line 473
>
> now if i change skin.conf curr_cond_icon = 'no' all works
>
> hope this helps
> On Friday, September 30, 2022 at 1:40:22 AM UTC-5 Glenn McKechnie wrote:
>
>> A road trip! Bonus points.
>>
>> I've added a troubleshooting section to the README at
>> https://github.com/glennmckechnie/weewx-WXgraphic
>>
>> Basically what was outlined in my last message but I've uploaded my
>> working wxgraphic_weewx.txt and config.txt to the
>> skins/WXgraphic/examples directory.
>>
>> I suspect wxgraphic_weewx.txt more than config.txt, but we shall see.
>>
>> My email address is in the header of skin.conf If you need to send
>> any files send them there.
>>
>> --
>>
>>
>> Cheers
>> Glenn
>>
>> rorpi - read only raspberry pi & various weewx addons
>> https://github.com/glennmckechnie
>>
>
> --
> 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/5d928a27-d9a1-4604-a934-aed14e368956n%40googlegroups.com.
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzjpZC101%2BGUSxS%2BAfj1beFnM64ANHeT7EuEYxHNXiHAvg%40mail.gmail.com.


Re: [weewx-user] Current Weather Conditions Weather Graphic

2022-09-30 Thread Glenn McKechnie
A road trip! Bonus points.

I've added a troubleshooting section to the README at
https://github.com/glennmckechnie/weewx-WXgraphic

Basically what was outlined in my last message but I've uploaded my
working wxgraphic_weewx.txt  and config.txt to the
skins/WXgraphic/examples directory.

I suspect wxgraphic_weewx.txt more than config.txt, but we shall see.

My email address is in the header of skin.conf  If you need to send
any files send them there.

-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzjdWMfzyuN5yKwrrA6Yzije_kc8eh-_ZcmiZedsPTxcoA%40mail.gmail.com.


Re: [weewx-user] Current Weather Conditions Weather Graphic

2022-09-29 Thread Glenn McKechnie
Hmmm.

A browser request to the wxgraphics directory should get a response.

Mine can be called using the following URL in a browser. (working example)

http://203.213.243.61/weewx/wxgraphic/

which is a short hand way of calling

http://203.213.243.61/weewx/wxgraphic/index.php

either one should work if everything is configured / working correctly.

My web server is already set up for php so I'm not sure if I'm missing
something else. I'd expect the server to work for index.php if the
PHP_verify.php page works, and I'd imagine that Steeple Ians
configuration would be fully php enabled - weather34 if I'm correct?
so...

Just downloaded from the repo and I can confirm that it still works
(for me). I didn't bugger anything up there.

We'll look at everything on your webserver.

Should be 20 files and 3 directories under /html/weewx/wxgraphic

In there are 2 files that we are most concerned with.
config.txt,  because we change its values.

then under /html/weewx/wxgraphic/DATA there should be 2 files with the
other important one being wxgraphic_weewx.txt

For example, my wxgraphic_weewx.txt contains...

07:39:00,30/09/22,11.4,8.3,8.3,70.3,6.1,1027.2,Rising
Slowly,11.0,SSE,0.0,13.9,,06:01:57,18:27:40

That's 16 columns, one of which is blank - ,,

If you send me your config.txt and wxgraphic_weewx.txt I should be
able to plug them into my setup and see if they work here. I assume
there have been no edits to skin.conf so I'll ignore that for the
moment.

The html error.log (perhaps /var/log/apache2/error.log ) should have
no additional entries with a default installation, and with
curr_cond_icon = 'no' reset in skin.conf

You can send them to the list or direct to my gmail email address that
should be in the email header.

I'll upload a working wxgraphic_weewx.txt to the repo too. If you have
doubts on yours then fetch that and try it (in the brief window before
it gets overwritten by yours.)

On 30/09/2022, 'Steeple Ian' via weewx-user  wrote:
> Yes, having the same issue here. PHP 8.1.9 enabled with GD, index.php
> generated but 0bytes, just a blank rectangle. No obvious clue in the error
> log.
> Ian
>
> On Thursday, September 29, 2022 at 2:01:40 PM UTC+2 scott.d...@gmail.com
> wrote:
>
>> First, THANK YOU! This is awesome.  I cannot tell you how much I
>> appreciate this.
>> I am having some trouble generating the graphics though.
>>
>> Installed the weewx extension.  Files exist in /etc/weewx/skins and are
>> generating in /html/weewx/wxgraphic  however I cannot get any weather
>> stickers/banners
>> PHP_verify.php is all okay with GD enabled.
>> *What might I do to get the graphics generated?*
>> Scott
>>
>> On Wednesday, September 28, 2022 at 8:59:49 PM UTC-4 Glenn McKechnie
>> wrote:
>>
>>> A couple of wet days have resulted in a working, WeeWX installable,
>>> version of that wxgraphics package (Weather Graphic) I mentioned
>>> previously.
>>>
>>> https://github.com/glennmckechnie/weewx-WXgraphic
>>>
>>> The original wxgraphic_6.3 is available as a release, but it isn't fully
>>>
>>> integrated with wee_extension.
>>> The better and latest version (v0.6.4) is available for download as
>>> main.
>>>
>>> (added to the weewx/wiki as under Services :  WXgraphic - Weather
>>> Graphic: A php driven generator to create a weather graphic image via
>>> your
>>> web server)
>>>
>>>
>>>
>>>
>>>
>>> On Monday, 26 September 2022 at 4:30:38 pm UTC+10 Glenn McKechnie wrote:
>>>
>>>> On 24/09/2022, Scott Danville <> wrote:
>>>> > Can WeeWx generate a constantly updated .png graphic to be used on a
>>>> > weather site such as the one shown hear?
>>>> > If it does not, can this feature be added?
>>>>
>>>> That looks similar to the ouput of wxgraphic. A php script that
>>>> generates a png file from clientraw.txt. It returns a png file upon a
>>>> server request to wxgraphic.php. You obviously still need a web facing
>>>> server that can hadle php files, and that's not located in the Czech
>>>> Republic.!
>>>>
>>>> https://saratoga-weather.org/wxtemplates/plugins.php
>>>> https://saratoga-weather.org/legacy-scripts/wxgraphic_6.3.zip
>>>>
>>>> The files origins are available via the web archive.
>>>>
>>>> https://web.archive.org/web/20130105094954/http://scripts.anolecomputer.com/wxgraphic/
>>>>
>>>>
>>>>
>>>> Back in 2018 I was playing around with it and got it working with a
>>>> WL_stickertags file which provides suitable data via

Re: [weewx-user] Current Weather Conditions Weather Graphic

2022-09-28 Thread Glenn McKechnie
A couple of wet days have resulted in a working, WeeWX installable, version 
of that wxgraphics package (Weather Graphic) I mentioned previously.

https://github.com/glennmckechnie/weewx-WXgraphic

The original wxgraphic_6.3 is available as a release, but it isn't fully 
integrated with wee_extension. 
The better and latest version (v0.6.4) is available for download as main.

(added to the weewx/wiki as under Services :  WXgraphic - Weather Graphic: 
A php driven generator to create a weather graphic image via your web 
server)





On Monday, 26 September 2022 at 4:30:38 pm UTC+10 Glenn McKechnie wrote:

> On 24/09/2022, Scott Danville <> wrote: 
> > Can WeeWx generate a constantly updated .png graphic to be used on a 
> > weather site such as the one shown hear? 
> > If it does not, can this feature be added? 
>
> That looks similar to the ouput of wxgraphic. A php script that 
> generates a png file from clientraw.txt. It returns a png file upon a 
> server request to wxgraphic.php. You obviously still need a web facing 
> server that can hadle php files, and that's not located in the Czech 
> Republic.! 
>
> https://saratoga-weather.org/wxtemplates/plugins.php 
> https://saratoga-weather.org/legacy-scripts/wxgraphic_6.3.zip 
>
> The files origins are available via the web archive. 
>
> https://web.archive.org/web/20130105094954/http://scripts.anolecomputer.com/wxgraphic/
>  
>
>
> Back in 2018 I was playing around with it and got it working with a 
> WL_stickertags file which provides suitable data via a cheetah 
> template, for an australian site. 
>
> https://www.australiawx.net/instructions.php 
>
> I co-opted that templates output but somethings changed in the 
> intervening years ... ie:- it needs tweaking to work again. 
>
> Interested? If so I'll spend some time on it, it's currently raining so... 
>
> -- 
>
>
> Cheers 
> Glenn 
>
> rorpi - read only raspberry pi & various weewx addons 
> https://github.com/glennmckechnie 
>

-- 
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/f8a1777c-fb4b-4601-894f-f2dff92aa34an%40googlegroups.com.


Re: [weewx-user] Current Weather Conditions Weather Graphic

2022-09-26 Thread Glenn McKechnie
On 24/09/2022, Scott Danville  wrote:
> Can WeeWx generate a constantly updated .png graphic to be used on a
> weather site such as the one shown hear?
> If it does not, can this feature be added?

That looks similar to the ouput of wxgraphic. A php script that
generates a png file from clientraw.txt. It returns a png file upon a
server request to wxgraphic.php. You obviously still need a web facing
server that can hadle php files, and that's not located in the Czech
Republic.!

https://saratoga-weather.org/wxtemplates/plugins.php
https://saratoga-weather.org/legacy-scripts/wxgraphic_6.3.zip

The files origins are available via the  web archive.
https://web.archive.org/web/20130105094954/http://scripts.anolecomputer.com/wxgraphic/


Back in 2018 I was playing around with it and got it working with a
WL_stickertags file which provides suitable data via a cheetah
template, for an australian site.

https://www.australiawx.net/instructions.php

I co-opted that templates output but somethings changed in the
intervening years ... ie:-  it needs tweaking to work again.

Interested? If so I'll spend some time on it, it's currently raining so...

-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzhBVph6%3DJ6Ypm_W-W6X2Ed8xdPUJiYCu1aEjhX1i7cn3g%40mail.gmail.com.


Re: [weewx-user] Station registry error (weewx 4.8.0)

2022-09-21 Thread Glenn McKechnie
You are missing the http:// from the start of your url.
It should be ...
station_url = http://www.nthead.co.uk/weewx

I just tried dropping the http:// on mine and sure enough, same error...

ERROR weewx.restx: StationRegistry: Failed to publish record
2022-09-21 20:03:00 AEST (1663754580): Failed upload after 3 tries



On 21/09/2022, Devonian  wrote:
> Hi Tom,
>
> I have in weewx.conf...
> station_url = www.nthead.co.uk/weewx
>
> Bizarely, checking the logs again this morning, I don't see the error, the
> last error was around 01:20 UK local time.
> I hadn't touched anything as was out all last night and sound asleep when
> the last error was logged.
> It is a completely 'vanilla' install of weewx and only a couple of lines
> tweaked in weewx.conf to suit my reporting.
>
> I have just restarted the weewx service and the error is occuring again
> (10:30hrs UK local time) - what goes on here?
>
> Nigel
>
> On Tuesday, 20 September 2022 at 20:15:06 UTC+1 tke...@gmail.com wrote:
>
>> What did you use as a key for your station? That is, what is
>> option "station_url"? I'll check if everything is OK on my end.
>>
>> On Tue, Sep 20, 2022 at 10:22 AM Devonian  wrote:
>>
>>> I've just made a fresh install on Ubuntu jammy and copied my sqlite db
>>> across to the 'clean' weewx 4.8.0 install (setup.py).
>>> I have set the register_this_station to true in weewx.conf.
>>> I now see this on every 5 minute record update in the log...
>>>
>>> ERROR weewx.restx: StationRegistry: Failed to publish record 2022-09-20
>>> ... BST (1663693800): Failed upload after 3 tries
>>>
>>> The date/time is obviously different for each new record.
>>>
>>> If I set register-this-station to false, the error goes away..
>>>
>>> Why is weewx attempting to publish a record to the station registry
>>> website?
>>> Possible bug?
>>>
>>> Nigel
>>>
>>> --
>>> 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/6b9c7a1a-3c65-4db0-a556-2412b03f9c94n%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/2cad3095-0fd8-48f5-9e19-a9d422c7d5afn%40googlegroups.com.
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAziycuCQs_hy84UkVL9xAvMeZYf1xZ5rQg37ajT6k4pK-Q%40mail.gmail.com.


Re: [weewx-user] Re: Unable to publish to previmeteo

2022-07-01 Thread Glenn McKechnie
also, there technically should be an equals sign in that command.

wee_extension --help

with that it becomes...

sudo wee_extension --install=weewx-previmeteo-v0.1.tar.gz

It's never made a difference for me, perhaps your installation requires it?



On 01/07/2022, Glenn McKechnie  wrote:
> make that at the 'weewx-p'. The last character you type.
>
> On 01/07/2022, Glenn McKechnie  wrote:
>> On 01/07/2022, Kruse Ludington  wrote:
>>> When I do a simple "ls" command, the file is right there!
>>
>> Okay.
>> type in the first part of your command...
>>
>> sudo wee_extension --install weewx-p
>>
>> At that 'w' press the tab key once and the rest of the filename should
>> auto complete ... be filled in. If it does that then the command line,
>> recognizes that file is there (assuming you don't get a choice of
>> files, in which case select the correct one.)
>>
>> If that does complete okay and it still doesn't install then it may
>> pay to check the actual file... Is it a gzip archive?
>>
>> In the terminal, use the command 'file'.
>> What does it return?
>>
>> 10:56 PM $ file weewx-previmeteo-v0.1.tar.gz
>> weewx-previmeteo-v0.1.tar.gz: gzip compressed data, from Unix,
>> original size modulo 2^32 10240
>>
>> If it's anything other than above - html? then it's a corrupted file.
>> Download it again.
>>
>> --
>>
>>
>> Cheers
>>  Glenn
>>
>> rorpi - read only raspberry pi & various weewx addons
>> https://github.com/glennmckechnie
>>
>
>
> --
>
>
> Cheers
>  Glenn
>
> rorpi - read only raspberry pi & various weewx addons
> https://github.com/glennmckechnie
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzhb45_u5AxXRLYUg2%3DrXFR5Hv2xhdYzY1CeSYb1sVV84g%40mail.gmail.com.


Re: [weewx-user] Re: Unable to publish to previmeteo

2022-07-01 Thread Glenn McKechnie
make that at the 'weewx-p'. The last character you type.

On 01/07/2022, Glenn McKechnie  wrote:
> On 01/07/2022, Kruse Ludington  wrote:
>> When I do a simple "ls" command, the file is right there!
>
> Okay.
> type in the first part of your command...
>
> sudo wee_extension --install weewx-p
>
> At that 'w' press the tab key once and the rest of the filename should
> auto complete ... be filled in. If it does that then the command line,
> recognizes that file is there (assuming you don't get a choice of
> files, in which case select the correct one.)
>
> If that does complete okay and it still doesn't install then it may
> pay to check the actual file... Is it a gzip archive?
>
> In the terminal, use the command 'file'.
> What does it return?
>
> 10:56 PM $ file weewx-previmeteo-v0.1.tar.gz
> weewx-previmeteo-v0.1.tar.gz: gzip compressed data, from Unix,
> original size modulo 2^32 10240
>
> If it's anything other than above - html? then it's a corrupted file.
> Download it again.
>
> --
>
>
> Cheers
>  Glenn
>
> rorpi - read only raspberry pi & various weewx addons
> https://github.com/glennmckechnie
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzin%3DWg46ghinq4mLsHHPn2WV_WHrbg_EOrxBFR_gbhR_w%40mail.gmail.com.


Re: [weewx-user] Re: Unable to publish to previmeteo

2022-07-01 Thread Glenn McKechnie
On 01/07/2022, Kruse Ludington  wrote:
> When I do a simple "ls" command, the file is right there!

Okay.
type in the first part of your command...

sudo wee_extension --install weewx-p

At that 'w' press the tab key once and the rest of the filename should
auto complete ... be filled in. If it does that then the command line,
recognizes that file is there (assuming you don't get a choice of
files, in which case select the correct one.)

If that does complete okay and it still doesn't install then it may
pay to check the actual file... Is it a gzip archive?

In the terminal, use the command 'file'.
What does it return?

10:56 PM $ file weewx-previmeteo-v0.1.tar.gz
weewx-previmeteo-v0.1.tar.gz: gzip compressed data, from Unix,
original size modulo 2^32 10240

If it's anything other than above - html? then it's a corrupted file.
Download it again.

-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzgHTmVonVTyPzz%2BrDE%2BoH77452fQtTySbV_sp6iZf6bxg%40mail.gmail.com.


Re: [weewx-user] Re: Unable to publish to previmeteo

2022-06-30 Thread Glenn McKechnie
I've just run through those instructions here and it works for me.

What directory are you in, the one that you are running that command
from? Does it contain the file weewx-previmeteo-v0.1.tar.gz ?

wee_extension is running okay, it just complains about a read error
for the target file - "file could not be opened successfully". Meaning
it can't read (or find) the file that you've specified (which is your
current directory).

Give the full path to that file... eg:-
/where/it/was/stored/weewx-previmeteo-v0.1.tar.gz

There is an odd chance that the downloaded file is corrupt, but my
first instinct is that it literally can't find the file with the
instruction you gave it.

On 01/07/2022, rkluding...@gmail.com  wrote:
> Well here are the two attempts…. All the other extensions worked fine for me
> (I did have to use sudo for those as well) but they were all zip files. As
> this one is a ‘tar.gz’ am I missing the utility for doing so on my rpi
> maybe? – or I was searching around and is it possible someone tried to
> compress it twice?
>
>
>
> pi@kruse-pi:~ $ sudo wee_extension --install weewx-previmeteo-v0.1.tar.gz
>
> Request to install 'weewx-previmeteo-v0.1.tar.gz'
>
> Extracting from tar archive weewx-previmeteo-v0.1.tar.gz
>
> Traceback (most recent call last):
>
>   File "/usr/share/weewx/wee_extension", line 92, in 
>
> main()
>
>   File "/usr/share/weewx/wee_extension", line 84, in main
>
> ext.install_extension(options.install)
>
>   File "/usr/share/weewx/weecfg/extension.py", line 122, in
> install_extension
>
> member_names = weecfg.extract_tar(extension_path,
>
>   File "/usr/share/weewx/weecfg/__init__.py", line 1805, in extract_tar
>
> tar_archive = tarfile.open(filename, mode='r')
>
>   File "/usr/lib/python3.9/tarfile.py", line 1616, in open
>
> raise ReadError("file could not be opened successfully")
>
> tarfile.ReadError: file could not be opened successfully
>
>
>
> pi@kruse-pi:~ $ sudo /home/weewx/bin/wee_extension --install
> weewx-previmeteo-v0.1.tar.gz
>
> sudo: /home/weewx/bin/wee_extension: command not found
>
>
>
> -Kruse
>
> (M):   +1.201.925.4410
>
> (O):   +1.862.308.7040
>
> (H):   +1.201.857.8307
>
> (F):   +1.201.857.7188
>
>
>
> From: rkluding...@gmail.com 
> Sent: Thursday, June 30, 2022 10:35 PM
> To: 'weewx-user@googlegroups.com' 
> Subject: RE: [weewx-user] Re: Unable to publish to previmeteo
>
>
>
> I’ll give them both a shot - thanks
>
>
>
> -Kruse
>
> (M):   +1.201.925.4410
>
> (O):   +1.862.308.7040
>
> (H):   +1.201.857.8307
>
> (F):   +1.201.857.7188
>
>
>
> From: weewx-user@googlegroups.com 
> mailto:weewx-user@googlegroups.com> > On
> Behalf Of vince
> Sent: Thursday, June 30, 2022 10:20 PM
> To: weewx-user   >
> Subject: [weewx-user] Re: Unable to publish to previmeteo
>
>
>
> If you did a package install of weewx, try "sudo wee_extension --install
> weewx-previmeteo-v0.1.tar.gz", assuming you are in the same working
> directory as the .tar.gz file
>
>
>
> If you did a setup.py install of weewx, it would be "sudo
> /home/weewx/bin/wee_extension --install weewx-previmeteo-v0.1.tar.gz"
>
>
>
> On Thursday, June 30, 2022 at 7:00:50 PM UTC-7 rklud...@gmail.com
>   wrote:
>
>  Regarding this:
>
> https://github.com/previmeteo/weewx-previmeteo#readme
>
> Running this:
>
> setup.py install --extension weewx-previmeteo-v0.1.tar.gz
>
> ends up giving me this error:
>
> bash: setup.py: command not found
>
> So I also tried….
>
> python3 setup.py install --extension weewx-previmeteo-v0.1.tar.gz
>
> which gives me a similar error about not being able to fins setup.py
>
> FYI, there are about a gazillion “setup.py” files all over my machine – all
> different sizes - but none in any weewx directory I can find –
>
> Thoughts? Anyone publishing to previmeteo?
>
> --
> 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/WN4vQOyNFrQ/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/76727a09-c125-4f57-bd4a-26df9cb66df4n%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/001801d88cf5%24464a72f0%24d2df58d0%24%40gmail.com.
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & 

Re: [weewx-user] Determine archive interval from within weewx

2022-06-09 Thread Glenn McKechnie
On 10/06/2022, 'Peter Fletcher' via weewx-user
 wrote:
> I know what my current archive interval is (Davis's default of 5 minutes)
> and I don't have any plans to change it, but, in writing user
> services/extensions, which others may conceivably use in the future, I
> don't like to hard-code a value which may be different in a different
> setup. I am sure that the current value of the parameter is accessible to
> code running 'within' weewx (but not within an archive record handler), but
>
> I couldn't find how to access it.

If you are using StdService then config_dict is available.

In UradMon I've used that to fetch the default value along the lines of

sf_int = to_int(config_dict['StdArchive'].get('archive_interval', 300))

Full code from line 292. Adjust to fit.

(Hopefully the following link can be recreated if it gets mangled)

https://github.com/glennmckechnie/weewx-uradmon/blob/73fc63371944d3b5480c1cca0e9fa35feb68c649/bin/user/uradmon.py#L292


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzjkt63QnVF%3D-5cu6z_bS%2BKP03P74LpKwLGAXdK6X8gmoQ%40mail.gmail.com.


Re: [weewx-user] Re: Storing Text as a record, wee_import and mysql UPDATE

2022-03-05 Thread Glenn McKechnie
Gary, That one works a treat.

On 05/03/2022, gjr80 wrote:
> Apologies Glenn, try this version. I'm in between moving from linux to Mac
> on my desktop and my test environment is not quite complete so that last
> version had some cursory testing only.

Not a problem.
And thanks for your time getting it sorted.


-- 

Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzjThU64OTbyUMb9E1iA80ZCddXm8H0WGqcymfaYe87H4g%40mail.gmail.com.


Re: [weewx-user] Re: Storing Text as a record, wee_import and mysql UPDATE

2022-03-04 Thread Glenn McKechnie
Gary, closer but...

 could not convert string to float: test of wee_import text updates

= full terminal output...

12:19 PM $ sudo bin/wee_import --import-config=/home/weewx/csv.conf
--config=/home/weewx/weewx.conf --verbose
Using WeeWX configuration file /home/weewx/weewx.conf
Starting wee_import...
A CSV import from source file '/var/tmp/weewxaddnotes.csv' has been requested.
The following options will be used:
 config=/home/weewx/weewx.conf, import-config=/home/weewx/csv.conf
 source=/var/tmp/weewxaddnotes.csv, from=None, to=None
 dry-run=None, calc_missing=True, ignore_invalid_data=True
 tranche=250, interval=conf, date/time_string_format=%Y-%m-%d %H:%M:%S
 delimiter=',', rain=cumulative, wind_direction=[-360.0, 360.0]
 UV=False, radiation=False
Using database binding 'wx_binding', which is bound to database 'weewx.sdb'
Destination table 'archive' unit system is '0x10' (METRIC).
Missing derived observations will be calculated.
All WeeWX UV fields will be set to None.
All WeeWX radiation fields will be set to None.
Starting import ...
Obtaining raw import data for period 1 ...
The following imported field-to-WeeWX field map will be used:
 source field 'ANComment' as text --> WeeWX field 'ANComment'
 source field 'timestamp' in units 'unix_epoch' --> WeeWX field 'dateTime'
 source field 'extratemp2' in units 'degree_C' --> WeeWX field 'extraTemp2'
 source field 'extratemp1' in units 'degree_C' --> WeeWX field 'extraTemp1'
Raw import data read successfully for period 1.
Mapping raw import data for period 1 ...
Mapped 1 records.
Raw import data mapped successfully for period 1.
Saving mapped data to archive for period 1 ...
1 records identified for import.
Proceeding will save all imported records in the WeeWX archive.
Are you sure you want to proceed (y/n)? y
 could not convert string to float: test of wee_import text updates
 Nothing done, exiting.

== source file '/var/tmp/weewxaddnotes.csv' contents...

timestamp,extratemp1,extratemp2,ANComment
1645966620,11.0,11.5,test of wee_import text updates



On 05/03/2022, gjr80  wrote:
> Glenn, could you try the attached weeimport.py, it should support text
> imports and be compatible with v4.5.1.
>
> Gary
>
> On Friday, 4 March 2022 at 14:51:33 UTC+10 gjr80 wrote:
>
>> Ah, didn't notice you were on 4.5.1. There was a change to units.py under
>>
>> 4.6.x that forced a change in weeimport.py, consequently the weeimport.py
>>
>> version I provided does not get on with WeeWX 4.5.x. Let me get you a
>> 4.5.x
>> compatible version.
>>
>> Gary
>>
>> On Friday, 4 March 2022 at 13:16:57 UTC+10 Glenn McKechnie wrote:
>>
>>> On 04/03/2022, gjr80  wrote:
>>> > Glenn,
>>> >
>>> > Have you had a chance to try the revised wee_import? I am working on a
>>> > number of other changes to the same piece of wee_import code and I
>>> > would
>>> > prefer to do them all at once if possible.
>>>
>>> Whoops. Sorry about that. It slid down the Todo list a little too
>>> far. ie;- I got somewhat sidetracked.
>>>
>>> Re-visiting this and I find I've either forgotten something critical,
>>> or it just plain doesn't work...
>>>
>>> I'm stll using the weewx.451 installation where I was developing this.
>>> I've fetched and replaced weeimport/weeimport.py as per your
>>> instructions.
>>>
>>> sudo bin/wee_import --import-config=/home/weewx/csv.conf
>>> --config=/home/weewx/weewx.conf --verbose --dry-run
>>>
>>> and I get the following error (with dry-run and without) ...
>>>
>>> Using WeeWX configuration file /home/weewx/weewx.conf
>>> Starting wee_import...
>>> A CSV import from source file '/var/tmp/weewxaddnotes.csv' has been
>>> requested.
>>> The following options will be used:
>>> config=/home/weewx/weewx.conf, import-config=/home/weewx/csv.conf
>>> source=/var/tmp/weewxaddnotes.csv, from=None, to=None
>>> dry-run=True, calc_missing=True, ignore_invalid_data=True
>>> tranche=250, interval=conf, date/time_string_format=%Y-%m-%d %H:%M:%S
>>> delimiter=',', rain=cumulative, wind_direction=[-360.0, 360.0]
>>> UV=False, radiation=False
>>> Using database binding 'wx_binding', which is bound to database
>>> 'weewx.sdb'
>>> Destination table 'archive' unit system is '0x10' (METRIC).
>>> Missing derived observations will be calculated.
>>> All WeeWX UV fields will be set to None.
>>> All WeeWX radiation fields will be set to None.
>>> This is a dry run, imported data will not be saved to archive.
>>> Starting dry run import ...
>&

Re: [weewx-user] Re: Storing Text as a record, wee_import and mysql UPDATE

2022-03-03 Thread Glenn McKechnie
On 04/03/2022, gjr80  wrote:
> Glenn,
>
> Have you had a chance to try the revised wee_import? I am working on a
> number of other changes to the same piece of wee_import code and I would
> prefer to do them all at once if possible.

Whoops. Sorry about that.  It slid down the Todo list a little too
far. ie;- I got somewhat sidetracked.

Re-visiting this and I find I've either forgotten something critical,
or it just plain doesn't work...

I'm stll using the weewx.451 installation where I was developing this.
I've fetched and replaced weeimport/weeimport.py as per your instructions.

sudo bin/wee_import --import-config=/home/weewx/csv.conf
--config=/home/weewx/weewx.conf --verbose --dry-run

and I get the following error (with dry-run and without) ...

Using WeeWX configuration file /home/weewx/weewx.conf
Starting wee_import...
A CSV import from source file '/var/tmp/weewxaddnotes.csv' has been requested.
The following options will be used:
 config=/home/weewx/weewx.conf, import-config=/home/weewx/csv.conf
 source=/var/tmp/weewxaddnotes.csv, from=None, to=None
 dry-run=True, calc_missing=True, ignore_invalid_data=True
 tranche=250, interval=conf, date/time_string_format=%Y-%m-%d %H:%M:%S
 delimiter=',', rain=cumulative, wind_direction=[-360.0, 360.0]
 UV=False, radiation=False
Using database binding 'wx_binding', which is bound to database 'weewx.sdb'
Destination table 'archive' unit system is '0x10' (METRIC).
Missing derived observations will be calculated.
All WeeWX UV fields will be set to None.
All WeeWX radiation fields will be set to None.
This is a dry run, imported data will not be saved to archive.
Starting dry run import ...
Obtaining raw import data for period 1 ...
Traceback (most recent call last):
  File "bin/wee_import", line 899, in 
main()
  File "bin/wee_import", line 829, in main
source_obj.run()
  File "/home/weewx451/bin/weeimport/weeimport.py", line 372, in run
_raw_data = self.getRawData(period)
  File "/home/weewx451/bin/weeimport/csvimport.py", line 246, in getRawData
self.map = self.parseMap('CSV', _csv_reader, self.csv_config_dict)
  File "/home/weewx451/bin/weeimport/weeimport.py", line 635, in parseMap
and _val['units'] not in weewx.units.USUnits.values() \
AttributeError: 'ListOfDicts' object has no attribute 'values'


The database field is named ANComment, the field I'm importing is
named ANComment

The attached files will show the full details. weewx.conf is unedited,
it's a throw away installation.

And, I've just cloned the wee_import_text branch - gives the same error.

-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzj2c4S2ELHB8BrCLkR1poRLu_zCpg7K3pu8COOv76Bw-w%40mail.gmail.com.
sqlite> .headers on
sqlite> .schema archive
CREATE TABLE archive (`dateTime` INTEGER NOT NULL UNIQUE PRIMARY KEY, `usUnits` 
INTEGER NOT NULLnterval` INTEGER NOT NULL, `altimeter` REAL, `ANComment` TEXT, 
`appTemp` REAL, `appTemp1` REAL, ometer` REAL, `batteryStatus1` REAL, 
`batteryStatus2` REAL, `batteryStatus3` REAL, `batteryStatuREAL, 
`batteryStatus5` REAL, `batteryStatus6` REAL, `batteryStatus7` REAL, 
`batteryStatus8` REALloudbase` REAL, `co` REAL, `co2` REAL, 
`consBatteryVoltage` REAL, `dewpoint` REAL, `dewpoint1` R `ET` REAL, 
`extraHumid1` REAL, `extraHumid2` REAL, `extraHumid3` REAL, `extraHumid4` REAL, 
`extmid5` REAL, `extraHumid6` REAL, `extraHumid7` REAL, `extraHumid8` REAL, 
`extraTemp1` REAL, `extrp2` REAL, `extraTemp3` REAL, `extraTemp4` REAL, 
`extraTemp5` REAL, `extraTemp6` REAL, `extraTempEAL, `extraTemp8` REAL, 
`extraRain1` REAL, `extraRain2` REAL, `forecast` REAL, `hail` REAL, 
`haiteryStatus` REAL, `hailRate` REAL, `heatindex` REAL, `heatindex1` REAL, 
`heatingTemp` REAL, `heaVoltage` REAL, `humidex` REAL, `humidex1` REAL, 
`inDewpoint` REAL, `inHumidity` REAL, `inTemp` R `inTempBatteryStatus` REAL, 
`leafTemp1` REAL, `leafTemp2` REAL, `leafWet1` REAL, `leafWet2` 
REAlightning_distance` REAL, `lightning_disturber_count` REAL, 
`lightning_energy` REAL, `lightning_e_count` REAL, `lightning_strike_count` 
REAL, `luminosity` REAL, `maxSolarRad` REAL, `nh3` REAL,2` REAL, `noise` REAL, 
`o3` REAL, `outHumidity` REAL, `outTemp` REAL, `outTempBatteryStatus` REApb` 
REAL, `pm10_0` REAL, `pm1_0` REAL, `pm2_5` REAL, `pressure` REAL, `radiation` 
REAL, `rain` R `rainBatteryStatus` REAL, `rainRate` REAL, `referenceVoltage` 
REAL, `rxCheckPercent` REAL, `sig` REAL, `signal2` REAL, `signal3` REAL, 
`signal4` REAL, `signal5` REAL, `signal6` REAL, `signal7AL, `signal8` REAL, 
`snow` REAL, `snowBatteryStatus` REAL, `snowDepth` REAL, `snowMoisture` 
REALnowRate` REAL, 

[weewx-user] weewx 4.6.0: ppm missing from weewx/defaults.py

2022-02-07 Thread Glenn McKechnie
Had trouble getting ppm to display in the uRADMon extension.

In weewx/defaults.py I added it to the [[Groups]] but the real issue
was the missing entry under [[Labels]].

After the following changes it worked as expected.


--- defaults.py 2022-01-05 07:45:54.536777300 +1100
+++ defaults.py.460 2022-02-07 21:15:20.650396954 +1100
@@ -46,6 +46,7 @@
 group_distance = mile # Options are 'mile' or 'km'
 group_energy   = watt_hour
 group_energy2  = watt_second
+group_fraction = ppm
 group_length   = inch
 group_moisture = centibar
 group_percent  = percent
@@ -190,6 +191,7 @@
 mmHg  = " mmHg"
 mmHg_per_hour = " mmHg/h"
 percent   =   %
+ppm   = " ppm"
 second= " second", " seconds"
 volt  = " V"
 watt_per_meter_squared = " W/m²"

-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzj42639DX1cGzskz%3DxbyD2taNNhmkgs74Do8iEqV8TaLA%40mail.gmail.com.


Re: [weewx-user] weewx.4.6.0 : since.py : KeyError: 'trend'

2022-02-06 Thread Glenn McKechnie
Thanks Tom, for the explanation and the quick fix. It's applied and working.

I'll mull over your explanation, bits of it make sense - I'll need
more time for the rest ;-)

Thanks again.

On 07/02/2022, Tom Keffer  wrote:
> The problem here is a little technical, so bear with me.
>
> The way things work normally is that the default configuration for the
> Cheetah generator includes a TimeBinder in the search list. Because a
> TimeBinder includes an attribute 'trend', the tag $trend works.
>
> The problem is that the extension since.py also includes a TimeBinder, but
> one that has not been properly initialized. It needs a keyword argument
> "trend".
>
> Why did it work before, but not now? Because the order of evaluation of the
> search list changed. Before, it searched built-in objects first, then user
> extensions. V4.6 does it the other way around: it searches user extensions
> first, then the built-ins. This is to allow overriding the behavior of the
> built-in search list, which the since.py extension inadvertently did. So,
> when evaluating the tag $trend, the custom, not properly initialized,
> version of TimeBinder is hit first, and the built-in version is never seen.
> This re-ordering should have been mentioned in the Upgrade Guide.
>
> There are two ways to fix:
>
> 1. Properly initialize the instance of TimeBinder in since.py.
> 2. Change the logic of since.py. Frankly, I don't know why it returns a
> TimeBinder at all. It's way more complicated than it needs to be, and has
> the side effect that it's basically overriding all of the tags, including
> such mundane tags as $day, $week, etc. It gets away with this because its
> semantics are identical for these other tags.
>
> If you want a quick fix, do option #1. Here's the delta
>
>
> --- since.py 2022-02-06 04:59:19.0 -0800
> ***
> *** 160,169 
>
> formatter=self.formatter,
>
> converter=self.converter)
>
>   tspan_binder = NewBinder(db_lookup,
> ! timespan.stop,
> ! self.generator.formatter,
> ! self.generator.converter)
>
>   t2 = time.time()
>   logdbg2("Since SLE executed in %0.3f seconds" % (t2-t1))
> --- 160,176 
>
> formatter=self.formatter,
>
> converter=self.converter)
>
> + try:
> + trend_dict = self.generator.skin_dict['Units']['Trend']
> + except KeyError:
> + trend_dict = {'time_delta': 10800,
> +   'time_grace': 300}
> +
>   tspan_binder = NewBinder(db_lookup,
> !  timespan.stop,
> !  self.generator.formatter,
> !  self.generator.converter,
> !  trend=trend_dict)
>
>   t2 = time.time()
>   logdbg2("Since SLE executed in %0.3f seconds" % (t2-t1))
>
> But, really, since.py should be fixed so that it doesn't override default
> behavior.
>
> -tk
>
>
>
> On Sat, Feb 5, 2022 at 10:21 PM Glenn McKechnie 
> wrote:
>
>> Just a heads up to anyone out there that uses since.py (used to shift
>> the rain window)
>> and has upgraded to weewx.4.6.0
>>
>> I went through the process (I needed the new lang option) and for the
>> life of me couldn't work out why it kept falling over when generating
>> various skins.
>>
>> Switching to a plain skin and adding my cruft back in and lo and
>> behold it falls over when since.py is slotted back into skin.conf
>>
>> skin.conf
>> [CheetahGenerator]
>> search_list_extensions = user.since.Since
>>
>> What then happens is that whenever the trend option is called - such
>> as in Seasons/current.inc : $trend.barometer.formatted - it raises a
>> KeyError pointing at 'trend' as the culprit.
>>
>> Attached is the script since.py and a file with the errors generated
>> by cheetahgenerator, as found in syslog.
>>
>> It's way beyond my abilities to work out why it happens, but I'd be
>> curious to know if it's fixable. :-)
>>
>> I also hope finding it prevents anyone elses hair loss. :-)
>>
>> --
>>
>> Cheers
>>  Glenn
>>
>> rorpi - read only raspberry pi & various weewx addons
>> https://github.com/glennmckechnie
>>
>> --
>> 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+unsubs

[weewx-user] weewx.4.6.0 : since.py : KeyError: 'trend'

2022-02-05 Thread Glenn McKechnie
Just a heads up to anyone out there that uses since.py (used to shift
the rain window)
and has upgraded to weewx.4.6.0

I went through the process (I needed the new lang option) and for the
life of me couldn't work out why it kept falling over when generating
various skins.

Switching to a plain skin and adding my cruft back in and lo and
behold it falls over when since.py is slotted back into skin.conf

skin.conf
[CheetahGenerator]
search_list_extensions = user.since.Since

What then happens is that whenever the trend option is called - such
as in Seasons/current.inc : $trend.barometer.formatted - it raises a
KeyError pointing at 'trend' as the culprit.

Attached is the script since.py and a file with the errors generated
by cheetahgenerator, as found in syslog.

It's way beyond my abilities to work out why it happens, but I'd be
curious to know if it's fixable. :-)

I also hope finding it prevents anyone elses hair loss. :-)

-- 

Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzgTEeXkgVGFpcpnKdkcrnVwMtvyn5kJTGBe_Qin8WTnxA%40mail.gmail.com.
ERROR weewx.cheetahgenerator: Evaluation of template 
/home/weewx460/skins/Standard2/index.html.tmpl failed with exception ''
ERROR weewx.cheetahgenerator:  Ignoring template 
/home/weewx460/skins/Standard2/index.html.tmpl
ERROR weewx.cheetahgenerator:  Reason: 'trend'
ERROR weewx.cheetahgenerator:   Traceback (most recent call last):
ERROR weewx.cheetahgenerator: File 
"/home/weewx460/bin/weewx/cheetahgenerator.py", line 344, in generate
ERROR weewx.cheetahgenerator:   unicode_string = 
compiled_template.respond()
ERROR weewx.cheetahgenerator: File 
"_home_weewx460_skins_Standard2_index_html_tmpl.py", line 332, in respond
ERROR weewx.cheetahgenerator: File 
"/usr/local/lib/python3.7/dist-packages/Cheetah/Template.py", line 1708, in 
_handleCheetahInclude
ERROR weewx.cheetahgenerator:   
self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
ERROR weewx.cheetahgenerator: File 
"_home_weewx460_skins_Standard2_current_inc.py", line 464, in respond
ERROR weewx.cheetahgenerator: File 
"_home_weewx460_skins_Standard2_current_inc.py", line 197, in __errorCatcher19
ERROR weewx.cheetahgenerator: File "", line 1, in 
ERROR weewx.cheetahgenerator: File "/home/weewx460/bin/weewx/tags.py", 
line 63, in trend
ERROR weewx.cheetahgenerator:   time_delta = 
to_int(self.option_dict['trend'].get('time_delta', 10800))
ERROR weewx.cheetahgenerator:   KeyError: 'trend'
ERROR weewx.cheetahgenerator: Evaluation of template 
/home/weewx460/skins/Standard2/myshake/index.html.tmpl failed with exception 
''
ERROR weewx.cheetahgenerator:  Ignoring template 
/home/weewx460/skins/Standard2/myshake/index.html.tmpl
ERROR weewx.cheetahgenerator:  Reason: 'trend'
ERROR weewx.cheetahgenerator:   Traceback (most recent call last):
ERROR weewx.cheetahgenerator: File 
"/home/weewx460/bin/weewx/cheetahgenerator.py", line 344, in generate
ERROR weewx.cheetahgenerator:   unicode_string = 
compiled_template.respond()
ERROR weewx.cheetahgenerator: File 
"_home_weewx460_skins_Standard2_myshake_index_html_tmpl.py", line 128, in 
respond
ERROR weewx.cheetahgenerator: File 
"/usr/local/lib/python3.7/dist-packages/Cheetah/Template.py", line 1708, in 
_handleCheetahInclude
ERROR weewx.cheetahgenerator:   
self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
ERROR weewx.cheetahgenerator: File 
"_home_weewx460_skins_Standard2_current_inc.py", line 464, in respond
ERROR weewx.cheetahgenerator: File 
"_home_weewx460_skins_Standard2_current_inc.py", line 197, in __errorCatcher19
ERROR weewx.cheetahgenerator: File "", line 1, in 
ERROR weewx.cheetahgenerator: File "/home/weewx460/bin/weewx/tags.py", 
line 63, in trend
ERROR weewx.cheetahgenerator:   time_delta = 
to_int(self.option_dict['trend'].get('time_delta', 10800))
ERROR weewx.cheetahgenerator:   KeyError: 'trend'
ERROR weewx.cheetahgenerator: Evaluation of template 
/home/weewx460/skins/Standard2/DATA/WL_stickertags.txt.tmpl failed with 
exception ''
ERROR weewx.cheetahgenerator:  Ignoring template 
/home/weewx460/skins/Standard2/DATA/WL_stickertags.txt.tmpl
ERROR weewx.cheetahgenerator:  Reason: 'trend'
ERROR weewx.cheetahgenerator:   Traceback (most recent call last):
ERROR weewx.cheetahgenerator: File 
"/home/weewx460/bin/weewx/cheetahgenerator.py", line 344, in generate
ERROR weewx.cheetahgenerator:   unicode_string = 
compiled_template.respond()
ERROR 

Re: [weewx-user] Re: Storing Text as a record, wee_import and mysql UPDATE

2022-01-21 Thread Glenn McKechnie
Thanks Gary,

I'll give it a test drive as soon as I get a moment or three.

On a related note (ie:- related to using TEXT fields in the database)
I went and checked out wee_database and found that it baulked at the
TEXT field in the database.

Details are in the attached file, which should keep the formatting sane.

Let me know if you want it raised as a seperate issue and I'll do that instead.

On 22/01/2022, gjr80  wrote:
> Glenn,
>
> I have created a new branch wee_import_text off development for this and
> have modified the wee_import code to import text to a WeeWX TEXT field.
> There are a dew conditions:
>
> 1. text import only works with CSV imports
>
> 2. import source fields that are to be imported as text must use 'text' as
> the WeeWX units specifier in the field map in the import config file, eg:
> [[FieldMap]]
> 
> aComment = import_text_field, text
>
> 3. the destination text field has been added to the WeeWX database and
> WeeWX configured as per the Storing text in the database
> <https://github.com/weewx/weewx/wiki/Storing-text-in-the-database> wiki
> page
>
> I have only done basic testing of the code so there may be some corner
> cases I have not covered, but you should be right to give it a go if you
> want. As I said I have taken a branch off development, since there has been
>
> quite a few changes in development since the last release the most reliable
>
> option is for you to clone and install wee_import_text. However, the
> wee_import code does not change often so you could probably get away with
> running v4.5.1 and just downloading and installing the modified
> weeimport.py
> .
>
> To use the new wee_import:
>
> 1. Either clone and install from the wee_import_text branch or if using
> v4.5.1 (or any other recent version at your own peril) replace
> BIN/weeimport/weeimport.py with weeimport.py from the wee_import_text
> branch. You can download weeimport.py from the wee_import_text branch
> directly using wget as follows:
>
> $ wget
> https://raw.githubusercontent.com/weewx/weewx/wee_import_text/bin/weeimport/weeimport.py
>
> 2. edit your import config file and add your text field import to the field
>
> map as outlined above
>
> 3. stop WeeWX and run your import using --dry-run and then without
> --dry-run
>
> Let me know if you have any issues.
>
> Gary
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzjMzv1_GLT4AAs6b8FSBy1Y0xJj5JQS8ariGu3fEnrZ5w%40mail.gmail.com.
# Glenn McKechnie - modified 22/01/22 

weewx.4.5.1

 If a database with a field type of TEXT is checked using `wee_database 
--check-strings` it fails with the following stack trace.

:graybeard@whitebeard:/home/weewx/bin
06:50 PM $ ./wee_database --check-strings
Using configuration file /home/weewx451/weewx.conf
Using database binding 'wx_binding', which is bound to database 'archive_sqlite'
Preparing Null String Fix, this may take a while...
Traceback (most recent call last):
  File "./wee_database", line 1138, in 
main()
  File "./wee_database", line 227, in main
check_strings(config_dict, db_binding, options, fix=False)
  File "./wee_database", line 934, in check_strings
if record[icol] is not None and not check_type(record[icol], 
obs_type_list[icol]):
  File "./wee_database", line 879, in check_type
raise ValueError("Unknown type %s" % expected)
ValueError: Unknown type TEXT


== FIXED (for me) with the following changes to wee_database


xterm root@whitebeard:/home
04:44 PM $ diff -au weewx451/bin/wee_database weewx451/bin/wee_database-text 
--- weewx451/bin/wee_database   2021-04-03 06:02:14.0 +1100
+++ weewx451/bin/wee_database-text  2022-01-22 16:25:26.293912710 +1100
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 #
 #Copyright (c) 2009-2021 Tom Keffer 
 #
@@ -875,6 +875,8 @@
 return isinstance(val, float)
 elif expected == 'STR':
 return isinstance(val, six.string_types)
+elif expected == 'TEXT':
+return isinstance(val, six.string_types)
 else:
 raise ValueError("Unknown type %s" % expected)
 
@@ -886,6 +888,8 @@
 return float(val)
 elif target == 'STR':
 return six.ensure_str(val)
+elif target == 'TEXT':
+return six.ensure_str(val)
 else:
 raise ValueError("Unknown type %s" % target)


 Null strings in test record

Re: [weewx-user] Re: Storing Text as a record, wee_import and mysql UPDATE

2022-01-17 Thread Glenn McKechnie
Thanks Gary, I appreciate it.

Hopefully UPDATE won't raise any serious weewx issues.
I look forward to seeing it raised as an issue :)

On 18/01/2022, gjr80  wrote:
> Correct, wee_import will not accept text only fields. When we put together
> wee_import we only included support for numeric fields; text fields were
> omitted, perhaps not intentionally, but more likely because no real
> consideration had been given to including them in the schema. That being
> said, it should be a fairly simple process to modify wee_import to support
> text fields, at least for CSV imports anyway. Having had a quick wee_import
>
> refresher this morning I am thinking we could support something like
> ANComment
> = ANComment, text in the field map. Let me look at this further and see
> what I can come up with.
>
> As for supporting UPDATE, that will require further thought as I suspect
> that will introduce a number of wider issues. I'll probably raise an issue
> for that one.
>
> Gary
> On Monday, 17 January 2022 at 23:14:00 UTC+10 Glenn McKechnie wrote:
>
>> Working with TEXT records.
>>
>> I've gone through the wiki entry
>> https://github.com/weewx/weewx/wiki/Storing-text-in-the-database
>> and that all works well. I can add TEXT to the database and display it
>> in the weewx skin. So far so good.
>>
>> Using a modified filepile.py, I can add what I want via the new_archive
>> record hook. What I can't seem to do is add historical data that is in
>> TEXT form, via weewx. Fair enough, it makes sense.
>>
>> I figured wee_import may be a solution so I crafted a csv file and used
>> wee_import but it baulks on the text field. The csv files,
>> /var/tmp/weewxaddnotes.csv has the contents...
>>
>> timestamp,extraTemp1,extraTemp2,ANComment
>> 1641729300,23.0,22.0,"Test.\\nThen test again"
>>
>> It appears to be wanting a weewx_unit_name and I'm missing a clue stick.
>> I can't find a name that it will accept without error. If the
>> weewx_unit_name field is left blank (only the csv_field_name is given)
>> it gives the following.
>>
>> Obtaining raw import data for period 1 ...
>>  Unable to parse source-to-WeeWX field map.
>>  No units specified for source field 'ANComment' in
>> /home/weewx/csv.conf.
>>  Nothing done, exiting.
>>
>> Which makes sense as I had the following...
>>
>> [[FieldMap]]
>> dateTime = timestamp, unix_epoch
>> interval =
>> barometer =
>> pressure =
>> altimeter =
>> inTemp =
>> outTemp =
>> extraTemp1 = extraTemp1, degree_C
>> extraTemp2 = extraTemp2, degree_C
>> ANComment = ANComment
>>
>> If I tell wee_imports to ignore the ANComment entry, as follows...
>> ANComment =
>> then everything else imports as expected so it's falling over on the
>> ANComment field
>>
>> ignore_invalid_data in the csv.conf file is tantalizing close (a numeric
>> field containing non-numeric data) but I don't want it skipped or
>> halted. I want it accepted.
>>
>> Can I write anything into that 2nd field that will allow a TEXT entry to
>> skip the conversion process, and allow it to be written as-is to the
>> database?
>>
>> On reflection, even if I can use wee_import to add the data I want. I
>> need to get it correct and complete the first time as once a RECORD is
>> written (and all it's fields filled) then I can't update it later
>> without going the manual route as weewx appears to be missing an inbuilt
>> sql UPDATE archive method. That or I can't find it.
>>
>> And, that's probably so we don't shoot ourselves in the foot.
>>
>> But it sure would be nice to write a historical record using weewx or
>> preferably wee_import (with all their built in sanity checks) and then,
>> if needed later, be able to update any missing fields, or correct errant
>> values without going back to the command line.
>>
>> I understand the risk of blindly updating existing records, but in this
>> case they are all known empty or new fields, and if they do have
>> something in them then it needs changing anyway!
>> Caveat Emptor or something along those lines! :-)
>>
>>
>> As an aside. I'm doing this as I have a whole host of manual rain
>> records that should be entered as they are sanity checks on the
>> automatic gauges, weewx seems as good a place as any to store them.
>> At the same time I'll be adding extraTemp values that I've recorded
>> from the haystack.
>> It'd be nice to plot them, and change them, as they use existing
>> fields - extraTemp1 etc.
>>
>

[weewx-user] Storing Text as a record, wee_import and mysql UPDATE

2022-01-17 Thread Glenn McKechnie
Working with TEXT records.

I've gone through the wiki entry
https://github.com/weewx/weewx/wiki/Storing-text-in-the-database
and that all works well. I can add TEXT to the database and display it
in the weewx skin. So far so good.

Using a modified filepile.py, I can add what I want via the new_archive
record hook. What I can't seem to do is add historical data that is in
TEXT form, via weewx. Fair enough, it makes sense.

I figured wee_import may be a solution so I crafted a csv file and used
wee_import but it baulks on the text field.  The csv files,
/var/tmp/weewxaddnotes.csv has the contents...

timestamp,extraTemp1,extraTemp2,ANComment
1641729300,23.0,22.0,"Test.\\nThen test again"

It appears to be wanting a weewx_unit_name and I'm missing a clue stick.
I can't find a name that it will accept without error. If  the
weewx_unit_name field is left blank (only the csv_field_name is given)
it gives the following.

Obtaining raw import data for period 1 ...
 Unable to parse source-to-WeeWX field map.
 No units specified for source field 'ANComment' in /home/weewx/csv.conf.
 Nothing done, exiting.

Which makes sense as I had the following...

[[FieldMap]]
dateTime= timestamp, unix_epoch
interval=
barometer   =
pressure=
altimeter   =
inTemp  =
outTemp =
extraTemp1  = extraTemp1, degree_C
extraTemp2  = extraTemp2, degree_C
ANComment   = ANComment

If I tell wee_imports to ignore the ANComment entry, as follows...
ANComment   =
then everything else imports as expected so it's falling over on the
ANComment field

ignore_invalid_data in the csv.conf file is tantalizing close (a numeric
field containing non-numeric data) but I don't want it skipped or
halted. I want it accepted.

Can I write anything into that 2nd field that will allow a TEXT entry to
skip the conversion process, and allow it to be written as-is to the
database?

On reflection, even if I can use wee_import to add the data I want. I
need to get it correct and complete the first time as once a RECORD is
written (and all it's fields filled) then I can't update it later
without going the manual route as weewx appears to be missing an inbuilt
sql UPDATE archive method. That or I can't find it.

And, that's probably so we don't shoot ourselves in the foot.

But it sure would be nice to write a historical record using weewx or
preferably wee_import (with all their built in sanity checks) and then,
if needed later, be able to update any missing fields, or correct errant
values without going back to the command line.

I understand the risk of blindly updating existing records, but in this
case they are all known empty or new fields, and if they do have
something in them then it needs changing anyway!
Caveat Emptor or something along those lines! :-)


As an aside. I'm doing this as I have a whole host of manual rain
records that should be entered as they are sanity checks on the
automatic gauges, weewx seems as good a place as any to store them.
At the same time I'll be adding extraTemp values that I've recorded
from the haystack.
It'd be nice to plot them, and change them, as they use existing
fields - extraTemp1 etc.

Along with that, a TEXT comment as to why some readings appear as they
do would be useful, or where the floods were after the recent epic
rainfall, or why the rain values appear to be stuffed, or which area of
the haystack the probe is at.
The latest Tongan earthquake is probably another example given the
recent barometric burps it caused.

The possibilities expand as I write.
So I better go.

But... In summary.

wee_import appears to baulk on the new add TEXT method. Is there a quick
fix?

The ability to sql UPDATE any historical weewx record would be useful. 1
or many RECORD fields at a time.

Individual confirmations not required. Other than accepting a one-time
answer that; 'yes', I will bandage my own toes and blame no-one else if
it backfires, because we always have our backups.

Ha! Perhaps a csv.conf entry named pieces_are_all_yours with a default
of no? Changing to 'yes' will 'turn on' the UPDATE method. ;-)


-- 

Cheers
  Glenn

 rorpi - read only raspberry pi & various weewx addons
 https://github.com/glennmckechnie

-- 
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/20220117131349.322f6yi3nbpn6bcq%40gmail.com.
# EXAMPLE CONFIGURATION FILE FOR IMPORTING FROM CSV FILES
#
# Copyright (c) 2009-2019 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
#   

Re: [weewx-user] When die the blast wave of the eruption "hit" your station?

2022-01-16 Thread Glenn McKechnie
Fascinating.

At rural Victoria, Australia in the Sydney/Australia Timezone, which is +1100


BOM says it happened at  "3.10pm AEDT on Saturday" (15:10 24hour)
which I put at 15th Jan 04:10 UTC

So it didn't register here until approx 4 hours later judging by the
attached TonganEruption.jpg

TonganEruption2.jpg shows the hPa craziness over that 40 minute period.

Hopefully I haven't screwed up the date maths - it is a tad late here!


On 16/01/2022, michael.k...@gmx.at  wrote:
> As you may have noticed, there was a huge vulcano eruption in the southern
> pacific. The blast wave hit central europe yesterday n the evening around
> 20:10 CET.
>
> You can observe a steep rise in pressure at the time:
>
> [image: 2022-01-16 11_40_47-Das Wetter in Rif - Brave.png]
> You can see the spike in weewx stations around the world...
>
> --
> 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/5e2065ec-75df-4764-9b92-3274e817b28fn%40googlegroups.com.
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzgOAGh40RC-D0RR6ucdpUv_FnkSTnKRyMYemrxvbZt7aQ%40mail.gmail.com.


Re: [weewx-user] Error Uploading to WOW

2021-11-11 Thread Glenn McKechnie
Then again (cleans glasses) if I could read properly - mine is the pre
2016 variant and yours is the newer version.

So. As you were.

On 12/11/2021, Glenn McKechnie  wrote:
> On 11/11/2021, Tim Urberg  wrote:
>> Hello everyone, I'm having trouble uploading to WOW.  I created an
>> account
>> got my username and created a password, but this keeps happening:
>
> The above suggests that you created the account recently, but the help
> page suggests the siteid format you are using is pre 2016?
> ( That's according to the section "Automatic Weather Stations"  at
> https://wow.metoffice.gov.uk/support/dataformats#automatic  )
>
> Are you using the correct Site ID for your site?
>
> In my case it's a short string ( 941176001 ) , which is also in the
> public address ...
> https://bom-wow.metoffice.gov.uk/weather/view?siteID=941176001
>
> [[WOW]]
> [...]
>station = 941176001
> [...]
> --
>
>
> Cheers
>  Glenn
>
> rorpi - read only raspberry pi & various weewx addons
> https://github.com/glennmckechnie
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzgNatOMVVXExPYdb-%2BETu4h__93QYWdVSZ0W-sdhKpjxw%40mail.gmail.com.


Re: [weewx-user] Error Uploading to WOW

2021-11-11 Thread Glenn McKechnie
On 11/11/2021, Tim Urberg  wrote:
> Hello everyone, I'm having trouble uploading to WOW.  I created an account
> got my username and created a password, but this keeps happening:

The above suggests that you created the account recently, but the help
page suggests the siteid format you are using is pre 2016?
( That's according to the section "Automatic Weather Stations"  at
https://wow.metoffice.gov.uk/support/dataformats#automatic  )

Are you using the correct Site ID for your site?

In my case it's a short string ( 941176001 ) , which is also in the
public address ...
https://bom-wow.metoffice.gov.uk/weather/view?siteID=941176001

[[WOW]]
[...]
   station = 941176001
[...]
-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzjLx1zZerSPdZ9bzu3R_fQVsjm6bFYWfirGqwUQvH03jw%40mail.gmail.com.


Re: [weewx-user] Using a wired rain gauge with WeeWx

2021-10-19 Thread Glenn McKechnie
Regarding the Rainwise rain gauge and OWFS.

Yes and No.

It is NOT hooked up directly to the Pi, certainly not for the OWFs driver.
I see there are various HowTos about interfacing a reed switch rain
gauge to a Pi using that method but until you find one that's proven
and tested (bug free), or are willing to do the possible hard yards
yourself then...  ??

With OWFS the raingauge requires a 1-wire counter module to replace
the digital counter - LCD - supplied with it.

The 1-wire counter detects the pulse from a magnet / reed-switch
combination on the bucket arm of the raingauge
If you are up to modifying the internals ( it might even be done
already? I forget) and able to source and configure a 1-wire counter
(maybe 4-5 on a 1-10 complexity scale, depending on your 1-wire
knowledge) then you can use the OWFS driver to get the data.

I use a hobby-boards (that distributor is now defunct) counter. I'm
familiar with that gear and it works well; providing you keep moisture
out of the electronics of course!

There appears to be an alternative available at Sheepwalk Electronics,
the "SWE6 Multifunction I/O Module" which mentions a counter. I have
no idea of its capabilities so you would need to discuss it with them.
You'd also need one of their host adapters if you don't have something
suitable already.

https://www.sheepwalkelectronics.co.uk/



On 20/10/2021, Seth Ratner  wrote:
> Hello, my searching thus far has been fruitless.
>
> I'd like to hook a Rainwise RAINEW 111 wired rain gauge up to WeeWx running
>
> on a Raspberry Pi Zero W. Does anyone have any experience with this?
>
> https://rainwise.com/wired-rain-gauge
>
> I know I can just write my own program in Python to monitor, count, and log
>
> the bucket tips, but I suspect there's a better way to do it using WeeWx,
> since the exact rain gauge is shown in the supported hardware list at the
> end under one-wire.
>
> I think the OWFS might be the right direction, but I have no idea how it
> applies. Is the bucket simply hooked up to a GPIO pin and GND? How do I get
>
> WeeWx to monitor the pin and log the bucket tips as rainfall?
>
> Thanks!
> Seth
>
> --
> 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/b2b32e20-e407-43ea-8e0f-037e54d918d6n%40googlegroups.com.
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzg0WRCJ9FVT9GkvDV_xhzq_GkaZyAnhZUOUUo0HT8tEPg%40mail.gmail.com.


Re: [weewx-user] Re: HP1000 Driver

2021-04-16 Thread Glenn McKechnie
'file' is your friend.

You're fetching the actual html page...
wget -P /var/tmp https://github.com/AussieSusan/HP1000/blob/master/HP1000.tar.gz

file /var/tmp/HP1000.tar.gz
/var/tmp/HP1000.tar.gz: HTML document, UTF-8 Unicode text, with very long lines

rm /var/tmp/HP1000.tar.gz

Try the download link (button) that is on that page, ie:-
wget -P /var/tmp https://github.com/AussieSusan/HP1000/raw/master/HP1000.tar.gz

file /var/tmp/HP1000.tar.gz
/var/tmp/HP1000.tar.gz: gzip compressed data, last modified: Fri Sep
25 06:32:52 2020, from Unix, original size 71680


On 16/04/2021, ried...@gmail.com  wrote:
> pi@raspberrypi:~ $ sudo tar -xzf HP1000.tar.gz
>
> gzip: stdin: not in gzip format
> tar: Child returned status 1
> tar: Error is not recoverable: exiting now
>
> ried...@gmail.com schrieb am Freitag, 16. April 2021 um 09:51:49 UTC+2:
>
>> Hello I tried the Weewx 4.5.1-1 update. Since then, the HP1000 driver has
>>
>> stopped working. I uninstalled and reinstalled Weewx. Unfortunately I
>> can't
>> add the HP1000 driver anymore. I have a Raspi4 with 8gb Ram. I tried to
>> download and install the driver with these commands. wget
>> https://github.com/AussieSusan/HP1000/blob/master/HP1000.tar.gz
>> wee_extension --install HP1000.tar.gz
>> wget -P / var / tmp
>> https://github.com/AussieSusan/HP1000/blob/master/HP1000.tar.gz
>> sudo wee_extension --install /var/tmp/HP1000.tar.gz
>>
>> I think that the file cannot be extracted.
>> I then use this error message.
>>  pi @ raspberrypi: ~ $ sudo wee_extension --install = / var / tmp /
>> HP1000.tar.gz Request to install '/var/tmp/HP1000.tar.gz' Extracting from
>>
>> tar archive /var/tmp/HP1000.tar.gz Traceback (most recent call last): File
>>
>> "/ usr / share / weewx / wee_extension", line 88, in  Main() File
>>
>> "/ usr / share / weewx / wee_extension", line 80, in main
>> ext.install_extension (options.install) File
>> "/usr/share/weewx/weecfg/extension.py", line 118, in install_extension
>> self.tmpdir, self.logger) File "/usr/share/weewx/weecfg/__init__.py", line
>>
>> 1808, in extract_tar tar_archive = tarfile.open (filename, mode = 'r')
>> File
>> "/usr/lib/python3.7/tarfile.py", line 1580, in open raise ReadError ("file
>>
>> could not be opened successfully") tarfile.ReadError: file could not be
>> opened successfully pi @ raspberrypi: ~ $
>>
>> I hope someone can help me. I think the HP1000 driver is better than the
>> Interceptor driver.
>>
>>  Greetings André
>>
>
> --
> 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/db5413b3-5389-4847-b1c9-85fd198c5eban%40googlegroups.com.
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzgrJnX%3DydDh9HEXkRSKn5Bxm65hugfuZownSrN0KYfgzw%40mail.gmail.com.


Re: [weewx-user] Re: New install of 4.4 but owfs crashes it

2021-04-01 Thread Glenn McKechnie
:36 PI4BUSB weewx[763] CRITICAL __main__: 
> import pyownet
> Apr  1 17:31:36 PI4BUSB weewx[763] CRITICAL __main__: 
> ModuleNotFoundError: No module named 'pyownet'
> Apr  1 17:31:36 PI4BUSB weewx[763] CRITICAL __main__: 
> Apr  1 17:31:36 PI4BUSB weewx[763] CRITICAL __main__:   During
> handling of the above exception, another exception occurred:
> Apr  1 17:31:36 PI4BUSB weewx[763] CRITICAL __main__: 
> Apr  1 17:31:36 PI4BUSB weewx[763] CRITICAL __main__: 
> Traceback (most recent call last):
> Apr  1 17:31:36 PI4BUSB weewx[763] CRITICAL __main__: File
> "/usr/share/weewx/weewxd", line 151, in main
> Apr  1 17:31:36 PI4BUSB weewx[763] CRITICAL __main__: 
> engine = weewx.engine.StdEngine(config_dict)
> Apr  1 17:31:36 PI4BUSB weewx[763] CRITICAL __main__: File
> "/usr/share/weewx/weewx/engine.py", line 93, in __init__
> Apr  1 17:31:36 PI4BUSB weewx[763] CRITICAL __main__: 
> self.loadServices(config_dict)
> Apr  1 17:31:36 PI4BUSB weewx[763] CRITICAL __main__: File
> "/usr/share/weewx/weewx/engine.py", line 161, in loadServices
> Apr  1 17:31:36 PI4BUSB weewx[763] CRITICAL __main__: 
> obj = weeutil.weeutil.get_object(svc)(self, config_dict)
> Apr  1 17:31:36 PI4BUSB weewx[763] CRITICAL __main__: File
> "/usr/share/weewx/weeutil/weeutil.py", line 1093, in get_object
> Apr  1 17:31:36 PI4BUSB weewx[763] CRITICAL __main__: 
> mod = __import__(module)
> Apr  1 17:31:36 PI4BUSB weewx[763] CRITICAL __main__: File
> "/usr/share/weewx/user/owfs.py", line 269, in 
> Apr  1 17:31:36 PI4BUSB weewx[763] CRITICAL __main__: 
> raise Exception("No one-wire library found")
> Apr  1 17:31:36 PI4BUSB weewx[763] CRITICAL __main__: 
> Exception: No one-wire library found
> Apr  1 17:31:36 PI4BUSB weewx[763] CRITICAL __main__:   Exiting.
> And here is the weewx.conf in its entireity. (Note, I'm running
> simulator on this pi because my Davis / PI3B is in production and
> don't want to deploy this PI4 to it, it's not easily accessible!)
> -- I will attach it -- There are no passwords anywhere yet as it's not
> put into service yet -- Let me know if you do not get the atch --
> Thanks -
>
> On Thu, Apr 1, 2021 at 5:39 PM Glenn McKechnie
>  wrote:
>>
>> Okay...
>>
>> Need to see a full syslog from a weewx restart.
>>
>> Also your vetted weewx.conf file (sans passwords etc) I think it's
>> wee_debug that outputs that information.
>>
>> Not sure why you're running the simulator when you have the Davis as
>> the main driver?
>> Correct that owfs will be run as a service in that case.
>>
>> On 02/04/2021, Messy Potamia  wrote:
>> > I am still getting the same errors when in [engine][[services]] I
>> > uncomment data_services = user.owfs.OWFSService
>> >
>> >
>> > On Thu, Apr 1, 2021 at 5:28 PM Messy Potamia 
>> > wrote:
>> >>
>> >> I read the readme.txt at https://github.com/glennmckechnie/weewx-owfs.
>> >> In fact several times.
>> >> I'm sorry but it is not clear to me what I'm supposed to do. Although
>> >> I'm currently running Simulator, whenever I enable the line in
>> >> weewx.conf that says
>> >> [Engine]
>> >>  data_services = user.owfs.OWFSService
>> >> it crashes weewx, with several lines of errors (posted above in
>> >> entireity) but the main ones seem to be:
>> >> CRITICAL __main__:   No one-wire library found
>> >> CRITICAL __main__:   ModuleNotFoundError: No module named 'ow'
>> >> CRITICAL __main__:   ModuleNotFoundError: No module named
>> >> 'pyownet'
>> >>  all this even though I have installed (several times now) pyownet and
>> >> ow.
>> >> sudo apt-get install python-ow
>> >> sudo apt-get install pyownet #NOT FOUND SO USED:
>> >> pip3 install pyownet
>> >> wee_extension --install weewx-owfs.zip
>> >> Even before all this, my i2c-1 (Sheepwalk rpi3v2) was serving up the 4
>> >> DS18B20's I hooked up to my browser at http://192.168.2.108:2121/
>> >> It is just that the weewx 4 that crashes with the above errors. I
>> >> cannot follow the rest of these notes about weewx4/python3/buster
>> >> problems. I've about got your readme.txt memorized.
>> >> Also, my station type will not be OWFS, it will be a Davis and extra
>> >> measurements will be gotten through the i2c-1 ow device.
>> &

Re: [weewx-user] Re: New install of 4.4 but owfs crashes it

2021-04-01 Thread Glenn McKechnie
Okay...

Need to see a full syslog from a weewx restart.

Also your vetted weewx.conf file (sans passwords etc) I think it's
wee_debug that outputs that information.

Not sure why you're running the simulator when you have the Davis as
the main driver?
Correct that owfs will be run as a service in that case.

On 02/04/2021, Messy Potamia  wrote:
> I am still getting the same errors when in [engine][[services]] I
> uncomment data_services = user.owfs.OWFSService
>
>
> On Thu, Apr 1, 2021 at 5:28 PM Messy Potamia 
> wrote:
>>
>> I read the readme.txt at https://github.com/glennmckechnie/weewx-owfs.
>> In fact several times.
>> I'm sorry but it is not clear to me what I'm supposed to do. Although
>> I'm currently running Simulator, whenever I enable the line in
>> weewx.conf that says
>> [Engine]
>>  data_services = user.owfs.OWFSService
>> it crashes weewx, with several lines of errors (posted above in
>> entireity) but the main ones seem to be:
>> CRITICAL __main__:   No one-wire library found
>> CRITICAL __main__:   ModuleNotFoundError: No module named 'ow'
>> CRITICAL __main__:   ModuleNotFoundError: No module named
>> 'pyownet'
>>  all this even though I have installed (several times now) pyownet and
>> ow.
>> sudo apt-get install python-ow
>> sudo apt-get install pyownet #NOT FOUND SO USED:
>> pip3 install pyownet
>> wee_extension --install weewx-owfs.zip
>> Even before all this, my i2c-1 (Sheepwalk rpi3v2) was serving up the 4
>> DS18B20's I hooked up to my browser at http://192.168.2.108:2121/
>> It is just that the weewx 4 that crashes with the above errors. I
>> cannot follow the rest of these notes about weewx4/python3/buster
>> problems. I've about got your readme.txt memorized.
>> Also, my station type will not be OWFS, it will be a Davis and extra
>> measurements will be gotten through the i2c-1 ow device.
>> Rebooting one last time...
>>
>> On Thu, Apr 1, 2021 at 4:01 PM Glenn McKechnie
>>  wrote:
>> >
>> > Back around May 2020 the python3-ow version of ow disappeared from the
>> > RPi and Debian repos. Where it went, or why no-one knows. There is a
>> > user group post titled "python3-ow for OWFS" where this cropped up.
>> >
>> > All that aside, you  need pyownet (the module using 'pip3 install
>> > pyownet' if the apt repo doesn't have it) and owserver (from OWFS
>> > using sudo apt-get install owserver).
>> >
>> > The following is a fork of the original owfs driver / service and is
>> > known to work with weewx4 and your i2c combo.
>> > You should also find that the --readings stanza should work with this
>> > version.
>> >
>> > https://github.com/glennmckechnie/weewx-owfs
>> >
>> > The README at that fork should hold enough info to expand on those
>> > dependencies, if not ask for clarification.
>> >
>> > pydoc_owfs.txt will also hold some clues regarding the owserver
>> > configuration.
>> > ie:-
>> > server: device /dev/i2c-1 # for a pi using i2c-1
>> > server: port = 4304
>> >
>> >
>> > On 02/04/2021, vince  wrote:
>> > > There appear to be two pages in the wiki with slightly different
>> > > filenames.
>> > >
>> > > Try https://github.com/weewx/weewx/wiki/owfs and look at step1 which
>> > > mentions python3 specifically.
>> > >
>> > > On Thursday, April 1, 2021 at 11:38:52 AM UTC-7 vince wrote:
>> > >
>> > >> If you use python3, you need python3 versions of all python modules
>> > >> 'and'
>> > >>
>> > >> python3-compatible versions of all drivers, extensions, and skins
>> > >> you
>> > >> install.
>> > >>
>> > >> That should be somewhat obvious I'd hope, given hundreds of posts
>> > >> since v4
>> > >>
>> > >> came out with people battling the python3 transition.
>> > >>
>> > >> On Thursday, April 1, 2021 at 9:14:13 AM UTC-7 messyp...@gmail.com
>> > >> wrote:
>> > >>
>> > >>> I didn't see anything in the documentation I read about how to get
>> > >>> "the
>> > >>> python3 version of the library the driver needs". I know 3 is
>> > >>> installed
>> > >>> because I installed the pyephem & got it working using pip3. Can
>> > >>> someone
>> > >>&g

Re: [weewx-user] Re: New install of 4.4 but owfs crashes it

2021-04-01 Thread Glenn McKechnie
Back around May 2020 the python3-ow version of ow disappeared from the
RPi and Debian repos. Where it went, or why no-one knows. There is a
user group post titled "python3-ow for OWFS" where this cropped up.

All that aside, you  need pyownet (the module using 'pip3 install
pyownet' if the apt repo doesn't have it) and owserver (from OWFS
using sudo apt-get install owserver).

The following is a fork of the original owfs driver / service and is
known to work with weewx4 and your i2c combo.
You should also find that the --readings stanza should work with this version.

https://github.com/glennmckechnie/weewx-owfs

The README at that fork should hold enough info to expand on those
dependencies, if not ask for clarification.

pydoc_owfs.txt will also hold some clues regarding the owserver configuration.
ie:-
server: device /dev/i2c-1 # for a pi using i2c-1
server: port = 4304


On 02/04/2021, vince  wrote:
> There appear to be two pages in the wiki with slightly different filenames.
>
> Try https://github.com/weewx/weewx/wiki/owfs and look at step1 which
> mentions python3 specifically.
>
> On Thursday, April 1, 2021 at 11:38:52 AM UTC-7 vince wrote:
>
>> If you use python3, you need python3 versions of all python modules 'and'
>>
>> python3-compatible versions of all drivers, extensions, and skins you
>> install.
>>
>> That should be somewhat obvious I'd hope, given hundreds of posts since v4
>>
>> came out with people battling the python3 transition.
>>
>> On Thursday, April 1, 2021 at 9:14:13 AM UTC-7 messyp...@gmail.com wrote:
>>
>>> I didn't see anything in the documentation I read about how to get "the
>>> python3 version of the library the driver needs". I know 3 is installed
>>> because I installed the pyephem & got it working using pip3. Can someone
>>>
>>> point me to a procedure to correct this? Thanks.
>>>
>>> On Thu, Apr 1, 2021, 10:44 vince  wrote:
>>>
 On Thursday, April 1, 2021 at 7:40:48 AM UTC-7 messyp...@gmail.com
 wrote:

> Apr  1 09:06:07 PI4BUSB weewx[8998]: Starting weewx weather system:
> weewx.
> Apr  1 09:06:07 PI4BUSB weewx[9013] CRITICAL __main__: Caught
> unrecoverable exception:
> Apr  1 09:06:07 PI4BUSB weewx[9013] CRITICAL __main__:   No
> one-wire library found
> Apr  1 09:06:07 PI4BUSB weewx[9013] CRITICAL __main__: 
> Traceback (most recent call last):
> Apr  1 09:06:07 PI4BUSB weewx[9013] CRITICAL __main__: File
>
> "/usr/share/weewx/user/owfs.py", line 264, in 
> Apr  1 09:06:07 PI4BUSB weewx[9013] CRITICAL __main__:   ow
>
> = OWFSBinding()
> Apr  1 09:06:07 PI4BUSB weewx[9013] CRITICAL __main__: File
>
> "/usr/share/weewx/user/owfs.py", line 202, in __init__
> Apr  1 09:06:07 PI4BUSB weewx[9013] CRITICAL __main__: 
> import ow as owbinding
> Apr  1 09:06:07 PI4BUSB weewx[9013] CRITICAL __main__: 
> ModuleNotFoundError: No module named 'ow'
>
>
 Best guess is you installed weewx 4 which defaults to python3, and you
 have not installed the python3 version of the library the driver needs.


 --
 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/5ybl8_8K4QA/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 weewx-user+...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/weewx-user/20ed4b86-87c2-4af6-9383-ec05265444a2n%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/402490d2-bc67-4c5f-ac84-855c20e02c62n%40googlegroups.com.
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzh2qyhF-7SEbXSOo0FVCtAEO6xQnNR4b5pOa6viz81bVg%40mail.gmail.com.


Re: [weewx-user] ;:; SQLite schema report

2021-03-03 Thread Glenn McKechnie
/home/david/Downloads/weewx-belchertown.1.2.tar.gz

Check the filename

Is it really ... weewx-belchertown.1.2.tar.gz ( as per your snippet)
or is it ... weewx-belchertown-1.2.tar.gz  as per the release page at
https://github.com/poblabs/weewx-belchertown/releases/tag/weewx-belchertown-1.2

note: there are 2 dashes in the correct name.

On 04/03/2021, David Prellwitz  wrote:
> error trying to install belchertown. my weewx install was using setup.py. I
>
> downloaded the belchertown 1.2 tar.gz into my home/david/Downloads folder.
> I ran the sudo wee-extension command and get "File
> "/home/weewx/bin/weecfg/extension.py", line 134, in install_extension
> weecfg.extension.InstallError: Extension
> '/home/david/Downloads/weewx-belchertown.1.2.tar.gz' not found.
> can't find what i did wrong. Should i extract the tar.gz file first? move
> it to another folder to start install?
> /David
>
> On Wednesday, March 3, 2021 at 2:51:02 PM UTC-8 vince wrote:
>
>> Lightning is difficult because there's no units for 'energy' in the UDP
>> API.  I might also add perhaps don't bother, as lightning is bogus anyway.
>>
>>  It's what your sensor reported, but it is not remotely close to the
>> crowd-sourced info their web or mobile interfaces provide, of which your
>> sensor measurements are just a small part of what they aggregate and
>> display.
>>
>> I think the simplest thing to do is map stuff and see what the driver puts
>>
>> in the db.   It's possible the driver forces metric (or not metric) and
>> does the conversions under the hood before weewx ever sees the assembled
>> LOOP.  Sometimes it's easier to just look at the code or do a little
>> experimentation.
>>
>> On Wednesday, March 3, 2021 at 1:42:13 PM UTC-8 david.a@gmail.com
>> wrote:
>>
>>> Vince, if i'm reading your post correctly (and carefully reading the
>>> links you've provided), weewx.sdb stores all elements in a unit-base type
>>>
>>> as specified in the usUnits group  (*"Each observation type, such
>>> as outTemp or pressure, is associated with a unit group, such
>>> as group_temperature or group_pressure. Each unit group is associated
>>> with
>>> a unit type such as degree_F or mbar.*"  So, as my weewx.conf has an
>>> entry in [StdConvert] section "target_unit = us " i can assume that all
>>> weewx.sdb entries conform to the US Group column. further assumption is
>>> that if WeatherFlow Tempest device provides data in m/b and i spec it as
>>>
>>> m/b for the LOOP process, it will be converted to inHg as part of the UDP
>>>
>>> LOOP process. If i import data from WF using the API's i just need to
>>> spec
>>> the API page's listing of unit WF will be providing for those fields and
>>>
>>> wee_import will correct those to the weewx.sdb needed units?  If i wish
>>> to
>>> have lightning information, i'll need to map to those "signal7/8" and/or
>>>
>>> "xxx/yyy" fields, and i'll have to figure out what units they use?
>>> thanks!
>>>
>>>
>>> On Wednesday, March 3, 2021 at 11:34:05 AM UTC-8 David Prellwitz wrote:
>>>
 Vince - yea, my way of apologizing for running down some rabbit hole i
 didn't need to. Thanks for the guidance, I'll map it out and see if it
 works. I'll try to get a decent mapping setup and forward to you for
 comment.
 My next attempt is to install and use Belchertown skins.

 On Wednesday, March 3, 2021 at 8:31:12 AM UTC-8 vince wrote:

> That's a lot of words, but I still think you're possibly overthinking.
>
> Anyway,  I'm pretty lost re: what you're actually trying to do.
>
>- There is a sample mapping of Tempest UDP elements to Weewx
>database elements both in the driver code and in the docs on the
> github
>site for the driver.
>- There are a couple forks of the original driver, but they all
>have an example looking like (this map)
>
> 
>
> So using outside temperature as an example, you'll see a mapping that
> looks like:
>
>- outTemp = air_temperature.ST-0025.obs_st
>
> Which means:
>
>- map the driver's air_temperature element
>- for sensor ST-0025
>- from the obs_st observation type emitted by the WF gear
>- to weewx's outTemp database element
>
> The driver's terminology is in the code around line 211 of the driver
> (here)
> .
>
>   So why is it different ?  Because the driver references the WF UDP
> API
> (here)  which
> uses the description 'air temperature' in the obs_st (tempest
> observation)
> type.   The driver is written to reconcile versus the vendor's public
> API.
>   The mapping reconciles that to weewx-speak.
>
> So what units does outTemp use and how do you 

Re: [weewx-user] Wind direction not working using AAG anemometer over i2C

2021-02-12 Thread Glenn McKechnie
Looks like you are using the forked code at...
https://github.com/glennmckechnie/weewx-owfs

I've tweaked that version with the following fix for python3

-
wd = w.split(',')

+try:
+   wd = w.split(',')
+   except TypeError:
+wd = w.split(b',')

I'm pretty rusty with weewx (and python), but I believe it should do the job.

On 13/02/2021, gord hart  wrote:
> Hi All
> I have the system up and running using my old weather station from AAG.
> All the data is populating except the wind direction
> The wind direction is the voltage type and was working on my OWW system
> that I am trying to replace.
> Things stop on line 570 of OWFS with "a bytes-like object is required, not
> 'str'" as shown bellow.
> I am using the driver with the Dallas support and I have looked at the code
>
> but it is above my skill level to fix.
> Any Ideas?
> Cheers
> Gordon
>
>
> OWFS]
> driver = user.owfs
> [[sensor_map]]
>  inTemp = /uncached/26.77401500/temperature
>  outTemp = /uncached/10.5D2714000800/temperature
> inHumidity  = /uncached/26.77401500/humidity
> windDir = /uncached/20.CA160100
> windSpeed = /uncached/1D.08420100
> [[sensor_type]]
> windDir = aag_windvane
> windSpeed = aag_windspeed
>
>
> Caught unrecoverable exception:
> Feb 12 16:37:59 raspberrypi weewx[20751] CRITICAL __main__:   a
> bytes-like object is required, not 'str'
> Feb 12 16:37:59 raspberrypi weewx[20751] CRITICAL __main__: 
> Traceback (most recent call last):
> Feb 12 16:37:59 raspberrypi weewx[20751] CRITICAL __main__: 
> File "/usr/share/weewx/weewxd", line 157, in main
> Feb 12 16:37:59 raspberrypi weewx[20751] CRITICAL __main__: 
> engine.run()
> Feb 12 16:37:59 raspberrypi weewx[20751] CRITICAL __main__: 
> File "/usr/share/weewx/weewx/engine.py", line 208, in run
> Feb 12 16:37:59 raspberrypi weewx[20751] CRITICAL __main__: 
> for packet in self.console.genLoopPackets():
> Feb 12 16:37:59 raspberrypi weewx[20751] CRITICAL __main__: 
> File "/usr/share/weewx/user/owfs.py", line 885, in genLoopPackets
> Feb 12 16:37:59 raspberrypi weewx[20751] CRITICAL __main__: 
> last_data, p['dateTime'])
> Feb 12 16:37:59 raspberrypi weewx[20751] CRITICAL __main__: 
> File "/usr/share/weewx/user/owfs.py", line 570, in aag_winddir
> Feb 12 16:37:59 raspberrypi weewx[20751] CRITICAL __main__: 
> wd = w.split(',')
> Feb 12 16:37:59 raspberrypi weewx[20751] CRITICAL __main__: 
> TypeError: a bytes-like object is required, not 'str'
> Feb 12 16:37:59 raspberrypi weewx[20751] CRITICAL __main__: 
> Exiting.
>
>
> 20.CA160100
> uncached version 
> *up* 
> directory
> *8bit*
> 8bit 
> *CO2*
> CO2 
> *PIO.ALL*
>
> *PIO.A*
>
> *PIO.B*
>
> *PIO.C*
>
> *PIO.D*
>
> *address*
> 20CA160100D0
> *alarm*
> alarm 
> *alias*
>
> *crc8*
> D0
> *family*
> 20
> *id*
> CA160100
> *latestvolt.ALL*
> 4.4153,4.49194,2.30511,4.53929
> *latestvolt.A*
> 4.4153
> *latestvolt.B*
> 4.49194
> *latestvolt.C*
> 2.30511
> *latestvolt.D*
> 4.53929
> *latestvolt2.ALL*
> 2.20765,2.24597,1.15256,2.26964
> *latestvolt2.A*
> 2.20765
> *latestvolt2.B*
> 2.24597
> *latestvolt2.C*
> 1.15256
> *latestvolt2.D*
> 2.26964
> *locator*
> 
> *memory*
>
> *pages*
> pages 
> *power*
>
> *r_address*
> D116CA20
> *r_id*
> 000116CA
> *r_locator*
> 
> *set_alarm*
> set_alarm 
> *type*
> DS2450
> *volt.ALL*
> 4.4253,4.48007,2.32433,4.54804
> *volt.A*
> 4.4253
> *volt.B*
> 4.48007
> *volt.C*
> 2.32433
> *volt.D*
> 4.54804
> *volt2.ALL*
> 0,0,2.30738,0
> *volt2.A*
> 0
> *volt2.B*
> 0
> *volt2.C*
> 2.30738
> *volt2.D*
> 0
>
>
>
> --
> 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/c14296a6-dd27-49bb-a172-900d7bc40ea4n%40googlegroups.com.
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzi%2BG61EqFO53YaJRm2bDs%2B80D_KWeAAh4Mvvt_g4mM9-A%40mail.gmail.com.


Re: [weewx-user] Re: Ubuntu 20.04 install, no HTML Files at all

2021-01-15 Thread Glenn McKechnie
On 16/01/2021, Rob Cook  wrote:
> Notice that I have nothing in /var/www/html other than index.html, that's
> my issue. The installer isn't (assuming it's supposed to) installing files

The installer doesn't place any files into any html directory.

> in /var/www/html and I can't seem to figure out via documentation where
> else they would be.

The html directory will only start showing weewx related files once
weewx is up and successfully running.

The weewx.conf file has the location (HTML_ROOT  = ...)

Once weewx is up and running and generating output (the Simulator
driver is often used for testing a new installation) it will then
transfer any generated files into that html/  location. (The first
thing it will do is generate the weewx/ directory.)

[...]

-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzhZoa%3D7D0CgUv-YZDmBZLGsx1g14_pVCuH2AwYNxDXPvg%40mail.gmail.com.


Re: [weewx-user] Re: OWFS crashing on restart of Weewx

2021-01-15 Thread Glenn McKechnie
Hi Gordon,

python3-ow disappeared from the RPI linux repo, which leaves you with
the fallback module - pyownet. That module is used along with the
requirement of a running owserver (from owfs, which it sounds like you
have one running already).

Mathews driver for the owfs has been forked to...
https://github.com/glennmckechnie/weewx-owfs

where there are additional notes in the README (as well as notes in
the drivers source).

That driver is working here, and has been used by others with weewx4
and python3 (also with an  i-2C board) so once you're over that
initial module hiccup you should hopefully be okay.

basically, the notes for your issue are...

python3.x for weewx versions > 4
sudo apt-get install owserver
pip3 install pyownet (if it is not available via apt-get.
(use apt-get install pip3-python to install pip3 )


Once you have pyownet installed and running, that fork of the driver
should then work for you.


On 16/01/2021, gjr80  wrote:
> Hi,
>
> Did you install the one-wire python bindings as per step 1 in the install
> instructions ?
>
> Gary
> On Saturday, 16 January 2021 at 05:36:38 UTC+10 gege...@gmail.com wrote:
>
>> Hello
>> I am trying to get  a RP3 to talk to a older Dallas OneWire weather
>> instrument.
>> The WeeWx installation works with the simulator and outputs weather
>> reports but will not start when I use OWFS as the driver in the
>> weewx.conf.
>> The 1wire is connected to the RP3 via a i2C board and this is working as I
>>
>> can see data via a browser at  localhost:2121
>> Using the latest build for Raspban.
>> On restart Weewx reports
>>
>>   Initializing weewx version 4.3.0
>> Jan 15 15:17:01 raspberrypi weewx[4497] INFO __main__: Using Python 3.7.3
>>
>> (default, Jul 25 2020, 13:03:44) #012[GCC 8.3.0]
>> Jan 15 15:17:01 raspberrypi weewx[4497] INFO __main__: Platform
>> Linux-5.4.79-v7+-armv7l-with-debian-10.7
>> Jan 15 15:17:01 raspberrypi weewx[4497] INFO __main__: Locale is
>> 'en_CA.UTF-8'
>> Jan 15 15:17:01 raspberrypi weewx[4497] INFO __main__: PID file is
>> /var/run/weewx.pid
>> Jan 15 15:17:01 raspberrypi weewx[4515] INFO __main__: Using configuration
>>
>> file /etc/weewx/weewx.conf
>> Jan 15 15:17:01 raspberrypi weewx[4515] INFO __main__: Debug is 0
>> Jan 15 15:17:01 raspberrypi weewx[4515] INFO weewx.engine: Loading station
>>
>> type OWFS (user.owfs)
>> Jan 15 15:17:01 raspberrypi weewx[4515] CRITICAL __main__: Caught
>> unrecoverable exception:
>> Jan 15 15:17:01 raspberrypi weewx[4515] CRITICAL __main__:   No
>> one-wire library found
>> Jan 15 15:17:01 raspberrypi weewx[4485]: Starting weewx weather system:
>> weewx.
>> Jan 15 15:17:01 raspberrypi systemd[1]: Started LSB: weewx weather
>> system.
>> Jan 15 15:17:01 raspberrypi weewx[4515] CRITICAL __main__: 
>> Traceback (most recent call last):
>> Jan 15 15:17:01 raspberrypi weewx[4515] CRITICAL __main__: 
>> File "/usr/share/weewx/user/owfs.py", line 264, in 
>> Jan 15 15:17:01 raspberrypi weewx[4515] CRITICAL __main__: 
>> ow = OWFSBinding()
>> Jan 15 15:17:01 raspberrypi weewx[4515] CRITICAL __main__: 
>> File "/usr/share/weewx/user/owfs.py", line 202, in __init__
>> Jan 15 15:17:01 raspberrypi weewx[4515] CRITICAL __main__: 
>> import ow as owbinding
>> Jan 15 15:17:01 raspberrypi weewx[4515] CRITICAL __main__: 
>> ModuleNotFoundError: No module named 'ow'
>> Jan 15 15:17:01 raspberrypi weewx[4515] CRITICAL __main__: 
>> Jan 15 15:17:01 raspberrypi weewx[4515] CRITICAL __main__: 
>> During handling of the above exception, another exception occurred:
>> Jan 15 15:17:01 raspberrypi weewx[4515] CRITICAL __main__: 
>> Jan 15 15:17:01 raspberrypi weewx[4515] CRITICAL __main__: 
>> Traceback (most recent call last):
>> Jan 15 15:17:01 raspberrypi weewx[4515] CRITICAL __main__: 
>> File "/usr/share/weewx/user/owfs.py", line 267, in 
>> Jan 15 15:17:01 raspberrypi weewx[4515] CRITICAL __main__: 
>> ow = OWNetBinding()
>> Jan 15 15:17:01 raspberrypi weewx[4515] CRITICAL __main__: 
>> File "/usr/share/weewx/user/owfs.py", line 231, in __init__
>> Jan 15 15:17:01 raspberrypi weewx[4515] CRITICAL __main__: 
>> import pyownet
>> Jan 15 15:17:01 raspberrypi weewx[4515] CRITICAL __main__: 
>> ModuleNotFoundError: No module named 'pyownet'
>> Jan 15 15:17:01 raspberrypi weewx[4515] CRITICAL __main__: 
>> Jan 15 15:17:01 raspberrypi weewx[4515] CRITICAL __main__: 
>> During handling of the above exception, another exception occurred:
>> Jan 15 15:17:01 raspberrypi weewx[4515] CRITICAL __main__: 
>> Jan 15 15:17:01 raspberrypi weewx[4515] CRITICAL __main__: 
>> Traceback (most recent call last):
>> Jan 15 15:17:01 raspberrypi weewx[4515] CRITICAL __main__: 
>> File "/usr/share/weewx/weewxd", line 148, in main
>> Jan 15 15:17:01 raspberrypi weewx[4515] CRITICAL __main__: 
>> engine = 

Re: [weewx-user] Granularity and Archives

2020-10-02 Thread Glenn McKechnie
wxobs will give you some of what you are after. (It doesn't return
every weewx database field.)

There are no charts, just a table of values for any specific date in
your database.

The default is to display 30 minute intervals, but that can be changed
in skin.conf if you want to fine tune it (see display_interval)

https://github.com/glennmckechnie/weewx-wxobs

Given you have sqlite as your database, it works best as a local
installation. (ie: it requires direct access to your database)

http://203.213.243.61/weewx/wxobs/
That link has a working demo, but the database only goes back a month.
Selecting the 12th Sept 2020 will show a rain day (adjusted for the
Australian start time of 9 a.m.)



On 03/10/2020, p q  wrote:
> This  is the one I'm using.
> 
>
> On Fri, Oct 2, 2020 at 3:26 PM Tom Keffer  wrote:
>
>> If you use one of the standard skins, the "NOAA" report will tell you
>> daily rain totals for each day.
>>
>> On Fri, Oct 2, 2020 at 1:41 PM cycle.l...@gmail.com <
>> cycle.london...@gmail.com> wrote:
>>
>>> Hi,
>>> Very bad rain tonight in the UK, and I mentioned to my wife that it must
>>> have been the worst rain for years.  She remarked that we had had
>>> heavier
>>> rain two years ago.
>>>
>>> Then it occurred to me that I had no way of verifying that.  If I select
>>> '2018', for example, it will tell me what day we had very heavy rain,
>>> but
>>> it won't let see what the weather was (all of the parameters) on my
>>> birthday, or any other day.
>>>
>>> Is there a way to get 'granular' data of this kind?  Is it already in
>>> 'sqllite' database, or would I have to switch to MySQL to get it?
>>> Whichever method I use, will that data only be available via CLI, or is
>>> there a way to get it on the GUI - without learning HTML and Python to
>>> create it myself?
>>>
>>> Thanks.
>>>
>>> --
>>> 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/127feef8-1241-4f8d-a199-bbcfff027b8fn%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/CAPq0zEDtEmijp3%2Bq4cc1w88GaNnVr5UaqK1-FM%3D8A0cDnSRLUw%40mail.gmail.com
>> 
>> .
>>
>
>
> --
> Peter Quinn
> (415)794-2264
>
> --
> 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/CAA1SM233i9W-AYL-PoOsb982gUKiEAU8bAMfdGS%2B1c_WPcEhOA%40mail.gmail.com.
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAziVEr64%3D2WjGk_t%3DNv6avTq%3DTLqs2j%2Bgbfmoz02n7g22w%40mail.gmail.com.


Re: [weewx-user] Re: Pressure Readings with BME280

2020-09-29 Thread Glenn McKechnie
Have you got debug turned on in weewx.conf (debug = 1)? Probably
should be for this.

In bme280.py it  has the following...
[...]
# Inherit from the base class StdService:
class bmp(StdService):
[...]

You are calling...
 user.bme280.bme

I believe that should be ...
 user.bme280.bmp

also , I don't think you can have 2 entries for data_services . In
this case comment out the original one.

On 30/09/2020, rich T  wrote:
> I don't have any issues when using this driver for my BME280 sensor.
>
> https://gitlab.com/wjcarpenter/bme280wx
>
> On Tuesday, September 29, 2020 at 11:03:31 PM UTC-4, wxwatching wrote:
>>
>> I followed the installation guide here:
>>
>>
>>
>> I ran a test script like this:
>>
>> import Adafruit_BME280
>>
>> sensor = Adafruit_BME280.BME280(t_mode=Adafruit_BME280.BME280_OSAMPLE_8,
>> p_mode=Adafruit_BME280.BME280_OSAMPLE_8,
>> h_mode=Adafruit_BME280.BME280_OSAMPLE_8)
>> degrees = sensor.read_temperature()
>> pascals = sensor.read_pressure()
>>
>> print (degrees)
>> print (pascals)
>>
>> The output of that is:
>>
>> 25.034087635501418
>> 99871.16464771295
>>
>> However, when I try to get Weewx to read the data from the BME280, the
>> output of the syslog on a restart never gets past these lines:
>>
>> Sep 29 22:55:45 raspberrypi systemd[1]: Starting LSB: weewx weather
>> system...
>> Sep 29 22:55:45 raspberrypi weewx[9610] INFO __main__: Initializing weewx
>>
>> version 4.1.1
>> Sep 29 22:55:45 raspberrypi weewx[9610] INFO __main__: Using Python 3.7.3
>>
>> (default, Jul 25 2020, 13:03:44) #012[GCC 8.3.0]
>> Sep 29 22:55:45 raspberrypi weewx[9610] INFO __main__: Platform
>> Linux-5.4.51-v7+-armv7l-with-debian-10.4
>> Sep 29 22:55:45 raspberrypi weewx[9610] INFO __main__: Locale is
>> 'en_US.UTF-8'
>> Sep 29 22:55:45 raspberrypi weewx[9610] INFO __main__: PID file is
>> /var/run/weewx.pid
>> Sep 29 22:55:45 raspberrypi weewx[9598]: Starting weewx weather system:
>> weewx.
>> Sep 29 22:55:45 raspberrypi systemd[1]: Started LSB: weewx weather
>> system.
>>
>> In my weewx.conf, these added lines do not seem to work.
>>
>> [BME280]
>> col_pres = pressure
>> col_temp = ''
>> sl_denominator = 0.99715048109  #
>> https://www.raspberrypi.org/forums/viewtopic.php?t=154262
>> BME280_lib_location = '/home/pi/Adafruit_Python_BME280'
>>
>>
>> [Engine]
>>
>> [[Services]]
>> # This section specifies the services that should be run. They
>> are
>> # grouped by type, and the order of services within each group
>> # determines the order in which the services will be run.
>> prep_services = weewx.engine.StdTimeSynch
>> data_services = ,
>> process_services = weewx.engine.StdConvert,
>> weewx.engine.StdCalibrate, weewx.engine.StdQC,
>> weewx.wxservices.StdWXCalculate, user.weather34.Weather34RealTime
>> archive_services = weewx.engine.StdArchive
>> restful_services = weewx.restx.StdStationRegistry,
>> weewx.restx.StdWunderground, weewx.restx.StdPWSweather,
>> weewx.restx.StdCWOP, weewx.restx.StdWOW, weewx.restx.StdAWEKAS
>> report_services = weewx.engine.StdPrint, weewx.engine.StdReport
>> # following line is the BME280 pressure sensor
>> data_services = user.bme280.bme
>>
>>
>>  I have to comment out  the BME section and the data_services line in the
>>
>> Engine section in order to get Weewx to work properly again.
>>
>> Any ideas on my problem?
>>
>>
>
> --
> 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/570ec2fd-facd-4761-bb75-08fee58f2b84o%40googlegroups.com.
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzgfXkqgOgesbY9d1wf7V4pTtgjNRKtn1UwXhVxtfayhbA%40mail.gmail.com.


Re: [weewx-user] V4.1.1, Responsive skin but no Apparent Temperature graph line

2020-09-29 Thread Glenn McKechnie
Typo, or an old edit not carried over?

The database field should be appTemp (ie: in CamelCase) rather than apptemp.

The responsive skin.conf entry for the [[[dayappTemp]]] graph queries
appTemp so that tallies with the database.

https://github.com/dcapslock/weewx-responsive-skin/blob/master/Responsive/skin.conf

-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzhFdvcQODLxi1XYGYC7FbhyfvJo7dw_b4_xystYnMdhGw%40mail.gmail.com.


Re: [weewx-user] Re: Upgraded raw plugin for MesoWx v0.4.0

2020-09-22 Thread Glenn McKechnie
On 22/09/2020, 'karlch...@googlemail.com' via weewx-user
 wrote:
> i know mesowx is quite dead... but we use the python script to update our
> archive on the server. After a crash of our Raspberry pi we are unable to
> get the sync_lh9 working again... Weewx starts quite normal till an
> unrecoverable exception. Maybe someone can help us.

Mesowx is still alive, although not at lirpa.

The update at github is current...

https://github.com/glennmckechnie/weewx-mesowx

You'll find a weewx4, python3.x version there that is installable via
wee-extension, but differs in installation method and appearance to
what you no doubt have there.

You can go three ways with the problem you are having:-

1) Install the above maintained and updated package.
The downside to that is that it won't have the look and feel of your
current version, and any tweaks you've introduced to it..
Obviously you'll keep your old configuration as a reference,
especially if you have tweaked anything.

Degree of difficulty:  That should install seamlessly but it's meant
for a fresh install. Retrofitting with your existing setup may make it
more complicated than it should be.

2)  Update your sync_lh9 to run with python3.7 (as @tk has already noted)

Degree of difficulty: Should be a fairly straight forward conversion.
If you're familiar with python then very easy!

The file mesowx.py in the above weewx-mesowx repo at github contains
the code of sync_lh9 (or one of lucs versions) as well as raw.py and
retain.py

Line 477 equates to your line 109.
Start there, compare the code and adjust accordingly.

As I recall, there may have been a change to a weewx import as well.

Ah! Compare mesowx.py Line 749 to your line 381??? (or thereabouts)
for that change in the call to weewx.

3) Manually install the mesowx.py script. Add a corresponding
weewx.conf section with adjusted  entries [Mesowx] [[RemoteSync]] to
suit your setup (examples in the README).

Degree of difficulty: Probably a bit convoluted, but it is another approach.


> Problems with mesowx (also in use till today for our archive)
[...]
> __import__(module)
> Sep 21 23:42:59 WSKOSt01 weewx[2739] CRITICAL __main__: File
> "/usr/share/weewx/user/sync_lh9.py", line 109
> Sep 21 23:42:59 WSKOSt01 weewx[2739] CRITICAL __main__:   if
> self.entity_id <> "":
> Sep 21 23:42:59 WSKOSt01 weewx[2739] CRITICAL __main__: 
>
>  ^


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzgGk6LXiScNLuyXMxxs6fQ62K_WdhG3338dvx1eV%3DyMjw%40mail.gmail.com.


Re: [weewx-user] Re: Responsive Skin and Weewx v4.1.1 generating debug messages

2020-09-17 Thread Glenn McKechnie
Excellent.
Good to know.

The Android weewx app looks interesting, I'll put it on the list (of
things ToDo).

On 18/09/2020, Greg from Oz  wrote:
> The forecasts have changed and all looks good with your changes you made to
>
> aussearch.py
>
> I think it is OK to use.
>
>
> On Thursday, 17 September 2020 at 20:36:16 UTC+10 Greg from Oz wrote:
>
>> I use it every day and also use the Android weewx app.
>>
>> https://github.com/evilbunny2008/weeWXWeatherApp which is a really good
>> app.
>>
>> I will see if my forecasts etc change tomorrow.
>>
>>
>> On Thursday, 17 September 2020 20:27:57 UTC+10, Greg from Oz wrote:
>>>
>>> Ok I have downloaded and installed it and have no errors or output.
>>> So either it is working or it is not working and not outputting
>>> anything...... :)
>>> I will let it run and see what happens.
>>>
>>>
>>> On Thursday, 17 September 2020 20:15:59 UTC+10, Glenn McKechnie wrote:
>>>>
>>>> I'm with you Greg, that's definitely a good philosophy. :-)
>>>>
>>>> However if you (or others) want to travel to the edge...
>>>>
>>>> On 17/09/2020, Glenn McKechnie  wrote:
>>>> > https://github.com/weewx/weewx/wiki/WeeWX-v4-and-logging
>>>> >
>>>> > That link has a section at the end under "Maintaining backwards
>>>> > compatibility" which shows the code style that will incorporate both
>>>> > syslog and weeutil.logger style.
>>>> > However, the way ausearch.py has been coded requires a little more
>>>> > work that just dropping that code into it. There are 18 odd syslog
>>>> > statements that would need tweaking.
>>>>
>>>> I've attached a twaked version where it uses the code as per the above
>>>> style.
>>>>
>>>> I can't check this here as I stopped running ausearch.py
>>>>
>>>> If anyone wants to try it, the usual caveats apply.
>>>> Make a back up of the original. Rename the attached file to
>>>> ausearch.py and then replace the original. Restart weewx.
>>>>
>>>> Hopefully I caught all occurences, and that it works as intended.
>>>>
>>>> --
>>>>
>>>>
>>>> Cheers
>>>>  Glenn
>>>>
>>>> rorpi - read only raspberry pi & various weewx addons
>>>> https://github.com/glennmckechnie
>>>>
>>>
>
> --
> 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/76b27197-72e2-4ecb-a765-0b9be1ef452an%40googlegroups.com.
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzhQQUqAkEH%2Btjd32rB3tBYt2p--eA%2BLDzuH-s3G5eBr-w%40mail.gmail.com.


Re: [weewx-user] Re: Responsive Skin and Weewx v4.1.1 generating debug messages

2020-09-17 Thread Glenn McKechnie
:-)

At least it didn't fall at the first hurdle.

As I recall it runs it runs infrequently. Checks the timestamp on the
downloaded files and refetches them when the allowed age is passed.

I probably should reinstall it myself. It was a useful extension.

On 17/09/2020, Greg from Oz  wrote:
> Ok I have downloaded and installed it and have no errors or output.
> So either it is working or it is not working and not outputting
> anything.. :)
> I will let it run and see what happens.
>
>
> On Thursday, 17 September 2020 20:15:59 UTC+10, Glenn McKechnie wrote:
>>
>> I'm with you Greg, that's definitely a good philosophy. :-)
>>
>> However if you (or others) want to travel to the edge...
>>
>> On 17/09/2020, Glenn McKechnie >
>> wrote:
>> > https://github.com/weewx/weewx/wiki/WeeWX-v4-and-logging
>> >
>> > That link has a section at the end under "Maintaining backwards
>> > compatibility" which shows the code style that will incorporate both
>> > syslog and weeutil.logger style.
>> > However, the way ausearch.py has been coded requires a little more
>> > work that just dropping that code into it. There are 18 odd syslog
>> > statements that would need tweaking.
>>
>> I've attached a twaked version where it uses the code as per the above
>> style.
>>
>> I can't check this here as I stopped running ausearch.py
>>
>> If anyone wants to try it, the usual caveats apply.
>> Make a back up of the original. Rename the attached file to
>> ausearch.py and then replace the original. Restart weewx.
>>
>> Hopefully I caught all occurences, and that it works as intended.
>>
>> --
>>
>>
>> Cheers
>>  Glenn
>>
>> rorpi - read only raspberry pi & various weewx addons
>> https://github.com/glennmckechnie
>>
>
> --
> 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/410d2d5e-e023-447d-849f-1c90e949aa4fo%40googlegroups.com.
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzgo1-MaRstUDxs72Jk0SDKfd%2BXsbqxdjT4os6uN9r3chA%40mail.gmail.com.


Re: [weewx-user] Re: Responsive Skin and Weewx v4.1.1 generating debug messages

2020-09-17 Thread Glenn McKechnie
I'm with you Greg, that's definitely a good philosophy. :-)

However if you (or others) want to travel to the edge...

On 17/09/2020, Glenn McKechnie  wrote:
> https://github.com/weewx/weewx/wiki/WeeWX-v4-and-logging
>
> That link has a section at the end under "Maintaining backwards
> compatibility" which shows the code style that will incorporate both
> syslog and weeutil.logger style.
> However, the way ausearch.py has been coded requires a little more
> work that just dropping that code into it. There are 18 odd syslog
> statements that would need tweaking.

I've attached a twaked version where it uses the code as per the above style.

I can't check this here as I stopped running ausearch.py

If anyone wants to try it, the usual caveats apply.
Make a back up of the original. Rename the attached file to
ausearch.py and then replace the original. Restart weewx.

Hopefully I caught all occurences, and that it works as intended.

-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzgm27eLOriS-uHA2v7yeZJWwxyDVCBFaEj-b_r6YeQ5TA%40mail.gmail.com.
import datetime
import pytz
import time
import dateutil.parser
import dateutil.tz
import os.path
import pprint
import xml.etree.cElementTree as ET
import json
from urllib.request import urlopen, Request

import weewx.units
import weeutil.weeutil
from weewx.cheetahgenerator import SearchList

try:
# Test for new-style weewx logging by trying to import weeutil.logger
import weeutil.logger
import logging
log = logging.getLogger(__name__)

def logdbg(msg):
log.debug(msg)

def loginf(msg):
log.info(msg)

def logerr(msg):
log.error(msg)

except ImportError:
# Old-style weewx logging
import syslog

def logmsg(level, msg):
# Replace '__name__' with something to identify your application.
syslog.syslog(level, 'ausearch: %s:' % msg)

def logdbg(msg):
logmsg(syslog.LOG_DEBUG, msg)

def loginf(msg):
logmsg(syslog.LOG_INFO, msg)

def logerr(msg):
logmsg(syslog.LOG_ERR, msg)

#feeslike lookups
DaySummerCoastRanges = { -40: 'Cold', 16: 'Cool', 22: 'Mild', 27: 'Warm', 32: 'Hot', 37: 'Very Hot' }
DaySummerInlandPlains = { -40: 'Cold', 20: 'Cool', 25: 'Mild', 30: 'Warm', 35: 'Hot', 40: 'Very Hot' }
DaySummerTropics = { -40: '-', 35: 'Hot', 40: '-' }

NightSummerSouthRanges = { -40: 'Cold', 10: 'Cool', 15: 'Mild', 18: 'Warm', 22: 'Hot' }
NightSummerNorth = { -40: 'Cold', 13: 'Cool', 18: 'Mild', 21: 'Warm', 25: 'Hot' }
NightSummerTropics = {  -40: 'Cool', 20: '-' }

DayWinterSouthRanges = { -40: 'Very Cold', 10: 'Cold', 13: 'Cool', 16: 'Mild', 20: 'Warm' }
DayWinterNorth = { -40: 'Very Cold', 10: 'Cold', 15: 'Cool', 20: 'Mild', 25: 'Warm' }
DayWinterTropics = { -40: 'Cold', 20: 'Cool', 26: '-' }

NightWinterSouthRanges = { -40: 'Very Cold', 1: 'Cold', 5: 'Cool', 10: 'Mild' }
NightWinterNorth = { -40: 'Very Cold', 5: 'Cold', 10: 'Cool', 15: 'Mild' }
NightWinterTropics = { -40: 'Cold', 13: 'Cool', 18: '-' }

feelslikeDict = {
'DaySummerCoastRanges': DaySummerCoastRanges,
'DaySummerInlandPlains': DaySummerInlandPlains,
'DaySummerTropics': DaySummerTropics,
'NightSummerSouthRanges': NightSummerSouthRanges,
'NightSummerNorth': NightSummerNorth,
'NightSummerTropics': NightSummerTropics,
'DayWinterSouthRanges': DayWinterSouthRanges,
'DayWinterNorth': DayWinterNorth,
'DayWinterTropics': DayWinterTropics,
'NightWinterSouthRanges': NightWinterSouthRanges,
'NightWinterNorth': NightWinterNorth,
'NightWinterTropics': NightWinterTropics
}

feelslikeLocalDefaults = ['DaySummerCoastRanges', 'NightSummerSouthRanges', 'DayWinterSouthRanges', 'NightWinterSouthRanges']

class ausutils(SearchList):
"""Class that implements the '$aus' tag."""

def __init__(self, generator):
SearchList.__init__(self, generator)
self.aus = { "feelslike" : self.feelslikeFunc }

try:
feelslikeLocalList = weeutil.weeutil.option_as_list(self.generator.skin_dict['AusSearch']['feelslike']['feelslikeLocal'])
except KeyError:
feelslikeLocalList = feelslikeLocalDefaults

try:
self.feelslikeLocal = {}

self.feelslikeLocal['DaySummer']  = feelslikeDict[feelslikeLocalList[0]]
self.feelslikeLocal['NightSummer']= feelslikeDict[feelslikeLocalList[1]

Re: [weewx-user] Re: Responsive Skin and Weewx v4.1.1 generating debug messages

2020-09-17 Thread Glenn McKechnie
If memory serves correctly,  you get this behaviour when the code
exclusively uses syslog for logging, and you are running the SLE under
4.x

The linked version of ausearch.py isn't coded with the newer
weeutil.logger alternative (see wiki link below)

ie:- if it has the 'new-style weewx logging' it aligns itself in the
same style / format as the rest of the weewx4.x logs.  If it's only
the syslog module only then it shows as /weewxd.
It also fixes the errant DEBUG output. (when debug=0)

https://github.com/weewx/weewx/wiki/WeeWX-v4-and-logging

That link has a section at the end under "Maintaining backwards
compatibility" which shows the code style that will incorporate both
syslog and weeutil.logger style.
However, the way ausearch.py has been coded requires a little more
work that just dropping that code into it. There are 18 odd syslog
statements that would need tweaking.



On 17/09/2020, Greg from Oz  wrote:
> The logging has /weewxd and not weewx like the rest of the logs:
> Sep 17 19:21:12 jed164* /weewxd:* aussearch: check json file:
> /var/lib/weewx/aussearch/IDN60801.94746.json expires 2020-09-17
> 09:35:00+00:00
> Sep 17 19:21:13 jed164 /weewxd: historygenerator.py: Generated 6 tables in
> 0.52 seconds
> Sep 17 19:21:13 jed164* weewx[*292601] INFO weewx.cheetahgenerator:
> Generated 13 files for report StandardReport in 2.05 seconds
> Sep 17 19:21:14 jed164 weewx[292601] INFO weewx.imagegenerator: Generated
> 14 images for report StandardReport in 0.36 seconds
>
> Don't know if that is a clue or not.
>
>
> On Thursday, 17 September 2020 at 19:19:28 UTC+10 Greg from Oz wrote:
>
>> I have debug = 0 and the output is still going to syslog.
>>
>>
>> On Thursday, 17 September 2020 at 19:17:20 UTC+10 gjr80 wrote:
>>
>>> Looks like standard debug output code to me, albeit using the old syslog
>>>
>>> module rather than the logging module. debug = 0 in weewx.conf should
>>> turn
>>> it off.
>>>
>>> Gary
>>>
>>> On Thursday, 17 September 2020 at 19:09:02 UTC+10 Greg from Oz wrote:
>>>
 I looked at the code and it looks like it is all hard coded in there:
 syslog.syslog(syslog.LOG_DEBUG, "aussearch:
 feelslikeLocal['DaySummer'] = %s" %
 (pprint.pformat(self.feelslikeLocal['DaySummer'])))
 So my guess would be you could comment the log entries out.


 On Thursday, 17 September 2020 at 13:53:17 UTC+10 vk3...@gmail.com
 wrote:

> Greg - the code is working well and that was not what I was saying
> (apparently not very clearly).
> Are you getting a lot of messages in the system log such as:
>
> Sep 17 13:50:18 weather /weewxd[586]: aussearch: feelslikeLocal[
> 'DaySummer'] = {-40: 'Cold', 16: 'Cool', 22: 'Mild', 27: 'Warm', 32:
> 'Hot', 37: 'Very Hot'}
>
> Sep 17 13:50:18 weather /weewxd[586]: aussearch: feelslikeLocal[
> 'NightSummer'] = {-40: 'Cold', 10: 'Cool', 15: 'Mild', 18: 'Warm', 22:
>
> 'Hot'}
>
> Sep 17 13:50:18 weather /weewxd[586]: aussearch: feelslikeLocal[
> 'DayWinter'] = {-40: 'Very Cold', 10: 'Cold', 13: 'Cool', 16: 'Mild',
> 20: 'Warm'}
>
> Sep 17 13:50:18 weather /weewxd[586]: aussearch: feelslikeLocal[
> 'NightWinter'] = {-40: 'Very Cold', 1: 'Cold', 5: 'Cool', 10: 'Mild'}
>
> Sep 17 13:50:19 weather /weewxd[586]: aussearch: check xml file: /var/
> lib/weewx/aussearch/IDN11060.xml expires 2020-09-17 05:55:00+00:00
>
> Sep 17 13:50:19 weather /weewxd[586]: aussearch: xml: checking cache
> sent-time va remote amoc sent-time: IDN11060.xml
>
> Sep 17 13:50:19 weather /weewxd[586]: aussearch: xml: /var/lib/weewx/
> aussearch/IDN11060.xml: sent-time: 2020-09-16T23:12:46Z
>
> Sep 17 13:50:19 weather /weewxd[586]: aussearch: xml: ftp://
> ftp.bom.gov.au/anon/gen/fwo/IDN11060.amoc.xml: sent-time:
> 2020-09-16T23:12:46Z
>
> Sep 17 13:50:20 weather /weewxd[586]: aussearch: check xml file:
> /var/lib/weewx/aussearch/IDV10753.xml expires 2020-09-17
> 06:10:00+00:00
>
> Sep 17 13:50:20 weather /weewxd[586]: aussearch: xml: checking cache
> sent-time va remote amoc sent-time: IDV10753.xml
>
> Sep 17 13:50:20 weather /weewxd[586]: aussearch: xml:
> /var/lib/weewx/aussearch/IDV10753.xml: sent-time: 2020-09-16T19:00:19Z
>
> Sep 17 13:50:20 weather /weewxd[586]: aussearch: xml:
> ftp://ftp.bom.gov.au/anon/gen/fwo/IDV10753.amoc.xml: sent-time:
> 2020-09-16T19:00:19Z
>
> Sep 17 13:50:20 weather /weewxd[586]: aussearch: check xml file:
> /var/lib/weewx/aussearch/IDQ11295.xml expires 2020-09-17
> 06:15:00+00:00
>
> Sep 17 13:50:21 weather /weewxd[586]: aussearch: xml: checking cache
> sent-time va remote amoc sent-time: IDQ11295.xml
>
> Sep 17 13:50:22 weather /weewxd[586]: aussearch: xml:
> /var/lib/weewx/aussearch/IDQ11295.xml: sent-time: 2020-09-16T18:40:09Z
>
> Sep 17 13:50:22 weather /weewxd[586]: aussearch: xml:
> 

Re: [weewx-user] weewx-Weather34 installation questions

2020-09-10 Thread Glenn McKechnie
On 10/09/2020, ExprmntAl <72604.3...@compuserve.com> wrote:
> Tried your suggestion and still no go.  See below.
>
> *pi@raspberrypi:~ $ sudo apt-get install libapache2-mod-php*
> *Reading package lists... Done*
> *Building dependency tree*
> *Reading state information... Done*
> *libapache2-mod-php is already the newest version (2:7.3+69).*
> *The following packages were automatically installed and are no longer
> required:*
> *  libexiv2-14 libgfortran3 libgmime-2.6-0 libncurses5 libssl1.0.2
> rpi-eeprom-images*
> *Use 'sudo apt autoremove' to remove them.*
> *0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.*
> *pi@raspberrypi:~ $ sudo a2enmod php7.3*
> *Considering dependency mpm_prefork for php7.3:*
> *Considering conflict mpm_event for mpm_prefork:*
> *Considering conflict mpm_worker for mpm_prefork:*
> *Module mpm_prefork already enabled*
> *Considering conflict php5 for php7.3:*
> *Module php7.3 already enabled*
> *pi@raspberrypi:~ $ sudo systemctl restart apache2*
> *pi@raspberrypi:~ $ *

Everything you have done above allows a php file to be executed by
your webserver and therefore the html content generated and displayed
in the browser that views it.

> This is how I am entering the address in Chromium on the RPi.
>
> file://www/html/weewx/weather34/index.php

That's never going to work.

When you use the file://  method of browser access you are accessing
the file via your filesystem. You are bypassing the php interpreter
that you installed on your webserver. The browser does not know what
to do with it, so it displays it (the php contents) Nothing gets
executed. Nothing has been converted to html.

You need to access that file via
http://your_web_server_with_php_enabled/weewx/weather34/index.php

> The address "file://www/html/weewx/index.html" seams to work fine for the
> seasons skin so I have been going off the assumption that a similar address

It's a html file, the browser knows what to do with html. It displays it.

> format to the php file should work as well but when I click enter, it just
> downloads the index.php file instead of opening it in the browser.

Yep, that's exactly what it will do - no interpreter is available. No
html is generated. Access it via your webserver and you will get the
html page it generates.

-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAziEOyfWE3xByVhjgzA_xfw7ruxu1nvyAwd1OO1j06UokQ%40mail.gmail.com.


Re: [weewx-user] Re: Daily climatological summaries

2020-09-06 Thread Glenn McKechnie
:-))

Yes. You've gotta love the logs, and that weewx flagged the error.

This did highlight one bug with the configuration so we've both come
away with something.



On 07/09/2020, Mikael Fredriksson  wrote:
> Glenn,
>
> I did a test and changed the NTC to FtoC around the 207 line in index.php.
> And that changed the values in the tables.
> Had no idea why the change in skin.conf didn't hit the tables but I now
> think I know what it was after I looked at the syslog!
>
> These lines,
>
> 6 20:29:18 raspberrypi wee_reports[10137] ERROR weewx.reportengine: Failed
> to read skin configuration file /etc/weewx/skins/wxobs/skin.conf for report
> 'wxobs': Invalid line (u' Only for the one/s you need.') (matched as
> neither section nor keyword) at line 207.
> Sep  6 20:29:18 raspberrypi wee_reports[10137] ERROR weewx.reportengine:
> Syntax error: Invalid line (u' Only for the one/s you need.')
> (matched as neither section nor keyword) at line 207.
> Sep  6 20:29:18 raspberrypi wee_reports[10137] ERROR weewx.reportengine:
>    Report ignored
>
> ...pointed me to a line in skin.conf where I had removed the # in that
> line.
> I think that everything is ok now, I did a test and manually change back the
> FtoC to NTC and see if they change again at the archive run and they did.
>
> So Glenn, I'm sorry that I missed this and you had to do all that writing, I
> will definitely first look at my syslog when things don't turn out the way
> they're expected to do!
>
> Case closed.
> /Mikael
>
>
> --
> 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/4acbabb6-7f08-40d5-9435-4dfb0c399ebao%40googlegroups.com.
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzhQxAbRRkKUm0LL8cE5WQ%3DwZfqC%2B4qpSKzBVCnE_Pa6ow%40mail.gmail.com.


Re: [weewx-user] Re: Daily climatological summaries

2020-09-05 Thread Glenn McKechnie
Mikael,

The report_timing stanza that you currently have under the wxobs
section in weewx.conf generates the report once every hour.
That means that any changes you make to the configuration files will
not be propagated to the report pages (webserver) until the clock
chimes on the hour.
If you're not aware of that, it can make troubleshooting a real 'hair
pulling' exercise! What you change will not appear when you expect it.
Comment that line out until everything is working, then re-instate it
if you want to save some CPU cycles.

restart weewx when it's commented out.

This is not a bug that I can reproduce here (I'm running version 0.7.2).
Any temperature changes , combinations, that I make here to skin.conf
in this version are acted on and the generated page (index.php)
adjusts itself accordingly.

If you still have the temperature_convert line uncommented in
wxobs/skin.conf  as you had before...
 temperature_convert = FtoC # degree F in database to degree C in report
then any database values for temperature will have the FtoC conversion
applied. That conversion is found in the webservers index.php file
found on (line 103)

function FtoC($x)
{
return ($x - 32.0) * 5.0 / 9.0;
}

If that skin.conf option has been selected (as you've done) , and is
being applied to the generated index.php file then the calls to it
will be made from various locations such as found around line 711 (and
others)...

echo "$metTemp";
$x = FtoC ($latest_row[2]);
$metappTemp = round($x, 1);
echo "$metappTemp";
$x = FtoC ($latest_row[3]);
$metdew = round($x, 1);

That FtoC fuction name can be one of 3 things. FtoC, CtoF or NTC
(NoTemperatureCoversion)

If you have anything other than FtoC then the index.php script is not
being generated correctly.

As it's a skin.conf option, any changes you make will be propagated
through to index.php on the next report cycle (archive interval).

Check that what I've outlined above has been applied to your index.php
file. You can also also check it after you've changed CtoF or no
conversion (NTC) when the values should change accordingly.

If nothing is changing, then we need to dig a lot deeper and to do
that we'll take it off-list, to my address in these headers.

Send me your full syslog, the last copy of wxobs/index.php and your
weewx.conf (run that file through wee_debug and check that it's been
correctly stripped of passwords before sending).





On 06/09/2020, Mikael Fredriksson  wrote:
> Glenn, thank you for your answer!
>
> I did the change and moved those lines to weewx.conf, then I restarted
> Weewx.
> But this doesn't change the values unit. It's still in US unit (F).
> I hope that it was clear that I meant the values, not the labels.
>
> I looked at the section How options work in the Customizing Guide that TK
> pointed at but I can't figure out if that could help me... I feel that it is
> a little too advanced for me at this point.
>
> This is how it looks in weewx.conf after the change.
>
> [[wxobs]]
> HTML_ROOT = /var/www/html/weewx/wxobs
> skin = wxobs
> report_timing = 0 * * * *
>  [[[Units]]]
> Groups
> group_rain= mm
> group_temperature = degree_C
> group_speed   = km_per_hour
>
> What else can I provide to get help to sort this out?
>
> /Mikael
>
> --
> 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/3fe91512-4cc9-4fa5-b58a-b1abb45bd8c1o%40googlegroups.com.
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzir84oABaz-bWYki63jxwoHVH2rQXhP%2BD0PbicGVFnaow%40mail.gmail.com.


Re: [weewx-user] Re: Daily climatological summaries

2020-09-04 Thread Glenn McKechnie
On 05/09/2020, Mikael Fredriksson  wrote:
> Hi Glenn!
>
> Can't get the conversion for database units to change.
> This is how my skin.conf fill looks now (part under phpunits)
>
> # Uncomment as appropriate...
>  Only for the one/s you need.
> # Only from the group/s you need.
> # If you don't need a conversion performed then do nothing, leave
> them
> # all commented out.
>
> #temperature_convert = CtoF #degree C in database to degree F in
> report
>  temperature_convert = FtoC # degree F in database to degree C in
> report
>
> #group_direction   = degree_compass
> #group_percent = percent
> #group_pressure= hPa# Option inHg, mmHg , mbar or hPa
> group_rain= mm # Option are inch , cm or mm
> group_temperature = degree_C   # Option are degree_F or degree_C
> group_speed   = km_per_hour # Option are mile_per_hour
> km_per_hour
> # or meter_per_second
>
> But still I get the values in F in the observation page.
>
> Do you know what I could have missed?

You've missed nothing, and I was surprised to be able to duplicate it here.

Turns out there is nothing wrong with the code, but a change that was
brought in with weewx 3.9 (02/05/2019) has finally caught up with
wxobs and the way I specified the labels. The Defaults section was
moved to [StdReport] so entries made there will apply to *all* skins
and they have precedence over anything in skin.conf

http://weewx.com/docs/customizing.htm#How_options_work

The fix is... The section within wxobs/skin.conf [Units] [[Groups]]
that refers to the Group units (which wxobs uses to generate the
labels) needs to be moved into the [[wxobs]] section within weewx.conf

Using your case above, the entries in wxobs/skin.conf...

 group_rain= mm # Option are inch , cm or mm
 group_temperature = degree_C   # Option are degree_F or degree_C
 group_speed   = km_per_hour # Option are mile_per_hour

are moved to weewx.conf so that it will appear something like (your
path may be different)...
[StdReport]
[...]
[[wxobs]]
skin = wxobs
HTML_ROOT = /var/www/html/weewx/wxobs
[[[Units]]]
Groups
group_rain= mm # Option are inch , cm or mm
group_temperature = degree_C   # Option are degree_F or degree_C
group_speed   = km_per_hour # Option are mile_per_hour

Because these changes will now be read from weewx.conf, you will need
to restart weewx for them to take affect.

n.b. The [[PHPUnits]] section remains in wxobs/skin.conf. It does not
get moved. It is specific to wxobs.inc and weewx would probably spit
out an error if it had to parse it.

This all assumes that your database is in US units (thus why you are
converting from F to C)
and that your weewx.conf file has the section Std Reports with entries like...
[StdReport]  [[Defaults]]   [[[Units]]]   Groups

Try it and let me know if this does indeed fix your problem. I'll then
adjust the notes / installer  in wxobs to suit.

Thanks for catching it and for bringing it to my attention.

-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAziKtCfEpC_bGY0%2B1JeXDMfWGx6KCjUrHJTuzw%3DL%2BEcrHA%40mail.gmail.com.


Re: [weewx-user] Re: Daily climatological summaries

2020-09-02 Thread Glenn McKechnie
Have a look at wxobs.

I based that on Powerin's work (they started this thread)

https://github.com/glennmckechnie/weewx-wxobs

On 03/09/2020, Mikael Fredriksson  wrote:
> were there ever shared a script for this?
> /Mikael
>
> --
> 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/9535d20d-f966-4ffb-b477-fe1b36323f2co%40googlegroups.com.
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzgbV0fC_6v5BYXd40WnhRzPf7N5DqpKz5t8XfJ7MuXFWg%40mail.gmail.com.


Re: [weewx-user] Trouble with Vaisala driver - syslog not defined

2020-08-13 Thread Glenn McKechnie
Ah. Thanks Gary, that makes more sense.

@Chris
Gary's correction has been applied to this attachment wxt5x0-trimmed2.py
and has the following diff...

02:49 PM $ diff -u2r wxt5x0.py wxt5x0-trimmed2.py
--- wxt5x0.py   2020-08-14 13:00:54.026076071 +1000
+++ wxt5x0-trimmed2.py  2020-08-14 14:46:56.535608367 +1000
@@ -80,6 +80,5 @@

 def logmsg(level, msg):
-syslog.syslog(level, 'sdr: %s: %s' %
-  (threading.currentThread().getName(), msg))
+syslog.syslog(level, 'wxt5x0: %s' % (msg,))

 def logdbg(msg):
@@ -112,18 +111,4 @@
 return WXT5x0ConfigurationEditor()

-
-def logmsg(level, msg):
-syslog.syslog(level, 'wxt5x0: %s' % msg)
-
-def logdbg(msg):
-logmsg(syslog.LOG_DEBUG, msg)
-
-def loginf(msg):
-logmsg(syslog.LOG_INFO, msg)
-
-def logerr(msg):
-logmsg(syslog.LOG_ERR, msg)
-
-
 def _fmt(x):
 """
@@ -491,5 +476,5 @@
 def hardware_name(self):
 return self._model
-
+
 def genLoopPackets(self):
 while True:



On 14/08/2020, gjr80  wrote:
> Glenn,
>
> I think you will find the threading reference in the wxt5x0 driver is an
> incomplete cut and paste when Matthew was updating the wxt5x0 driver
> logging code with that from the sdr driver. You can drop the threading
> import and change:
>
> def logmsg(level, msg):
> syslog.syslog(level, 'sdr: %s: %s' %
>   (threading.currentThread().getName(), msg))
>
> to
>
> def logmsg(level, msg):
> syslog.syslog(level, 'wxt5x0: %s' % (msg,))
>
> Gary



-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzgH2Bwc0Scep9SajoXnrXfnPJ_MZ2yntkLNAQrp8A0H7g%40mail.gmail.com.
#!/usr/bin/env python
# Copyright 2017 Matthew Wall, all rights reserved
"""
Collect data from Vaisala WXT510 or WXT520 station.

Thanks to Antonis Katsonis for providing a Vaisala WXT520 for development.

http://www.vaisala.com/Vaisala%20Documents/User%20Guides%20and%20Quick%20Ref%20Guides/M210906EN-C.pdf

The WXT520 is available with the following serial communications:
 - RS232: ASCII automatic and polled; NMEA0183 v3; SDI12 v1.3
 - RS485: ASCII automatic and polled; NMEA0183 v3; SDI12 v1.3
 - RS422: ASCII automatic and polled; NMEA0183 v3; SDI12 v1.3
 - SDI12: v1.3 and v1.3 continuous

This driver supports only ASCII communications protocol.

The precipitation sensor measures both rain and hail.  Rain is measured as a
length, e.g., mm or inch (so the area is implied).  Hail is measured as hits
per area, e.g., hits per square cm or hits per square inch.

The precipitation sensor has three modes: precipitation on/off, tipping bucket,
and time based.  In precipitation on/off, the transmitter ends a precipitation
message 10 seconds after the first recognition of precipitation.  Rain duration
increases in 10 second steps.  Precipitation has ended when Ri=0.  This mode is
used for indication of the start and the end of precipitation.

In tipping bucket, the transmitter sends a precipitation message at each unit
increment (0.1mm/0.01 in).  This simulates conventional tipping bucket method.

In time based mode, the transmitter sends a precipitation message in the
intervals defined in the [I] field.  However, in polled protocols the autosend
mode tipping bucket should not be used as in it the resolution of the output
is decreased (quantized to tipping bucket tips).

The precipitation sensor can also operate in polled mode - it sends a precip
message when requested.

The rain counter reset can be manual, automatic, immediate, or limited.

The supervisor message controls error messaging and heater.
"""

# FIXME: test with and without error messages
# FIXME: test with and without crc

# FIXME: need to fix units of introduced observations:
#  rain_total
#  rain_duration
#  rain_intensity_peak
#  hail_duration
#  hail_intensity_peak
# these do not get converted, so LOOP and REC contain mixed units!
# also, REC does not know that rain_total is cumulative, not delta
# note that 'hail' (hits/area) is not cumulative like 'rain_total' (length)

from __future__ import with_statement
import time

import weewx.drivers

try:
# New-style weewx logging
import weeutil.logger
import logging
log = logging.getLogger(__name__)

def logdbg(msg):
log.debug(msg)

def loginf(msg):
log.info(msg)

def logerr(msg):
log.error(msg)

except ImportError:
# Old-style weewx logging
import syslog

def logmsg(level, msg):
syslog.syslog(level, 'wxt5x0: %s' % (msg,))

def logdbg(msg):
logmsg(syslog.LOG_DEBUG, msg)

def loginf(msg):
logmsg(syslog.LOG_INFO, 

Re: [weewx-user] Trouble with Vaisala driver - syslog not defined

2020-08-13 Thread Glenn McKechnie
Using https://github.com/matthewwall/weewx-wxt5x0/blob/master/bin/user/wxt5x0.py

In the absence of Mathews expertise, try the attached copy of that
original file.
Save yours, replace it with the attached wxt5x0-trimmed.py file (yes, rename it)
Restart weewx.


I'm no expert, so fingers crossed ;-)


It removes the duplicate syslog code between lines 114 and 126
It also imports the threading module to satisfy pyflakes.

ie:-
01:04 PM $ diff -u2r wxt5x0.py wxt5x0-trimmed.py
--- wxt5x0.py   2020-08-14 13:00:54.026076071 +1000
+++ wxt5x0-trimmed.py   2020-08-14 12:50:56.169586563 +1000
@@ -78,4 +78,5 @@
 # Old-style weewx logging
 import syslog
+import threading

 def logmsg(level, msg):
@@ -112,18 +113,4 @@
 return WXT5x0ConfigurationEditor()

-
-def logmsg(level, msg):
-syslog.syslog(level, 'wxt5x0: %s' % msg)
-
-def logdbg(msg):
-logmsg(syslog.LOG_DEBUG, msg)
-
-def loginf(msg):
-logmsg(syslog.LOG_INFO, msg)
-
-def logerr(msg):
-logmsg(syslog.LOG_ERR, msg)
-
-
 def _fmt(x):
 """
@@ -491,5 +478,5 @@
 def hardware_name(self):
 return self._model
-
+
 def genLoopPackets(self):
 while True:




On 14/08/2020, Chris Howard  wrote:
> The driver author is Matthew Wall.  His github site was pretty active until
>
> June and then it has gone quiet.
> With the state of the world these days, it's hard to know what that means.
>
> I hope the guy is healthy
> and lounging on a beach somewhere.
>
> Until his return, is there a document or someone who can help me sort out
> the 3v-4v differences?
>
>
>
> --
> 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/2dbdebb0-3fb8-458c-a2ad-17ae19931a5do%40googlegroups.com.
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAziD_omLWo%3DhpGJgbF4gdScvsiBJzJqTx-3_jP2b9t2Qvg%40mail.gmail.com.
#!/usr/bin/env python
# Copyright 2017 Matthew Wall, all rights reserved
"""
Collect data from Vaisala WXT510 or WXT520 station.

Thanks to Antonis Katsonis for providing a Vaisala WXT520 for development.

http://www.vaisala.com/Vaisala%20Documents/User%20Guides%20and%20Quick%20Ref%20Guides/M210906EN-C.pdf

The WXT520 is available with the following serial communications:
 - RS232: ASCII automatic and polled; NMEA0183 v3; SDI12 v1.3
 - RS485: ASCII automatic and polled; NMEA0183 v3; SDI12 v1.3
 - RS422: ASCII automatic and polled; NMEA0183 v3; SDI12 v1.3
 - SDI12: v1.3 and v1.3 continuous

This driver supports only ASCII communications protocol.

The precipitation sensor measures both rain and hail.  Rain is measured as a
length, e.g., mm or inch (so the area is implied).  Hail is measured as hits
per area, e.g., hits per square cm or hits per square inch.

The precipitation sensor has three modes: precipitation on/off, tipping bucket,
and time based.  In precipitation on/off, the transmitter ends a precipitation
message 10 seconds after the first recognition of precipitation.  Rain duration
increases in 10 second steps.  Precipitation has ended when Ri=0.  This mode is
used for indication of the start and the end of precipitation.

In tipping bucket, the transmitter sends a precipitation message at each unit
increment (0.1mm/0.01 in).  This simulates conventional tipping bucket method.

In time based mode, the transmitter sends a precipitation message in the
intervals defined in the [I] field.  However, in polled protocols the autosend
mode tipping bucket should not be used as in it the resolution of the output
is decreased (quantized to tipping bucket tips).

The precipitation sensor can also operate in polled mode - it sends a precip
message when requested.

The rain counter reset can be manual, automatic, immediate, or limited.

The supervisor message controls error messaging and heater.
"""

# FIXME: test with and without error messages
# FIXME: test with and without crc

# FIXME: need to fix units of introduced observations:
#  rain_total
#  rain_duration
#  rain_intensity_peak
#  hail_duration
#  hail_intensity_peak
# these do not get converted, so LOOP and REC contain mixed units!
# also, REC does not know that rain_total is cumulative, not delta
# note that 'hail' (hits/area) is not cumulative like 'rain_total' (length)

from __future__ import with_statement
import time

import weewx.drivers

try:
# New-style weewx logging
import weeutil.logger
import logging
log = 

Re: [weewx-user] Re: Converting data from HW that is in metric to display in US

2020-08-07 Thread Glenn McKechnie
@Randy, (and later @Tom) and anyone else with input !

Nothing to do with your units problem, but that weather34 error is
possibly why you have no data coming in. The cluttered log shows you
have 2 weewx processes running.

One - PID  [1963] is caught up trying to get weather34 running (which
fails with a "Bad Request')

The others [3753] and then the last one at PID [4352] - try to run and
are then blocked
with a "OSError: [Errno 98] Address already in use"  and I'd suspect
that's because  weewx [1963] is holding it open

Can't help you with any of your main problem, but I'd suggest fixing,
or better yet just move weather34 out of the way so that it is not
interfering with the main engine,

Kill all weewxd instances. To find them...

 ps aux | grep [w]eewxd

 kill -9 1963

 kill -9 

Disable the weather34 skin (Probably under [StdReport][[weather34]] ?)

@Tom,
I'm using my full quotient of brain cells on this log, but it appears
that when weewx does a forced restart, it does so without killing PID
[1963] which appears to be started by systemd at 07:14:28

Should this be dealt with by weewx on the forced restart?

Points of interest, from the syslog

Aug  7 07:14:28 raspberrypi systemd[1]:
[...]
Aug  7 07:14:32 raspberrypi weewx[1959] INFO __main__: PID file is
/var/run/weewx.pid
Aug  7 07:14:32 raspberrypi weewx[1963] INFO __main__: Using
configuration file /etc/weewx/weewx.conf


Aug  7 10:30:41 raspberrypi weewx[1963] ERROR user.weather34: [...]
Error: HTTP Error 401
[...]
Aug  7 10:34:51 raspberrypi weewx[3753] INFO __main__: Initializing
weewx version 4.1.1
[...]
Aug  7 10:40:40 raspberrypi weewx[1963] ERROR user.weather34: Failed
 [...]
Aug  7 10:39:37 raspberrypi weewx[3753] CRITICAL __main__: 
RuntimeError: can't start new thread
Aug  7 10:39:37 raspberrypi weewx[3753] CRITICAL __main__:   Exiting.
[...]
Aug  7 10:41:46 raspberrypi weewx[4352] INFO __main__: Initializing
weewx version 4.1.1
[...]
Aug  7 10:45:40 raspberrypi weewx[1963] ERROR user.weather34: Failed

-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzgifQQnqkbG%3DkjPoGib3nrKuGc_%2Btb4B-sUv5k0FXLHTA%40mail.gmail.com.


Re: [weewx-user] Re: wunderfixer isn't working properly - uploaded data is not stored at WU

2020-07-17 Thread Glenn McKechnie
On 15/07/2020, Tom Keffer  wrote:
> Problems with the WU database are so legendary, one could write a haiku
> about it...
>
> errors have occurred
> we won't tell you why or how
> your post is ignored


parser add option
wunderfixer cannot help
we got empty string




-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzgs0UvZEOrgbNk12cZcEar%3DUgWx%2Bu3MB7%2BKbeDPgpTEXw%40mail.gmail.com.


Re: [weewx-user] Graphs not updating

2020-06-21 Thread Glenn McKechnie
On 22/06/2020, michael form  wrote:
> I am not sure why the Pi would restart as it is powered by a UPS so the
> issue is somewhat of a mystery why it got confused. A second Pi, also
> running Weewx, powered by the same UPS did not run into any problems.

Have a look in syslog (or syslog.1 or older gz file) and see if there
is a hint in there.
It may have run out of memory in which case they will reboot if the
memory killer can't resolve it.


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAziaaVxk4%2BRPR6i%3DzbHTftp4_-nnpjcB1GK%2B_6ehQrU%2BRw%40mail.gmail.com.


Re: [weewx-user] Suggestions on best way to upgrade to 4.1.1

2020-06-21 Thread Glenn McKechnie
On 22/06/2020, michael form  wrote:
> Glenn:
>
> I will follow up on what you said and hopefully, things will go smoothly
> with the upgrade to 4.1.1.

To be hoped.
And let us know either way.  :-)

Information is king.

Hopefully I've supplied enough over on my fork, I've update the readme
with a note to read the pydoc output at bin/user/pydoc_owfs.txt which
is in the repo (also the zip file) if you need to know more (possibly
than you want to) about some of the quirks of the drivers
installation.

If you find them lacking in some measure, let us know, here or at github.

When you're close to something it takes a special skill to write good
documentation as we all tend to make assumptions from our own
knowledge base.

Now that this driver can run with 1 of 2 modules, as well as the 2
python versions involved it's all got a lot more complicated and
that's without adding owserver and the busmaster devices into the mix.

>From your end.

1.
If you need to send a log extract, include plenty of it, and forget
about sending the short systemd log. Make it a copy, or large extract
from syslog, from start to finish.
The owfs.py driver will log the module it is using straight after
weewx starts up and that alone is valuable information. weewx also
logs the python version that it is using and that is also essential in
this case.

2.
Need to know the complete [OWFS] entry from weewx.conf, In fact, it's
best to use the  wee_debug tool and send the lot.

3.
Finally your complete /etc/owfs.conf file

> I will certainly let you know if it doesn't. :)

:-) And when it does work!

Good luck.

> Michael


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzi6bqdzZsDQkOEtS-3CMYaxrj6CcQ0t5zJK59vjZCSUDw%40mail.gmail.com.


Re: [weewx-user] Suggestions on best way to upgrade to 4.1.1

2020-06-21 Thread Glenn McKechnie
On 22/06/2020, Michael Form  wrote:
> Tom:
>
> Thank you for your response. I was aware of this issue which is the
> reason that I asked if there was a way around it. The thread does not
> seem to indicate a solution.

That thread was restarted as "V4 with python2 OWFS errors" and was
resolved there, with two working installations at the finish of it.
One with python2.7, the other with python3.

I also have direct access to 3 weewx4 installs, 2 under Debian Buster
and 1 under Devuan ascii. They all use owserver with either python-ow,
python3-ow (yep, python3-ow) or pyownet  running owfs.py. They all
work with either python2.7 or python3 (dual installations)

https://groups.google.com/d/topic/weewx-user/FqGbLbH0Gcs/discussion

[...]
> If there is no solution to using owfs under Python 3, how do I install 4.1.1 
> and specify to use Python 2?

python3-ow has disappeared from the repos but the modified driver will
use pyownet as a drop in replacement. So you can run weewx4 and
owfs.py with either python version.

If you install weewx4, whether you use python2.7 or 3, you will be
using a different driver to the owfs.py driver you are using now. (I
don't think the 0.21 owfs.py driver was officially ported? You could
of course try it anyway with a weewx4/python2.7 install but I'd expect
it to fail.)

In short , there is a version of owfs which runs under weewx4 and
python3, or python2.7

The driver at

https://github.com/matthewwall/weewx-owfs

had some issues which were resolved in that second thread by using my fork at

https://github.com/glennmckechnie/weewx-owfs

My fork definitely works for weewx4 and python3 or python2.7 and if it
doesn't I'll do my best to fix it. That fork is also in mathews long
queue to be merged (where appropriate) back into his long standing,
and supported, driver so there is and will be ongoing support for owfs
from the one source.

The only issue left is with owserver and that has a possible solution
for a vague problem. And that's if it is even an issue on your
installation. The readme.txt on my fork covers what has changed and
solutions where they are known.
It also covers the configuration of owserver.

I'm not sure whether you are running owserver (I've lost track along
the way) and if you were uncertain, then installing owserver first and
seeing if it starts and runs for you would be one approach before
actually committing to any change.

Rest assured, if you go the down the path of weewx4 and owfs.py you
won't be left stranded by weewx-user and issues with owfs.py

My only nervousness is with owserver as there has been no definitive
solution for that vague, but occasional, show stopping issue. Once
owserver does start it seems to keep going, judging by the silence -
go figure!

I should add, the issue with owserver is a system issue (Buster
specifically), it is not a weewx issue. That's why if you have
owserver  running already then I don't see any problem, The owfs.py
driver is working, and it can be modified if need be.

-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzhQQ1%3Db_bhJn%2By1227UBWTi6%2B70ycccb%2Bs-SRcXKS6idA%40mail.gmail.com.


Re: [weewx-user] Re: RSYNC

2020-06-10 Thread Glenn McKechnie
On 11/06/2020, Jose  wrote:
[...]
>
>  rsync -a --delete -e ssh /home/pi/backup.tar.gz  user@ssh.hosting:/www/
> backup/ &> /dev/null
>
> this command worked fine in the past but not now. When I run this command
> nothing happens, no updating remote hosting and even no error messages. so
> RSYNC with WeeWX is working fine but RSYNC in command line don't.

Just focusing on your statement that you see no errors with the above command.
It's doing exactly what you've told it to, that you want no feedback
from it, ever. It's dead to you.
Send whatever it has to say (&>) to the bit bucket (/dev/null)

Remove that redirect that you have on the end and it will probably
offer up a few clues.

rsync -a --delete -e ssh /home/pi/backup.tar.gz  user@ssh.hosting:/www/ backup/

-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzib7-a4i29QLD7TPirOEomj5Ntx2Py8NDseT3dCGHYFNA%40mail.gmail.com.


Re: [weewx-user] Re: Stuck with new install

2020-06-02 Thread Glenn McKechnie
On 03/06/2020, Jamie Stephens  wrote:
> The att bed season log is the debug log

the session.log you attached is the weewx.conf file.

The output from the system log is required.

https://github.com/weewx/weewx/wiki/Help!-Posting-to-weewx-user

-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzgq9bu3Wy8nNeJ%2BBdgEX9zgrRmmppRgwYvoP%2B1kBvO-QQ%40mail.gmail.com.


Re: [weewx-user] Confusion on installing Weewx 4.1

2020-05-28 Thread Glenn McKechnie
On 28/05/2020, michael form  wrote:
> Hello:
>
> I am confused about what is necessary to install Weewx 4.1 using Python 3.
> I have seen many problems with people trying to do this using a *1-Wire
> interface* like I am using on a Raspberry Pi, running Buster.

The biggest hurdle was the requirement to run owserver and the problems
some were encountering when starting it under systemd. That has possibly
been solved with Nevilles find and that is documented in the readme at...

https://github.com/glennmckechnie/weewx-owfs

But, I believe you now have a working owserver so that issue is mute.

> Others seemed to have better luck installing Weewx using Python 2. I am a
> hardware  designer, not a Linux expert, so that might be the problem. :)
> With the help of this user group (especially Glenn) I am currently running
> Weewx 3.9 using Python 2.7 on a pair of Raspberry Pi's.Thanks to everyone.

> 1. Can Weewx 4.1 be installed using Python 3 using the *1-Wire *interface?*

I'm running that combination: 4.1 with python 3.

> If so, any special steps?*

For 1-wire? Only the steps that are being refined in the various threads
(obviously the latest thread holds the latest updates).
If you have owserver running now, there is no (good) reason why it will stop
running if you swap to python 3.
Mathews owfs.py picks up the the appropriate module seamlessly. I know
with certainty that the versions in my fork work.
You have a working configuration in weewx.conf so the steps should really
be minimal.

> I tried following the Installation Guide to install on a test Ubuntu system
> but got errors about Cheetah 3 not found (or something like that).

Pass.
Each distro will have its own quirks as it plays catch up with the
python 3 push.
For a pi I'd stick to raspbian or whatever they are calling it now -
Raspberry Pi OS?

> 2. What is the benefit of using Python 3 rather than Python 2 (other than 3
> is supported)?

If you have a working install and it's doing what you want then
there's probably no reason to change.
It's only if you need to do an operating system update, or want to try
another skin, weather station, use another data source that you may
run into issues, but that's all crystal ball stuff.

It's probably not so much that 3 is supported, it's that main stream
support for 2.7 has dried up. With a vengeance in some cases. That
leaves us playing catch up, but dare I say it ... actually winning!


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzi5i1w577XWzVO5yLttQYBsF9m9Dh72y6TdXgLCoS%2BEjg%40mail.gmail.com.


Re: [weewx-user] V4 with python2 OWFS errors

2020-05-27 Thread Glenn McKechnie
Really good to hear of another success!

I've just bumped mine to weewx v4.1.0 and that's also working like a charm.

I know the feeling with the heavy rain. Thankfully it's only ever been
phantom downfalls and therefore easily fixed.


On 28/05/2020, Neville Davis  wrote:
> Glenn
>
> Success my system is fully operational with python 3.7 weewx v4.0.0 with
>  1Wire rain, and my i2C sensor system, with ow-server and pyownet.
>
> For your information Glenn I am using your OWFS-dallas.py downloaded
> yesterday.after my silly mistake  we are lo longer under several meters
>
> of water falling in one loop cycle  :)
>
> Now I just need to get my old skins working under python3..
>
> regards
>
> Neville
>
> On Wednesday, May 27, 2020 at 8:15:07 PM UTC+10, Neville Davis wrote:
>>
>> Thanks very much Glen I will do the mods in the morning.
>> I had specified a sensor type in my old system...but just forgot..
>>
>> Neville
>>
>> On Wednesday, May 27, 2020 at 5:31:30 PM UTC+10, Glenn McKechnie wrote:
>>>
>>> Hi Neville,
>>>
>>> Within the [OWFS] section of weewx you need to specify a [[sensor_type]]
>>>
>>>
>>> Firstly, you are correct with the count incrementing when the bucket
>>> tips but you need to turn that into a time based value
>>> A rain value is evaluated as the difference between the current count
>>> and the last count for the time it was taken.
>>> This is where the sensor_type comes into it.
>>>
>>> owfs.py provides the function rainwise_bucket that assumes there is
>>> 0.1 " per tip ( 0.0254cm ) of the tipping bucket. By comparing the
>>> current count with the last reading (count) taken, and knowing the
>>> times involved it returns the measurement in cm.
>>>
>>> So, to enable that function you need to specify the following after
>>> your [sensor_map] section
>>>
>>> [[sensor_type]]
>>> rain = rainwise_bucket
>>>
>>> Once that's done you'll find the maths is taken care of and tipping
>>> water into the bucket will register a meaningful volume / measure.
>>> If it's not 0.01" per tip you can adjust that value by using the
>>> [StdCalibrate][[Corrections]] section of weewx.conf
>>>
>>> Incidentally. You have owfs.py configured as a Driver and as a
>>> Service. I'm thinking you only want the Service side of it, that way
>>> it supplements your main stations data.
>>>
>>> If that assumption is correct, remove the "driver = user.owfs " line
>>> from the [OWFS] section. Leave the [Engine][[Services]] data_services
>>> = user.owfs.OWFSService as it is
>>>
>>>
>>>
>>>
>>> On 27/05/2020, Neville Davis  wrote:
>>> > Glen
>>> >
>>> > My solution is proving to be beyond my capabilities to get to be
>>> correct,
>>> > while I can get the data I have run into several issues that just makes
>>> >
>>> it
>>> > too messy.
>>> > After reading this and looking at your far more elegant solutions I
>>> have
>>> > installed and it is has several problems.
>>> > First I run with loop and the print out below shows that I have an
>>> enormous
>>> >
>>> > amount of rain...and the quality control kicks in and prevents any
>>> further
>>> > stuff up.
>>> > I then ran without loop and the system crashed.
>>> > when I query using owget I get the current count value in the sensor
>>> > (counter.b) as 16570. This has been operational for a few years. This
>>> count
>>> >
>>> > does increment with bucket tips.
>>> > My system is home grown i2C (BMP085, qty two SHT31-D, si1145) on range
>>> >
>>> > extenders, with Davis wind direction and speed sensors.
>>> > The following from the log
>>> > Any suggestions appreciated
>>> > I am defaulted to python3 and weewx v4 on latest debian on Pi3
>>> >
>>> > Regards
>>> >
>>> > Neville
>>> >
>>> > May 27 15:14:08 raspberrypi weewx[5106] INFO __main__: Initializing
>>> weewx
>>> > version 4.0.0
>>> >
>>> > May 27 15:14:08 raspberrypi weewx[5106] INFO __main__: Using Python
>>> 3.7.3
>>> > (default, Dec 20 2019, 18:57:59) #012[GCC 8.3.0]
>>> >
>>> > May 27 15:14:08 raspberrypi weewx[5106] INFO __main__: Platform
>>

Re: [weewx-user] V4 with python2 OWFS errors

2020-05-27 Thread Glenn McKechnie
 summaries
>
> May 27 15:20:14 raspberrypi weewx[5261] INFO weewx.engine: Starting main
> packet loop.
>
> May 27 15:20:14 raspberrypi weewx[5261] WARNING weewx.qc: 2020-05-27
> 15:20:13 AEST (1590556813) LOOP value 'rain' 6529.921259842519 outside
> limits (0.0, 10.0)
>
> May 27 15:20:16 raspberrypi weewx[5261] WARNING weewx.qc: 2020-05-27
> 15:20:16 AEST (1590556816) LOOP value 'rain' 6529.921259842519 outside
> limits (0.0, 10.0)
>
> May 27 15:20:19 raspberrypi weewx[5261] WARNING weewx.qc: 2020-05-27
> 15:20:18 AEST (1590556818) LOOP value 'rain' 6529.921259842519 outside
> limits (0.0, 10.0)
>
> May 27 15:20:21 raspberrypi weewx[5261] WARNING weewx.qc: 2020-05-27
> 15:20:21 AEST (1590556821) LOOP value 'rain' 6529.921259842519 outside
> limits (0.0, 10.0)
>
> May 27 15:20:24 raspberrypi weewx[5261] WARNING weewx.qc: 2020-05-27
> 15:20:23 AEST (1590556823) LOOP value 'rain' 6529.921259842519 outside
> limits (0.0, 10.0)
>
> May 27 15:20:26 raspberrypi weewx[5261] WARNING weewx.qc: 2020-05-27
> 15:20:26 AEST (1590556826) LOOP value 'rain' 6529.921259842519 outside
> limits (0.0, 10.0)
>
> May 27 15:20:29 raspberrypi weewx[5261] WARNING weewx.qc: 2020-05-27
> 15:20:28 AEST (1590556828) LOOP value 'rain' 6529.921259842519 outside
> limits (0.0, 10.0)
>
> May 27 15:20:31 raspberrypi weewx[5261] WARNING weewx.qc: 2020-05-27
> 15:20:31 AEST (1590556831) LOOP value 'rain' 6529.921259842519 outside
> limits (0.0, 10.0)
>
> May 27 15:20:34 raspberrypi weewx[5261] WARNING weewx.qc: 2020-05-27
> 15:20:33 AEST (1590556833) LOOP value 'rain' 6529.921259842519 outside
> limits (0.0, 10.0)
>
> May 27 15:20:36 raspberrypi weewx[5261] WARNING weewx.qc: 2020-05-27
> 15:20:36 AEST (1590556836) LOOP value 'rain' 6529.921259842519 outside
> limits (0.0, 10.0)
>
> May 27 15:20:39 raspberrypi weewx[5261] WARNING weewx.qc: 2020-05-27
> 15:20:38 AEST (1590556838) LOOP value 'rain' 6529.921259842519 outside
> limits (0.0, 10.0)
>
> May 27 15:20:41 raspberrypi weewx[5261] WARNING weewx.qc: 2020-05-27
> 15:20:41 AEST (1590556841) LOOP value 'rain' 6529.921259842519 outside
> limits (0.0, 10.0)
>
> May 27 15:20:44 raspberrypi weewx[5261] WARNING weewx.qc: 2020-05-27
> 15:20:43 AEST (1590556843) LOOP value 'rain' 6529.921259842519 outside
> limits (0.0, 10.0)
>
> May 27 15:20:46 raspberrypi weewx[5261] WARNING weewx.qc: 2020-05-27
> 15:20:46 AEST (1590556846) LOOP value 'rain' 6529.921259842519 outside
> limits (0.0, 10.0)
>
> May 27 15:20:49 raspberrypi weewx[5261] WARNING weewx.qc: 2020-05-27
> 15:20:48 AEST (1590556848) LOOP value 'rain' 6529.921259842519 outside
> limits (0.0, 10.0)
>
> May 27 15:20:51 raspberrypi weewx[5261] WARNING weewx.qc: 2020-05-27
> 15:20:51 AEST (1590556851) LOOP value 'rain' 6529.921259842519 outside
> limits (0.0, 10.0)
>
> May 27 15:20:54 raspberrypi weewx[5261] WARNING weewx.qc: 2020-05-27
> 15:20:53 AEST (1590556853) LOOP value 'rain' 6529.921259842519 outside
> limits (0.0, 10.0)
>
> May 27 15:20:56 raspberrypi weewx[5261] WARNING weewx.qc: 2020-05-27
> 15:20:56 AEST (1590556856) LOOP value 'rain' 6529.921259842519 outside
> limits (0.0, 10.0)
>
> May 27 15:20:59 raspberrypi weewx[5261] WARNING weewx.qc: 2020-05-27
> 15:20:58 AEST (1590556858) LOOP value 'rain' 6529.921259842519 outside
> limits (0.0, 10.0)
>
> May 27 15:21:01 raspberrypi weewx[5261] WARNING weewx.qc: 2020-05-27
> 15:21:01 AEST (1590556861) LOOP value 'rain' 6529.921259842519 outside
> limits (0.0, 10.0)
>
> May 27 15:21:04 raspberrypi weewx[5261] WARNING weewx.qc: 2020-05-27
> 15:21:03 AEST (1590556863) LOOP value 'rain' 6529.921259842519 outside
> limits (0.0, 10.0)
>
> May 27 15:21:06 raspberrypi weewx[5261] WARNING weewx.qc: 2020-05-27
> 15:21:06 AEST (1590556866) LOOP value 'rain' 6529.921259842519 outside
> limits (0.0, 10.0)
>
> May 27 15:21:09 raspberrypi weewx[5261] WARNING weewx.qc: 2020-05-27
> 15:21:08 AEST (1590556868) LOOP value 'rain' 6529.921259842519 outside
> limits (0.0, 10.0)
>
> May 27 15:21:11 raspberrypi weewx[5261] WARNING weewx.qc: 2020-05-27
> 15:21:11 AEST (1590556871) LOOP value 'rain' 6529.921259842519 outside
> limits (0.0, 10.0)
>
> May 27 15:21:14 raspberrypi weewx[5261] WARNING weewx.qc: 2020-05-27
> 15:21:13 AEST (1590556873) LOOP value 'rain' 6529.921259842519 outside
> limits (0.0, 10.0)
>
> #   This section configures the internal weewx engine.
>
>
> [Engine]
>
>
> [[Services]]
>
> # This section specifies the services that should be run. They are
>
> # grouped by type, and the order of services within each group
>
> # determines the order in which the services will be run.
>
> prep_services = weewx.engi

Re: [weewx-user] V4 with python2 OWFS errors

2020-05-26 Thread Glenn McKechnie
Thanks Neville,

That's interesting and certainly of note. It may be just what we are
looking for.

Stefano Miccoli is the author of pyownet so we are doubly on topic!

The original post is at...
https://sourceforge.net/p/owfs/mailman/message/36765345/
and part of a much longer thread...
https://sourceforge.net/p/owfs/mailman/owfs-developers/?viewmonth=201909

To me, the take away is to create the override file as follows...

"/etc/systemd/system/owserver.service.d/override.conf is an override
file, that you create with"
sudo systemctl edit owserver.service

and include the following content...

# /etc/systemd/system/owserver.service.d/override.conf
[Service]
User=Debian-ow
Group=Debian-ow
ExecStart=
ExecStart=/usr/bin/owserver -c /etc/owfs.conf --foreground

[Install]
Also=

For context, read the full post at the above link.

I'll add...
We will continue to run owserver as root (skipping his point #1) and
will perform points #2 and #3 by creating the file as he has outlined
above.

I'll add the above to the install notes, and wiki when I get a moment.



On 27/05/2020, Neville Davis  wrote:
> Guys I too have been following, I am now running pythonv3 weewxv4 with
> 1wire rain, my solution is different and messy but seems to work for me,
> But while trying to sort out my problem found a report about problems with
> owserver on Pi using bustergithub miccoli in the config file edit
> owserver.service ExecStart=/user/bin/owserver -c /etc/OWFS,conf
> —foreground, Apparently on the OWFS developer mailing list this is
> discussed. My system is working without the foreground option apparently
> the problem is intermittent.
> Don’t know if this is related to your problem though
>
> On Tuesday, May 26, 2020 at 9:16:24 PM UTC+10, Glenn McKechnie wrote:
>>
>> On 26/05/2020, Messy Potamia > wrote:
>> >
>> > *I'm following this because one of my weewx stations rely heavily on OW
>> >
>> > sensors to augment the data from my Davis Vantage pro2. *
>> > *I'd upgrade to weewx 4.x but really can't lose owfs operability*.
>> > Thx/mp
>>
>> By weewx4 I assume you mean python3 and weewx4?
>>
>> What are the sensors? Just temperature or...?
>>
>>
>> You shouldn't lose anything. The driver does work with weewx4 and python3
>>
>> I have it running with 4.0.b18 which was the last version? before the
>> final release of weewx4.
>> If you know your sensor_map and sensor_type then you are halfway
>> there. Nothings changed in that respect.
>>
>> The biggest hurdle seems to be getting owserver to behave. You could
>> try installing that now and when it runs okay then you'll be set.
>> There may be an interruption if your existing owfs.py (with python-ow
>> I assume) and owserver both point to the busmaster device and attempt
>> a query at the same time (Gaz's was /dev/i2c-1, mine is the USB
>> dongle). It may just simply block on access, or segfault but a restart
>> of either service will fix that, nothing should break.
>> When it comes to restarting services (keeping in mind that I use SysV
>> eg: /etc/init.d/weewx) I no longer use restart. I actually stop them
>> first (regardless of their state) then start them. I have more success
>> that way, probably gives them a chance to regain state.
>>
>> If you do much the same as Gaz but stick with python2.7 then you can
>> test it all before making the big shift to weewx4 running under
>> python3
>>
>> --
>>
>>
>> Cheers
>>  Glenn
>>
>> rorpi - read only raspberry pi & various weewx addons
>> https://github.com/glennmckechnie
>>
>
> --
> 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/414b4af4-9539-4110-8000-207fe8ff5814%40googlegroups.com.
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAziMBU1Uxq128tN7HQhn7ZcU1Tre4K1JdkcynYbviG70QA%40mail.gmail.com.


Re: [weewx-user] V4 with python2 OWFS errors

2020-05-26 Thread Glenn McKechnie
On 26/05/2020, Messy Potamia  wrote:
>
> *I'm following this because one of my weewx stations rely heavily on OW
> sensors to augment the data from my Davis Vantage pro2. *
> *I'd upgrade to weewx 4.x but really can't lose owfs operability*.
> Thx/mp

By weewx4 I assume you mean python3 and weewx4?

What are the sensors? Just temperature or...?


You shouldn't lose anything. The driver does work with weewx4 and python3
I have it running with 4.0.b18 which was the last version? before the
final release of weewx4.
If you know your sensor_map and sensor_type then you are halfway
there. Nothings changed in that respect.

The biggest hurdle seems to be getting owserver to behave. You could
try installing that now and when it runs okay then you'll be set.
There may be an interruption if your existing owfs.py (with python-ow
I assume) and owserver both point to the busmaster device and attempt
a query at the same time (Gaz's was /dev/i2c-1, mine is the USB
dongle). It may just simply block on access, or segfault but a restart
of either service will fix that, nothing should break.
When it comes to restarting services (keeping in mind that I use SysV
eg: /etc/init.d/weewx) I no longer use restart. I actually stop them
first (regardless of their state) then start them. I have more success
that way, probably gives them a chance to regain state.

If you do much the same as Gaz but stick with python2.7 then you can
test it all before making the big shift to weewx4 running under
python3

-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzjEqh-W-z2VUo6hCsKEyzTxcJEqX_pvEDkx8pcQKShOuw%40mail.gmail.com.


Re: [weewx-user] V4 with python2 OWFS errors

2020-05-26 Thread Glenn McKechnie
On 26/05/2020, Gazza  wrote:
> Hi Glen,
>
> My interface board is based on one I milled on my CNC a couple of years
> ago, for the new one I had the board made as it makes it much easier to
> assemble that the bare copper ones.

CNC!
As an ex fitter, toolmaker come "jack of all" that's my language.

> This one is in the shape of a Pi HAT and has a RTC and the DS2482-100 I2C
> Bus plus provision to attach a BME280 barometer module. So far testing has
> shown that the RTC and the 1wire works but I have noticed that the self
> heating of the test DS18B20 probably means that it is not feasible to add
> the barometer to the board and it will need to mounted externally.
>
> If you want one to do some testing I have a few boards spare thanks to
> minimum orders and Maxims (previous) generosity with samples.

That sounds good Gaz. I'll take you up on it.

Bcc'ing you with this mail.


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzhAeoBSgkC7w%3D-6VvZ%2BTX7R%2Bv3AcMF5%3DUZbvJ3gyt%2BZ1g%40mail.gmail.com.


Re: [weewx-user] V4 with python2 OWFS errors

2020-05-26 Thread Glenn McKechnie
>> If you are running the owfs.py from my fork, the syslog message will
>> tell you what module it has opted to run under. That message occurs in
>> the first few log entries after weewx initializes. It's an INFO
>> message
>>
>
> So with python-ow installed I get this in the INFO:
>
> May 26 17:43:02 GazPi4 weewx[1159] INFO user.owfs: service version is 0.23
> ( ow)
[...]

> With python-ow removed I get this:
>
> May 26 17:50:52 GazPi4 weewx[1259] INFO user.owfs: service version is 0.23
> (pyownet)
[...]

> I have waited for a REC  to be generated and the 1wire sensor allocated to
> extraTemp5 is being reported OK, so it does look like it is working fine
> with either method.

That's good news. For you and me ;-)

> I think I was thrown off track when running direct failed, does that mean
> the broken _main_ section is not called when it is running from weewx ?

Correct.

It's a separate section quite distinct from the Driver/Service side.
It does need to be, and will be fixed as it's required to sort out the
system_map. Thankfully you knew yours already.
When it starts raining again, or we get locked up again :)  I'll get
back to it and see if inspiration strikes.

It borrows a few functions from the main script, but the rest of it is
fairly unique. Made more difficult at the moment as ow and pyownet
approach things in different ways.
Almost had it working on mine but I have a 1-wire hub which
complicates a simple directory walk with pyownet.


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzjCqdYpu5nC%3D%3DYo5qwWrcs11g8djVnvgHjsDyXDiQ-OuQ%40mail.gmail.com.


Re: [weewx-user] V4 with python2 OWFS errors

2020-05-26 Thread Glenn McKechnie
On 26/05/2020, Gazza  wrote:
> OK, I have done some more tests, first I have removed python-ow and now the
> owfs service in weewx is not working.

If you are running the owfs.py from my fork, the syslog message will
tell you what module it has opted to run under. That message occurs in
the first few log entries after weewx initializes. It's an INFO
message

This is from my current session, I'm running with (pyownet)
 INFO user.owfs-dallas: driver version is 0.23.6 (pyownet)

Have a look in the last log, before you removed python-ow and see
which one it picked up, it will be either (ow) or (pyownet).
Might as well have a look at what it's using after you deleted
python-ow (ie: now)  and see what it's running with..


to get pyownet installed, how was that done? Through pip?

A quick check to see if python can find them...

$ python2.7
Python 2.7.13 (default, Sep 26 2018, 18:42:22)
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ow
>>> import pyownet
>>> import arflegarflegloop
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named arflegarflegloop
>>>

If the module isn't present it will throw the ImportError message above.



> When I run systemctl status owserver it shows that it is enabled and
> running.
>
> pi@GazPi4:~ $ systemctl status owserver
> * owserver.service - Backend server for 1-wire control
>Loaded: loaded (/lib/systemd/system/owserver.service; enabled; vendor
> preset: enabled)
>Active: active (running) since Tue 2020-05-26 15:08:43 AEST; 34min ago
>  Docs: man:owserver(1)
>  Main PID: 365 (owserver)
> Tasks: 3 (limit: 4915)
>Memory: 2.8M
>CGroup: /system.slice/owserver.service
>`-365 /usr/bin/owserver -c /etc/owfs.conf
>
> May 26 15:08:43 GazPi4 systemd[1]: Starting Backend server for 1-wire
> control...
> May 26 15:08:43 GazPi4 owserver[365]: DEFAULT: ow_opt.c:(670) systemd mode
> -- ignore 'p' option
> May 26 15:08:43 GazPi4 systemd[1]: Started Backend server for 1-wire
> control.

So far so good.

> When I run owdir, the sensor is detected but I get no readings.
>
> pi@GazPi4:~ $ owdir
> /28.E1044104
> /bus.0
> /uncached
> /settings
> /system
> /statistics
> /structure
> /simultaneous
> /alarm

try running...
 owdir /28.E1044104
and you should get the tree for that sensor, of which temperature
should be included in it.

I'm assuming that  /28.E1044104 is your DS1820, in which case the
following is the command to reveal it's temperature reading...
 owget /28.E1044104/temperature


> When I try to to run weewx owfs direct command it fails.
>
>
> pi@GazPi4:~ $ sudo PYTHONPATH=/home/weewx/bin python /home/weewx/bin/user/
> owfs.py --sensors --iface=localhost:4304
> Traceback (most recent call last):
>   File "/home/weewx/bin/user/owfs.py", line 713, in 
> main()
>   File "/home/weewx/bin/user/owfs.py", line 674, in main
> traverse(ow.Sensor('/'), identify_sensor)
>   File "/home/weewx/bin/user/owfs.py", line 264, in Sensor
> return self.proxy.Sensor(path)
> AttributeError: '_Proxy' object has no attribute 'Sensor'

That doesn't surprise me.
I have a note on my fork that the _main_ section is broken if you are
using pyownet.
Mathews revision is a work in progress, as is mine. If memory serves
they can only pickup python-ow, not pyownet and the Sensor tree isn't
functioning , so yes. broken but a work in progress.
 (In my fork, owfs-dallas.py is further advanced - it works under
python3,, but I'm not suggesting to swap to that either.)


> It seems that even though I had changed the weewx.conf from =/dec/i2c-1 to
> =localhost:4304 it was still using pyownet.

When you run weewx, take note of that INFO version message. Then we'll
know which module one to focus on.





-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzgjTtuirS734zZvyefCjk20oCk-coTCvCHhbrOx%2B7dg-g%40mail.gmail.com.


Re: [weewx-user] V4 with python2 OWFS errors

2020-05-25 Thread Glenn McKechnie
Gazza wrote:
> 
> Hi Glen,
> 
> I don't fully understand the pyownet bit but owserver would not run without 
> it being installed.

Okay, that is confusing as pyownet is the client, it needs owserver.
Owserver doesn't care whether pyownet is there or not.
We do, it doesn't.

If you were still running weewx with python-ow then /dev/i2c-1 would still
have been claimed by it; then owserver would complain, and I think it
might even segfault?


owserver does seem to be finicky when initially starting (under debian
Buster) and that could be a systemd thing, but no-one who has had the
problem has clearly defined what the fix is, it just "comes good".
I run Devuan which doesn't use systemd so I'm very low on the list of
possible fixers.

It may be that owserver fails to start (for its own reasons) and
systemd takes that personally and supplies a cryptic message. (too
often, too fast, something...protocols)?

Owserver does need a working config file for it to start, and it needs
the 1-wire bus interface to be correctly defined. That may be why it
comes with an oddly configured owfs.conf file (the fake server).

Getting back to ow, pyownet and owserver...

When python-ow is available, that's all that is needed to talk to the
busmaster (1-wire interface). No owserver is required as ow has wrapped
up owservers library and uses that instead...
weewx -- owfs.py -- ow -- /dev/i2c-1

pyownet is a package that only interfaces with owserver and also does it
using the python language.
Where we once needed to tell ow what the interface was we now need to
give that information to owserver and it does all the protocol,
handshaking business. Think of it as replacing the interface (as ow used it).

Once owserver is working correctly we point pyownet to the owserver and
with that change we should be in business with no further changes (other
than setting up the [OWFS] section as we always did.) We now have...
weewx -- owfs.py -- pyownet -- owserver -- /dev/i2c-1

https://github.com/miccoli/pyownet

Okay. My cup runneth over again. HTHelped :-)

-- 

Cheers
  Glenn

 rorpi - read only raspberry pi & various weewx addons
 https://github.com/glennmckechnie

-- 
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/20200526012725.ur5njorbo4r6mnjr%40gmail.com.


Re: [weewx-user] V4 with python2 OWFS errors

2020-05-25 Thread Glenn McKechnie
Hi Gaz,

Excellent.
Good to hear it's working for you, and may it keep doing so!

You've certainly given it a good test, with the Service setup, python
versions, and especially the owserver - pyownet combination!

Great to have your working config setup too. It's always good to have
that sort of info, wraps it up nicely.


On 25/05/2020, Gazza  wrote:
>
> OK, I have had a read of the posts about pyton-ow being no longer supported
>
> and have now installed owserver and owshell and pyownet.
>
> As I am using a DS2482-100 I2C Bus master my owfs.conf contains:
>
> # DS2482-100 I2C Bus master
> server: device = /dev/i2c-1
> server: port = localhost:4304
>
> I changed the weewx service section to:
>
> [OWFS]  # Options for extension owfs.py using owserver
>
> interface = localhost:4304
> [[sensor_map]]
> # 1wire - solar
> extraTemp5 =  /uncached/28.E1044104/temperature   # test
> DS18S20
>
> So far it is all working as expected.
>
>
> Gaz
>
> --


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzhRiY91SGcqRK5r3QUcQ03CCfnNmiuej%2Bas-tqKG1YdMg%40mail.gmail.com.


Re: [weewx-user] V4 with python2 OWFS errors

2020-05-24 Thread Glenn McKechnie
Tested and updated the owfs.py file in my fork

Changed the encode() suggestions in the thread above to use plain str()
I believe I've caught all instances and that fix should propagate
through to the various functions.

There is also a tweak to get_float(path) that I required (when using
pyownet and python3) and a tweak to version string which logs the
python module it's running with.

It runs Weewx4 with either python2.7 or python3.

 
https://github.com/glennmckechnie/weewx-owfs/commit/f3c8496bba973b9acba0f2ace573cd4462d7a80b

https://github.com/glennmckechnie/weewx-owfs/raw/master/bin/user/owfs.py



On 23/05/2020, Glenn McKechnie  wrote:
> Looks like another encoding issue.
> You could try changing line 274 in the same fashion. No guarantees, as
> I can't test it.
>
> change...
>
> sv = ow.get(path)
>
> to include the encode fix...
>
> sv = ow.get(path.encode())
>
> I've raised it as an issue on github, hopefully mathew will be along
> and able to apply his expertise to it.
>
> https://github.com/matthewwall/weewx-owfs/issues/3
>
> On 23/05/2020, Gazza  wrote:
>>
>> Tried that change and it crashed with a different set of errors.
>>
>>
>> Gaz
>>
>>
>>
>> --
>> 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/ec0c7d16-8d7b-4c0b-8285-982a91157a4b%40googlegroups.com.
>>
>
>
> --
>
>
> Cheers
>  Glenn
>
> rorpi - read only raspberry pi & various weewx addons
> https://github.com/glennmckechnie
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAziKJS-vGJtx6hEDnSTskhjHDfuXkafiu4AahfwGY%2BpGfQ%40mail.gmail.com.


Re: [weewx-user] V4 with python2 OWFS errors

2020-05-23 Thread Glenn McKechnie
Looks like another encoding issue.
You could try changing line 274 in the same fashion. No guarantees, as
I can't test it.

change...

sv = ow.get(path)

to include the encode fix...

sv = ow.get(path.encode())

I've raised it as an issue on github, hopefully mathew will be along
and able to apply his expertise to it.

https://github.com/matthewwall/weewx-owfs/issues/3

On 23/05/2020, Gazza  wrote:
>
> Tried that change and it crashed with a different set of errors.
>
>
> Gaz
>
>
>
> --
> 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/ec0c7d16-8d7b-4c0b-8285-982a91157a4b%40googlegroups.com.
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzhBLR2Dhjz687LRPWMXuA8RP4KKafb57yuGWo1zByz%3D9Q%40mail.gmail.com.


Re: [weewx-user] V4 with python2 OWFS errors

2020-05-22 Thread Glenn McKechnie
Strange, I wouldn't have thought that would bite with python2.7 ?
It's really one for an expert,  but you can try the following and see
if it gets you any further.

line 205 in owfs.py
try changing that from...

owbinding.init(iface)

to...

owbinding.init(iface.encode())

On 22/05/2020, Gazza  wrote:
>
> I have just finished a new V4 python2 weewx build to overcome the
> python3-ow issues raised in another post.
>
> So far I have the SDR driver stuff working and my Fine Offset station and
> my other sensors are detected and are reporting correctly.
>
> I have just installed OWFS as a service for a one wire sensor and while it
> seems to have installed correctly and when I run the owfs.py directly I get
>
> the expected result.
>
> pi@GazPi4:/home/weewx $ sudo PYTHONPATH=/home/weewx/bin python /home/weewx/
> bin/user/owfs.py --sensors --iface /dev/i2c-1
> E1044104: /28.E1044104 DS18B20
>
> But when I run weewx directly it crashes with a bunch of critical errors.
> It looks like the OWFS interface is detected correctly on i2c-1 but then
> fail with engine.py and owfs errors.
>
> EMay 22 22:22:24 GazPi4 weewx[1817] INFO __main__: Locale is 'en_AU'
> May 22 22:22:24 GazPi4 weewx[1817] INFO __main__: Using configuration file
> weewx.conf
> May 22 22:22:24 GazPi4 weewx[1817] INFO weewx.engine: Loading station type
> SDR (user.sdr)
> May 22 22:22:24 GazPi4 weewx[1817] INFO user.sdr: driver version is 0.77
> May 22 22:22:24 GazPi4 weewx[1817] INFO user.sdr: sensor map is
> {u'windGust'
> : u'wind_gust.38.FOWHx080Packet', u'outTempBatteryStatus': u
> 'battery.38.FOWHx080Packet', u'rain_total': u'rain_total.38.FOWHx080Packet',
>
> u'windSpeed': u'wind_speed.38.FOWHx080Packet', u'windDir': u
> 'wind_dir.38.FOWHx080Packet', u'outHumidity': u'humidity.38.FOWHx080Packet',
>
> u'outTemp': u'temperature.38.FOWHx080Packet', u'extraTemp1': u
> 'temperature.32D1.AcuriteTowerPacketV2', u'batteryStatus1': u
> 'battery.32D1.AcuriteTowerPacketV2', u'extraTemp2': u
> 'temperature.39.ProloguePacket', u'extraHumid2': u
> 'humidity.39.ProloguePacket', u'batteryStatus2': u
> 'battery.39.ProloguePacket', u'extraTemp3': u
> 'temperature.1:180.NexusTemperaturePacket', u'extraHumid3': u
> 'humidity.1:180.NexusTemperaturePacket', u'batteryStatus3': u
> 'battery.1:180.NexusTemperaturePacket', u'extraTemp4': u
> 'temperature.5.ProloguePacket', u'extraHumid4':
> u'humidity.5.ProloguePacket'
> , u'batteryStatus4': u'battery.5.ProloguePacket'}
> May 22 22:22:24 GazPi4 weewx[1817] INFO user.sdr: deltas is {'strikes':
> 'strikes_total', 'rain': 'rain_total'}
> May 22 22:22:24 GazPi4 weewx[1817] INFO user.sdr: startup process 'rtl_433
> -M utc -F json'
> May 22 22:22:24 GazPi4 weewx[1817] INFO user.owfs: service version is 0.23
> May 22 22:22:24 GazPi4 weewx[1817] INFO user.owfs: binding is archive
> May 22 22:22:24 GazPi4 weewx[1817] INFO user.owfs: interface is /dev/i2c-1
> May 22 22:22:24 GazPi4 weewx[1817] INFO user.owfs: sensor map is {u
> 'extraTemp5': u'/uncached/28.E1044104/temperature'}
> May 22 22:22:24 GazPi4 weewx[1817] INFO user.owfs: sensor type map is {}
> May 22 22:22:24 GazPi4 weewx[1817] INFO user.owfs: sensor unit system is
> metric
> May 22 22:22:24 GazPi4 weewx[1817] INFO user.sdr: shutdown process rtl_433
> -M
> utc -F json
> May 22 22:22:25 GazPi4 kernel: [ 2598.911132] r820t 8-001a: destroying
> instance
> May 22 22:22:25 GazPi4 kernel: [ 2598.911503] dvb_usb_v2: 'Realtek RTL2832U
>
> reference design:1-1.2' successfully deinitialized and disconnected
> May 22 22:22:34 GazPi4 weewx[1817] INFO user.sdr: timed out waiting for
> stdout-thread
> May 22 22:22:44 GazPi4 weewx[1817] INFO user.sdr: timed out waiting for
> stderr-thread
> May 22 22:22:44 GazPi4 weewx[1817] CRITICAL __main__: Caught unrecoverable
> exception:
> May 22 22:22:44 GazPi4 weewx[1817] CRITICAL __main__:   in method
> 'init', argument 1 of type 'char const *'
> May 22 22:22:44 GazPi4 weewx[1817] CRITICAL __main__:   Traceback
> (most
> recent call last):
> May 22 22:22:44 GazPi4 weewx[1817] CRITICAL __main__: File
> "./bin/weewxd", line 148, in main
> May 22 22:22:44 GazPi4 weewx[1817] CRITICAL __main__:   engine =
>
> weewx.engine.StdEngine(config_dict)
> May 22 22:22:44 GazPi4 weewx[1817] CRITICAL __main__: File
> "/home/weewx/bin/weewx/engine.py", line 75, in __init__
> May 22 22:22:44 GazPi4 weewx[1817] CRITICAL __main__:   self.
> loadServices(config_dict)
> May 22 22:22:44 GazPi4 weewx[1817] CRITICAL __main__: File
> "/home/weewx/bin/weewx/engine.py", line 138, in loadServices
> May 22 22:22:44 GazPi4 weewx[1817] CRITICAL __main__:   obj =
> weeutil.weeutil.get_object(svc)(self,config_dict)
> May 22 22:22:44 GazPi4 weewx[1817] CRITICAL __main__: File
> "/home/weewx/bin/user/owfs.py", line 574, in __init__
> May 22 22:22:44 GazPi4 weewx[1817] CRITICAL __main__: 
> ow.init(
> self.interface)
> May 22 22:22:44 GazPi4 weewx[1817] 

Re: [weewx-user] Re: Original Dallas Semiconductor 8 reed switch wind vane with DS2407 and DS2401 1-wire chips

2020-05-21 Thread Glenn McKechnie
On the off chance that there are any more original 1-wire Dallas
weather stations that are ready to be dusted off and redeployed, then
there is a modified driver available at...

https://github.com/glennmckechnie/weewx-owfs

It's based on mwalls original owfs.py driver but for the time being it
has been renamed as owfs-dallas.py. It should be a drop in replacement
for owfs.py but there are a couple of additional changes.
It has been running with weewx4.0.0b18, the only issue appears to be a
hardware one. A second data point would be handy to have, but we
won't hold our breath.

weewx.conf will be modified to point to the new file.
[OWFS]
  driver = user.owfs-dallas


On 01/04/2020, Glenn McKechnie  wrote:
> Hi Bret
>
> On 01/04/2020, Bret Craytor  wrote:
>> BTW,  Trying to get OWW to work and keep getting hung up with the GTK+,
>> ugh.  I can't get past the ./configure.
>
> From your previous mail it sounds like you're getting some useful
> responses from the unit, we'll take that as an indicator that it's all
> good. Soon find out otherwise.
> I've got some working code for the direction sensing, just need to be
> able to get the DS2401s responding via owfs.py.
> I'll contact you off list regarding the ssh connection and setup.
>
>
>> On Monday, March 23, 2020 at 11:55:52 AM UTC-5, Bret Craytor wrote:
>>>
>>> Hey!
>>>
>>> Which sensor type should I use in my OWFS WEEWX conf file?  I have the
>>> addresses of the DS2401's on the PCB layout:
>>>
>>>
>>>  D E F
>>>  CG
>>>  B A H
>>> II
>>> II  -mount side (viewed from top of PCB
>>>
>>>
>>> A:  01.B5374A04
>>> B:  01.B2374A04
>>> C:  01.BA374A04
>>> D:  01.B7374A04
>>> E:  01.C6374A04
>>> F:  01.C3374A04
>>> G:  01.BD374A04
>>> H:  01.AE374A04
>>>
>>> As you can see, the first two digits after the dot are the only values
>>> that change.  Surely someone out there has already made a sensor type
>>> file
>>>
>>> for this, and can help with my weewx.conf file setup.
>>>
>>> I had some earlier posts and recieved great help, but have had to keep
>>> putting the project down to do other tasks, but with the COVID-19
>>> instructions for staying home, here I am!  Thanks for your help WEEWX
>>> community!
>>>
>>> Bret Craytor
>
>
>
> --
>
>
> Cheers
>  Glenn
>
> rorpi - read only raspberry pi & various weewx addons
> https://github.com/glennmckechnie
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzhWXvQ29VOaAjgzHN_zWD8irZReF-HTY_%3Dv%3Dg%3DBPfQ6mw%40mail.gmail.com.


Re: [weewx-user] python3-ow for OWFS

2020-05-21 Thread Glenn McKechnie
That's odd it was there, but it really does seem to have gone missing
from the repos, and there's no record of it (or one I can find).  I've
had a look in the local cache but it's not in there either.

Looks like it's time to switch to using owfs.py with  ow-server and pyownet.
That combination works here with a tweaked driver, but try it with the
ported original at
https://github.com/matthewwall/weewx-owfs (mine needs a little tidying :)

You may have to install pyownet via pip / pip3
08:51 AM $ pip3 show pyownet
Name: pyownet
Version: 0.10.0.post1
Summary: Python OWFS client library (owserver protocol)
Home-page: https://github.com/miccoli/pyownet
Author: Stefano Miccoli
Author-email: stefano.micc...@polimi.it
License: LGPLv3
Location: /usr/local/lib/python3.7/dist-packages


If you're unfamiliar with the installation of owserver have a look in
this groups history for various mentions of it.
If there are still questions we'll follow up in the morning (mine?)

Basically, it's a case of pointing owserver (/etc/owfs.conf) at your
1-wire interface (usb=ALL /dev/ttyS?  /dev/i2c-1...), and point
owfs.py to talk to owserver (localhost:4304)

=

07:36 AM $ apt install python3-ow
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-ow is already the newest version (3.2p3+dfsg1-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

==

08:11 AM $ apt show python3-ow
Package: python3-ow
Version: 3.2p3+dfsg1-2
Priority: optional
Section: python
Source: owfs
Maintainer: Vincent Danjean 
Installed-Size: 140 kB
Provides: python3.6-ow, python3.7-ow
Depends: libc6 (>= 2.4), libow-3.2-3, libpython3.6 (>= 3.6.5),
libpython3.7 (>= 3.7.0), python3 (<< 3.8), python3 (>= 3.6~),
python3:any
Homepage: http://owfs.org/
Download-Size: 33.2 kB
APT-Manual-Installed: yes
APT-Sources: http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
Description: Dallas 1-wire support: Python 3 bindings
 The 1-Wire bus is a cheap low-speed bus for devices like weather
 sensors, access control, etc. It can be attached to your system via
 serial, USB, I2C, and other interfaces.
 .
 Python 3 bindings for the OWFS 1-Wire support library have been produced
 with SWIG and allow access to libow functions from Python code.

===

07:40 AM $ cat /etc/apt/sources.list
deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib
non-free rpi

===

07:38 AM $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/;
SUPPORT_URL="http://www.raspbian.org/RaspbianForums;
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs;




On 21/05/2020, Gazza  wrote:
>
> I am trying to get the OWFS service installed on a new Weewx 4 install on a
>
> Raspberry Pi with Buster.
>
> When I try to install the required python3-ow package I get an error that
> it "Unable to locate package python3-ow"
>
> Do I have to add some other repository to get this package ??
>
> pi@raspberrypi:~ $ sudo apt install python3-ow
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> E: Unable to locate package python3-ow
>
>
>
> 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/85259404-2d6a-4d7c-9399-d8f4c840f0fb%40googlegroups.com.
>


-- 


Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzgWcCOij4B%3DBm%3DKZ2_NXe_hNWBKy2%2BBSeuherV5QS1PYA%40mail.gmail.com.


Re: [weewx-user] Re: Weewx V4 : Imagegenerator problems with plot_type = vector and aggregate_type = max

2020-05-07 Thread Glenn McKechnie
This sounds like the problem that Luc reported, and I was also experiencing.

Tom came up with a change to xtypes.py and for whatever reason it
doesn't appear to have made it into weewx 4.

This fix cured our problem of hanging reports. Mysql was through the
roof and delaying the report generation.
That file is attached at the following, along with the discussion

https://groups.google.com/d/msg/weewx-development/fmprpi4yJrI/iQ7Rw8srAQAJ

On 07/05/2020, Jacques Terrettaz  wrote:
> here is the log after Weewx startup :
>
> May  7 10:44:49 meteopi systemd[1]: Starting LSB: weewx weather system...
> May  7 10:44:49 meteopi weewx[22175] INFO __main__: Initializing weewx
> version 4.0.0
> May  7 10:44:49 meteopi weewx[22175] INFO __main__: Using Python 3.7.3
> (default, Dec 20 2019, 18:57:59) #012[GCC 8.3.0]
> May  7 10:44:49 meteopi weewx[22175] INFO __main__: Platform
> Linux-4.19.97-v7+-armv7l-with-debian-10.3
> May  7 10:44:49 meteopi weewx[22175] INFO __main__: Locale is 'fr_CH.UTF-8'
> May  7 10:44:49 meteopi weewx[22175] INFO __main__: PID file is
> /var/run/weewx.pid
> May  7 10:44:49 meteopi weewx[22179] INFO __main__: Using configuration
> file /etc/weewx/weewx.conf
> May  7 10:44:49 meteopi weewx[22163]: Starting weewx weather system: weewx.
> May  7 10:44:49 meteopi systemd[1]: Started LSB: weewx weather system.
> May  7 10:44:49 meteopi weewx[22179] INFO weewx.engine: Loading station
> type Vantage (weewx.drivers.vantage)
> May  7 10:44:49 meteopi weewx[22179] INFO weewx.engine: StdConvert target
> unit is 0x1
> May  7 10:44:49 meteopi weewx[22179] INFO weewx.wxservices: The following
> values will be calculated: pressure=prefer_hardware,
> altimeter=prefer_hardware, appTemp=prefer_hardware,
> barometer=prefer_hardware, beaufort=prefer_hardware, cloudbase=software,
> dewpoint=prefer_hardware, ET=prefer_hardware, heatindex=prefer_hardware,
> humidex=software, inDewpoint=prefer_hardware, maxSolarRad=prefer_hardware,
> rainRate=prefer_hardware, windchill=prefer_hardware,
> windrun=prefer_hardware
> May  7 10:44:49 meteopi weewx[22179] INFO weewx.wxservices: The following
> algorithms will be used for calculations: altimeter=aaASOS,
> maxSolarRad=Bras
> May  7 10:44:49 meteopi weewx[22179] INFO weewx.engine: Archive will use
> data binding wx_binding
> May  7 10:44:49 meteopi weewx[22179] INFO weewx.engine: Record generation
> will be attempted in 'hardware'
> May  7 10:44:49 meteopi weewx[22179] INFO weewx.engine: Using archive
> interval of 300 seconds (specified by hardware)
> May  7 10:44:50 meteopi weewx[22179] INFO weewx.restx: StationRegistry:
> Station will be registered.
> May  7 10:44:50 meteopi weewx[22179] INFO weewx.restx: Wunderground:
> Posting not enabled.
> May  7 10:44:50 meteopi weewx[22179] INFO weewx.restx: PWSweather: Posting
> not enabled.
> May  7 10:44:50 meteopi weewx[22179] INFO weewx.restx: CWOP: Posting not
> enabled.
> May  7 10:44:50 meteopi weewx[22179] INFO weewx.restx: WOW: Posting not
> enabled.
> May  7 10:44:50 meteopi weewx[22179] INFO weewx.restx: AWEKAS: Posting not
> enabled.
> May  7 10:44:50 meteopi weewx[22179] INFO user.mqtt: service version is
> 0.22
> May  7 10:44:50 meteopi weewx[22179] INFO user.mqtt: binding to ['loop',
> 'archive']
> May  7 10:44:50 meteopi weewx[22179] INFO user.mqtt: topic is weather
> May  7 10:44:50 meteopi weewx[22179] INFO user.mqtt: desired unit system is
>
> METRIC
> May  7 10:44:50 meteopi weewx[22179] INFO user.mqtt: data will be uploaded
> to mqtt://XXX
> May  7 10:44:50 meteopi /weewxd: restx: Newdata: service version is 2.0
> May  7 10:44:50 meteopi /weewxd: restx: Newdata: Data will be uploaded to
> http://X
> May  7 10:44:50 meteopi /weewxd: restx: Romma: service version is 2.0
> May  7 10:44:50 meteopi /weewxd: restx: Romma: Data will be uploaded to
> http://XXX
> May  7 10:44:50 meteopi /weewxd: restx: Emetsys: service version is 2.0
> May  7 10:44:50 meteopi /weewxd: restx: Emetsys: Data will be uploaded to
> http:/X
> May  7 10:44:50 meteopi /weewxd: windy: version is 0.5
> May  7 10:44:50 meteopi /weewxd: windy: Data will be uploaded to
> https://stations.windy.com/pws/update
> May  7 10:44:50 meteopi weewx[22179] INFO __main__: Starting up weewx
> version 4.0.0
> May  7 10:44:50 meteopi weewx[22179] INFO weewx.engine: Clock error is
> -0.23 seconds (positive is fast)
> May  7 10:44:50 meteopi weewx[22179] INFO weewx.engine: Using binding
> 'wx_binding' to database 'weewx'
> May  7 10:44:50 meteopi weewx[22179] INFO weewx.manager: Starting backfill
> of daily summaries
> May  7 10:44:50 meteopi weewx[22179] INFO weewx.engine: Starting main
> packet loop.
>
> --
> 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
> 

Re: [weewx-user] Protocol Error Starting owserver

2020-05-04 Thread Glenn McKechnie
On 04/05/2020, Wt Riker  wrote:
[...]
>> Have you setup and used owserver before?
>>
> No.

Okay, so no working config. Starting from scratch

>> Do you have a working /etc/owfs.conf or are you using the supplied
>> default?

> I modified the system default. It is attached.

There are a few things that are amiss there.

You have 2 device entries in owfs.conf

# USB device: DS9490

server: device = /dev/ic2-1

# Serial port: DS9097

server: device = /dev/ttyAMA0

Which one is it?
What do you have as an interface between the pi and the 1-wire
network? That is a crucial piece of missing information.

Also a  DS9490R (the blue usb dongle) should be ...
server: usb = all

comment out the !server entry...
#! server: server = localhost:4304

select an appropriate device entry, choose one of ...
server: device = /dev/ic2-1
or
server: device = /dev/ttyAMA0
or
server: usb = all
comment out the remainder.

specify the port as 4304 ie:- no localhost  in the string...

server: port = 4304

>> What does the following command return...
>>
>>  sudo /usr/bin/owserver -c /etc/owfs.conf --debug

With those changes made, what happens this time ?

>> If you need to send that output to the list then

>> sudo /usr/bin/owserver -c /etc/owfs.conf --debug >> /tmp/owservdebug.txt

>> and attach /tmp/owservdebug.txt

-- 

Cheers
 Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

-- 
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/CAAraAzgXZ1JUpxPd5zj44BEUA901gF%2B9jBytQe_53nAT1D9dHA%40mail.gmail.com.


Re: [weewx-user] Trying to get a Rainwise Tipping Bucket to work

2020-05-03 Thread Glenn McKechnie
FaT Fingers striKes again.

I've made a few changes to the owfs entry. Have a look at it and see
if it fills enough of the gaps.

https://github.com/weewx/weewx/wiki/owfs

I have a markdown error in it. Need to escape  [  so that it (all of
them) display correctly (rather than as a link)



On 04/05/2020, michael form  wrote:
> Thanks. owserver is indeed running.
>
> Evidently, the "Counter.B" needs to have a lower case c, "counter.B" for it
>
> to work. At least for me.
>
> It indeed returns a value and tomorrow I will pour more water into the
> tipping bucket and see if the counter increments. If it does, then I will
> have to see if the "rain" is posted correctly in weewx.
> I am pessimistic about success since with everything as it currently is,
> "rain" never changed with the addition of water. Of course, the problem may
>
> lie in the operation of the tipping bucket itself, but tomorrow
> will tell the tale on what is going on.
>
> On Sunday, May 3, 2020 at 11:51:35 PM UTC-4, Glenn McKechnie wrote:
>>
>> Argh!
>> Bugger.
>>
>> PYTHONPATH=/home/weewx/bin python /home/weewx/bin/user/owfs.py
>> --iface=localhost:4304 --reading=/uncached/1D.81B5/Counter.B
>>
>> owfs.py defaults to the usb adaptor. You need to specify the iface if
>> using something else
>>
>> On 04/05/2020, Glenn McKechnie >
>> wrote:
>> > Michael Form wrote:
>> >> Well, it communicates with all 1-Wire devices but I do not know the
>> >> answer
>> >> to your question about the "other driver" or "what interface it is
>> >> using".
>> >> Perhaps the info below will answer those questions but it seems to me
>> >> that
>> >> things are OK.
>> >
>> > The owfs.py can run as a driver (full 1-wire network)
>> >
>> > It can also run as a service.
>> > This is where you have another station type that will be the main driver
>> >
>> > entry, you augment the values returned from that weather station with a
>> >
>> > couple of 1-wire sensors that are being read by owfs.py that runs as a
>> > service.
>> >
>> > You are running a full 1-wire setup. Your config is correct.
>> >
>> > owfs.py can iface (interface) with a serial port, usb port, i2c-1 device
>> >
>> > Yours is a the usb port BUT, it's accessed through owserver so
>> > weewx.conf needs the localhost:4304 entry to tell it that.
>> >
>> >
>> >> Adding
>> >>
>> >> --iface=localhost:4304 --reading=/uncached/1D.30C60D00
>> >>
>> >> to the PYTHONPATH does return the DS2423 info. Where would I find this
>> >>
>> in
>> >> the documentation?
>> >
>> > It's in the source of owfs.py
>> > Probably needs adding to the / a  wiki entry.
>> >
>> >> Is there some way of reading the values in counter.B?
>> >
>> > Along the way the counters.B got dropped. Ooops!
>> > To get the reading for that location add it to the path as per the
>> > following.
>> >
>> > PYTHONPATH=/home/weewx/bin python /home/weewx/bin/user/owfs.py
>> > --reading=/uncached/1D.81B5/Counter.B
>> >
>> >
>> >>
>> >> _What needs to be changed in weewx.conf and/or owfs.conf to make things
>> >>
>> >> happy?__
>> >
>> > That appears to  be nothing (see below). Providing the owserver is
>> > running.
>> >
>> > /etc/init.d/owserver status
>> >
>> > if systemd isn't in charge, that should return "owserver is running."
>> >
>> > If systemd is in charge it will give you more info, of which "active
>> > (running)" should be in there.
>> >
>> > If there are no errors in the log, or your other sensors are working
>> > fine. Then it is running.
>> >
>> >
>> > _
>> >> Thanks again.
>> >>
>> >>
>> >> Here is the section of *weewx.conf* that concerns itself with 1-Wire
>> >> stuff
>> >> and owfs.conf are below:
>> >>
>> >> # Set to type of station hardware. There must be a corresponding stanza
>> >>
>> >> # in this file with a 'driver' parameter indicating the driver to
>> be
>> >> used.
>> >> ###  station_type = Simulator
>> >> station_type = OWFS
>> >
>> > No other dri

  1   2   3   >