thanks to all for their help on this one.  I see it didn't present on my 
installation until Nov 25th and I didn't notice it right away to boot but 
all is humming again.

On Tuesday, May 23, 2023 at 9:52:57 PM UTC-4 gjr80 wrote:

> If you are running the current WeeWX release you should be fairly safe in 
> downloading the patched utilities.py in place of your current version. To 
> do this:
>
> 1. move aside your current utilities.py so your can revert to it if you 
> run into catastrophic problems, for a WeeWX package install:
>
> $ sudo mv /usr/share/weewx/weeplot/utilities.py 
> /usr/share/weewx/weeplot/utilities_orig.py 
>
> if you have a setup.py install use /home/weewx/bin in place of 
> /usr/share/weewx
>
> 2. download the patched utilities.py from GitHub, for a WeeWX package 
> install:
>
> $ sudo wget -P /usr/share/weewx/weeplot 
> https://raw.githubusercontent.com/weewx/weewx/master/bin/weeplot/utilities.py
>
> again, if you have a setup.py install use /home/weewx/bin in place of 
> /usr/share/weewx
>
> 3. restart WeeWX
>
> If you mess up the process simply copy utilities_orig.py back as 
> utilities.py and restart WeeWX.
>
> Gary
> On Sunday, 21 May 2023 at 17:35:00 UTC+10 seano...@gmail.com wrote:
>
>> Hi,
>>
>> I seem to be having this same error but I don't understand exactly how to 
>> rectify it. Please can you explain in a simple way how to apply the patch?
>>
>> Appreciate it, thank you.
>>
>> On Wednesday, April 12, 2023 at 1:01:59 AM UTC+4 Marius Schamschula wrote:
>>
>>> I ran into the same error after a routine update to FreeBSD 13.1 
>>> packages.
>>>
>>> I applied the patch and reinstalled weewx 4.10.2, and all is again 
>>> working as expected!
>>>
>>> On Tuesday, April 4, 2023 at 2:33:53 AM UTC-5 c s (224) wrote:
>>>
>>>> Thank you very much for digging deeper! My solution will then be to 
>>>> simply install an older version of the Pillow library. Thanks a lot!
>>>>
>>>> c s (224) schrieb am Montag, 3. April 2023 um 13:18:39 UTC+2:
>>>>
>>>>> Hello,
>>>>>
>>>>> I have just installed weewx as described here: 
>>>>> https://weisser-zwerg.dev/posts/ecowitt-gw2000-weewx-docker
>>>>>
>>>>> And I run into an error that prevents the images from being drawn:
>>>>>
>>>>> weewx-weewx-1      | Apr  3 13:11:03 weewx[20] ERROR 
>>>>> weewx.reportengine:         ****  Generator terminated 
>>>>> weewx-weewx-1      | Traceback (most recent call last): 
>>>>> weewx-weewx-1      |   File "/home/weewx/bin/weewx/reportengine.py", 
>>>>> line 197, in run 
>>>>> weewx-weewx-1      |     obj.start() 
>>>>> weewx-weewx-1      |   File "/home/weewx/bin/weewx/reportengine.py", 
>>>>> line 385, in start 
>>>>> weewx-weewx-1      |     self.run() 
>>>>> weewx-weewx-1      |   File 
>>>>> "/home/weewx/bin/weewx/imagegenerator.py", line 42, in run 
>>>>> weewx-weewx-1      |     self.gen_images(self.gen_ts) 
>>>>> weewx-weewx-1      |   File 
>>>>> "/home/weewx/bin/weewx/imagegenerator.py", line 114, in gen_images 
>>>>> weewx-weewx-1      |     image = plot.render() 
>>>>> weewx-weewx-1      |             ^^^^^^^^^^^^^ 
>>>>> weewx-weewx-1      |   File "/home/weewx/bin/weeplot/genplot.py", 
>>>>> line 222, in render 
>>>>> weewx-weewx-1      |     self._renderDayNight(sdraw) 
>>>>> weewx-weewx-1      |   File "/home/weewx/bin/weeplot/genplot.py", 
>>>>> line 266, in _renderDayNight 
>>>>> weewx-weewx-1      |     sdraw.rectangle(((xleft,self.yscale[0]), 
>>>>> weewx-weewx-1      |   File "/home/weewx/bin/weeplot/utilities.py", 
>>>>> line 442, in rectangle 
>>>>> weewx-weewx-1      |     self.draw.rectangle(box_scaled, **options) 
>>>>> weewx-weewx-1      |   File 
>>>>> "/opt/venv/lib/python3.11/site-packages/PIL/ImageDraw.py", line 294, in 
>>>>> rectangle 
>>>>> weewx-weewx-1      |     self.draw.draw_rectangle(xy, fill, 1) 
>>>>> weewx-weewx-1      | ValueError: y1 must be greater than or equal to 
>>>>> y0
>>>>>
>>>>> I have followed the complete set-up process as described in "WeeWX: 
>>>>> Installation using setup.py", except that I do use a conda environment 
>>>>> and 
>>>>> pip packages rather than the OS packages:
>>>>>
>>>>> > mamba create -n weewx python=3.9
>>>>> > conda activate weewx
>>>>> > pip3 install configobj paho-mqtt pyserial pyusb Cheetah3 Pillow 
>>>>> ephem 
>>>>> > wget https://weewx.com/downloads/weewx-4.10.2.tar.gz
>>>>> > tar -xzvf weewx-4.10.2.tar.gz
>>>>> > cd weewx-4.10.2
>>>>> > python3 ./setup.py build
>>>>> > python3 ./setup.py install
>>>>> > # create the weewx.conf.patch from here: 
>>>>> https://weisser-zwerg.dev/posts/ecowitt-gw2000-weewx-docker/
>>>>> > patch -p1 weewx.conf < weewx.conf.patch
>>>>> > wget -O weewx-mqtt.zip 
>>>>> https://github.com/matthewwall/weewx-mqtt/archive/master.zip
>>>>> > ./bin/wee_extension --install ./weewx-mqtt.zip
>>>>> > wget -O weewx-interceptor.zip 
>>>>> https://github.com/matthewwall/weewx-interceptor/archive/master.zip
>>>>> > ./bin/wee_extension --install ./weewx-interceptor.zip
>>>>> > # -------------------
>>>>> > ./bin/weewxd
>>>>>
>>>>> I still run into the exact same problem. I've tried several 
>>>>> modifications to the config file, but cannot figure out what causes this 
>>>>> problem. I've also added some print statement to tell me more about the 
>>>>> issue around the drawing of the rectangle:
>>>>> def rectangle(self, box, **options):
>>>>> """Draw a scaled rectangle.
>>>>> box: A pair of 2-way tuples, containing coordinates of opposing corners
>>>>> of the box.
>>>>> options: passed on to draw.rectangle. Usually contains 'fill' (the 
>>>>> color)
>>>>> """
>>>>> box_scaled = [(coord[0] * self.xscale + self.xoffset + 0.5,
>>>>> coord[1] * self.yscale + self.yoffset + 0.5) for coord in box]
>>>>> try:
>>>>> self.draw.rectangle(box_scaled, **options)
>>>>> print("Draw rectangle succeeded.")
>>>>> except:
>>>>> print("Draw rectangle failed:")
>>>>> print(box)
>>>>> print(box_scaled)
>>>>> print(f"self.xscale: {self.xscale}, self.xoffset: {self.xoffset}, 
>>>>> self.yscale: {self.yscale}, self.yoffset: {self.yoffset}\n")
>>>>> pass
>>>>>
>>>>> And I get results as follows:
>>>>> # ((1680429600, 1029.6000000000001), (1680457455, 1030.1000000000001))
>>>>> # [(44.01851851865649, 144.4999999999709), (216.61388888955116, 
>>>>> 24.499999999970896)]
>>>>> # self.xscale: 0.004465020576131688, self.xoffset: -7503109, 
>>>>> self.yscale: -240.0, self.yoffset: 247248
>>>>>
>>>>> Do you have any clues on how to resolve this?
>>>>>
>>>>>
>>>>> 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/a295fd67-6ef3-4f31-9510-fb52dab1f353n%40googlegroups.com.

Reply via email to