Thank you very much! You are right! Setting the show_daynight to false 
fixes the problem. When I set it to true and add your logging messages 
(together with mine that I already had added) I get the following:

In _renderDayNight(), self.yscale = (0.0, 5.0, 0.5) 
latitude=48.14, longitude=11.57 
first=night, transitions=[1680497278, 1680543969] 
Draw rectangle failed: 
((1680462000, 0.0), (1680497278, 5.0)) 
[(44.90740740764886, 144.5), (202.42440329305828, 24.5)] 
self.xscale: 0.004465020576131688, self.xoffset: -7503253, self.yscale: 
-24.0, self.yoffset: 144 

Draw rectangle failed: 
((1680497278, 0.0), (1680543969, 5.0)) 
[(202.42440329305828, 144.5), (410.9006790127605, 24.5)] 
self.xscale: 0.004465020576131688, self.xoffset: -7503253, self.yscale: 
-24.0, self.yoffset: 144
...

I did not change anything in the skin.conf file before. It is the one 
coming the the weewx-4.10.2.tar.gz

As a side remark: I use the native GW1000 driver in my "WeeWX: Installation 
using setup.py". But the docker image I left as much untouched as it was 
and used the interceptor driver that was installed in the image.

Do the above log messages tell you anything further? What should I do to 
avoid the problem (except turning this feature off)?

Thank you very much!

Tom Keffer schrieb am Montag, 3. April 2023 um 18:07:14 UTC+2:

> Thanks for your exceptionally detailed query! Unfortunately, I can't 
> diagnose anything related to Docker, or your unusual configuration. I 
> assume you are using the Seasons skin. Some thoughts:
>
> Any particular reason why you're trying to use the interceptor driver, 
> rather than the native GW1000 driver 
> <https://github.com/gjr80/weewx-gw1000>?
>
> Did you change anything in skin.conf?
>
> The problem seems to be around the drawing of the day/night transition 
> bands. Does it work if you set option "show_daynight" in skin.conf to 
> False?
>
> It would be useful to see some values in _renderDayNight in genplot.py. The 
> following should do it:
>
> ===================================================================
> diff --git a/bin/weeplot/genplot.py b/bin/weeplot/genplot.py
> --- a/bin/weeplot/genplot.py (revision 
> b5a79042fb5017c8c0d342e957ae1fa98040bd94)
> +++ b/bin/weeplot/genplot.py (date 1680537716331)
> @@ -259,6 +259,9 @@
>          """Draw vertical bands for day/night."""
>          (first, transitions) = weeutil.weeutil.getDayNightTransitions(
>              self.xscale[0], self.xscale[1], self.latitude, self.longitude)
> +        print(f"In _renderDayNight(), self.yscale = {self.yscale}")
> +        print(f"latitude={self.latitude}, longitude={self.longitude}")
> +        print(f"first={first}, transitions={transitions}")
>          color = self.daynight_day_color \
>              if first == 'day' else self.daynight_night_color
>          xleft = self.xscale[0]
> ===================================================================
>
> -tk
>
>
> On Mon, Apr 3, 2023 at 4:18 AM c s (224) <[email protected]> wrote:
>
>> 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 [email protected].
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/cf100b38-68c2-47de-ae9d-0b1d91a2da96n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/weewx-user/cf100b38-68c2-47de-ae9d-0b1d91a2da96n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/5d6ed69a-7e0d-47e3-bb46-fa695bceb6dan%40googlegroups.com.

Reply via email to