Problems with weewx on MacOS

258 views
Skip to first unread message

seano...@gmail.com

unread,
May 20, 2023, 4:38:55 AM5/20/23
to weewx-user
Hi,

I have done many successful installations of weewx on raspberry pi and I previously installed weewx on MacOS successfully. About a month ago, the MacOS station stopped reporting so I have been troubleshooting it. I can't figure out what is going on because I am very poor with python. Can anyone give me any suggestions? I have tried to remove and reinstall python3 using brew - currently version 3.10.8 is running when I type 'python3 --version'.

I also updated weewx to 4.10.2 and from what i can see everything is installed and working, including all dependencies. But still when I run 'sudo python3 ./bin/weewxd weewx.conf' I get python errors. Please can someone see below and give me any suggestions? Thank you

apple@Mac-mini weewx % sudo python3 ./bin/weewxd weewx.conf
Traceback (most recent call last):
  File "/usr/local/Cellar/pyt...@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/logging/config.py", line 565, in configure
    handler = self.configure_handler(handlers[name])
  File "/usr/local/Cellar/pyt...@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/logging/config.py", line 723, in configure_handler
    klass = self.resolve(cname)
  File "/usr/local/Cellar/pyt...@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/logging/config.py", line 383, in resolve
    name = s.split('.')
AttributeError: 'NoneType' object has no attribute 'split'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/Shared/weewx/./bin/weewxd", line 249, in <module>
    main()
  File "/Users/Shared/weewx/./bin/weewxd", line 98, in main
    weeutil.logger.setup(options.log_label, config_dict)
  File "/Users/Shared/weewx/bin/weeutil/logger.py", line 139, in setup
    logging.config.dictConfig(log_dict)
  File "/usr/local/Cellar/pyt...@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/logging/config.py", line 811, in dictConfig
    dictConfigClass(config).configure()
  File "/usr/local/Cellar/pyt...@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/logging/config.py", line 572, in configure
    raise ValueError('Unable to configure handler '
ValueError: Unable to configure handler 'rotate'
apple@Mac-mini weewx % 

Tom Keffer

unread,
May 20, 2023, 7:40:00 AM5/20/23
to weewx...@googlegroups.com
By default, V4.10.2 does not include a 'rotate' logging handler. It has to be added.

By any chance, do you have a [Logging] section in weewx.conf? If so, what does it say?

--
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/298c4f09-6ad2-40af-90c6-4469811ac778n%40googlegroups.com.

seano...@gmail.com

unread,
May 21, 2023, 4:52:13 AM5/21/23
to weewx-user
Hi Tom,

Thanks for the reply. You are right, I removed the [Logging] section from the weewx.conf file and then it ran successfully and I can see all the output. Now I am running into another problem where the data is not being posted to windguru. Please can you check the output here and give me your opinion of what is wrong? I also posted a small part of it below. Thanks in advance. 

'None', 'humidex': 'None', 'inDewpoint': 'None', 'maxSolarRad': 'None', 'outHumidity': 'None', 'outTemp': 'None', 'outTempBatteryStatus': '2.76', 'pressure': 'None', 'radiation': '692', 'rain': '0.0', 'rainRate': '0.0', 'usUnits': '1', 'UV': '9.85', 'windBatteryStatus': '2.76', 'windchill': 'None', 'windDir': '35', 'windrun': 'None'
REC:    2023-05-21 10:30:00 +04 (1684650600) 'altimeter': 'None', 'appTemp': 'None', 'barometer': 'None', 'cloudbase': 'None', 'dateTime': '1684650600', 'dewpoint': 'None', 'ET': '0.0008638609251008569', 'heatindex': 'None', 'humidex': 'None', 'inDewpoint': 'None', 'interval': '5.0', 'maxSolarRad': 'None', 'outHumidity': 'None', 'outTemp': 'None', 'outTempBatteryStatus': '2.7618', 'pressure': 'None', 'radiation': '471.6', 'rain': '0.0', 'rainRate': '0.0', 'usUnits': '1', 'UV': '7.0120000000000005', 'windBatteryStatus': '2.7618', 'windchill': 'None', 'windrun': 'None'

Traceback (most recent call last):
  File "/Users/Shared/weewx/bin/weewx/reportengine.py", line 197, in run
    obj.start()
  File "/Users/Shared/weewx/bin/weewx/reportengine.py", line 385, in start
    self.run()
  File "/Users/Shared/weewx/bin/weewx/imagegenerator.py", line 42, in run
    self.gen_images(self.gen_ts)
  File "/Users/Shared/weewx/bin/weewx/imagegenerator.py", line 114, in gen_images
    image = plot.render()
  File "/Users/Shared/weewx/bin/weeplot/genplot.py", line 222, in render
    self._renderDayNight(sdraw)
  File "/Users/Shared/weewx/bin/weeplot/genplot.py", line 266, in _renderDayNight
    sdraw.rectangle(((xleft,self.yscale[0]),
  File "/Users/Shared/weewx/bin/weeplot/utilities.py", line 442, in rectangle
    self.draw.rectangle(box_scaled, **options)
  File "/usr/local/lib/python3.10/site-packages/PIL/ImageDraw.py", line 294, in rectangle
    self.draw.draw_rectangle(xy, fill, 1)
ValueError: y1 must be greater than or equal to y0

jiaqi Yan

unread,
May 21, 2023, 5:10:04 AM5/21/23
to weewx...@googlegroups.com

寄件者: weewx...@googlegroups.com <weewx...@googlegroups.com> 代表 seano...@gmail.com <seano...@gmail.com>
寄件日期: Sunday, May 21, 2023 4:52:13 PM
收件者: weewx-user <weewx...@googlegroups.com>
主旨: Re: [weewx-user] Problems with weewx on MacOS
 

seano...@gmail.com

unread,
May 21, 2023, 5:33:30 AM5/21/23
to weewx-user
As an update to this, I uninstalled Pillow 9.5.0 and then installed Pillow 9.4.0 and now the error is gone.

However, I am still having some problem and I'm struggling to identify exactly what because I'm not sure how to check the logs on MacOS. I'm sorry for the noob question, but can someone please guide me on where weewx is logging to? I can confirm that it is not /var/log/weewx.log or /var/tmp/weewx.log. Originally I had added a [Logging] section in weewx.conf but now the weewx 4.10.2 has removed that functionality I am not sure how else to log weewx output to a different file.

Appreciate the help, thanks.

Graham Eddy

unread,
May 21, 2023, 5:47:54 AM5/21/23
to WeeWX User
tom did not say that 4.10.2 removed [Logging], he did ask you to remove that section temporarily, to get it to use default, in case your own content of that section was wrong. tom said that you were using a specific item (i think it was ‘rotate’) that was removed in 4.10.2 and thus causing your runtime error

i think in macOS the default behaviour is to log under /var/log/system.log

once the default configuration is working, no doubt you will add some entries to [Logging] to use a file of your choice, such as /var/log/weewx.log
⊣GE⊢

Tom Keffer

unread,
May 21, 2023, 7:43:15 AM5/21/23
to weewx...@googlegroups.com
I have never been able to get system logging from Python to work on the Mac. I'm sure it can be done --- I just don't know how. If you Google around, apparently others have struggled to get it to work as well.

Instead, I just log to a rotating file. See the section Logging to rotating files in the Wiki. The example logs to /var/log/weewx.log, which will require root privileges. Another option is to log to /Users/Shared/weewx/weewx.log, or some other place where you don't need those privileges.



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

seano...@gmail.com

unread,
May 21, 2023, 11:47:15 AM5/21/23
to weewx-user
Thank you for the replies and suggestions. The logging is now working to /var/log/weewx.log

When I run weewx directly I can see the sensor data coming in. It seems like it's just the final step when it uploads the data to windguru that it is failing. I have confirmed that the station details are correct. When I ping windguru.cz, there is a reply. Any ideas?

2023-05-21 19:35:41  weewx[3859] DEBUG weewx.reportengine: Report 'RSYNC' not enabled. Skipping.
2023-05-21 19:35:44  weewx[3859] DEBUG weewx.restx: WindGuru: Failed upload attempt 2: Server response: b'ERROR (no data)'
2023-05-21 19:35:45  weewx[3859] DEBUG weewx.restx: StationRegistry: Failed upload attempt 2: HTTP Error 502: Bad Gateway
2023-05-21 19:35:50  weewx[3859] DEBUG weewx.restx: WindGuru: Failed upload attempt 3: Server response: b'ERROR (no data)'
2023-05-21 19:35:50  weewx[3859] ERROR weewx.restx: WindGuru: Failed to publish record 2023-05-21 19:35:00 +04 (1684683300): Failed upload after 3 tries
2023-05-21 19:35:51  weewx[3859] DEBUG weewx.restx: StationRegistry: Failed upload attempt 3: HTTP Error 502: Bad Gateway
2023-05-21 19:35:51  weewx[3859] ERROR weewx.restx: StationRegistry: Failed to publish record 2023-05-21 19:35:00 +04 (1684683300): Failed upload after 3 tries



Tom Keffer

unread,
May 21, 2023, 11:59:08 AM5/21/23
to weewx...@googlegroups.com
I don't know anything about the windguru uploader. You can try asking the author.

I will say that "Bad Gateway" usually means a problem with a load balancing server, or something like that. It could be a problem on the windguru end.

There's also a pending "pull request" that updates how authentication is done. Perhaps that's the problem? Don't know. You can give it a try.

-tk

seano...@gmail.com

unread,
May 21, 2023, 12:15:17 PM5/21/23
to weewx-user
Thanks Tom for all your help with this. Really appreciate it.

I will look into this further and also try and ask the author.

bell...@gmail.com

unread,
May 21, 2023, 3:53:20 PM5/21/23
to weewx-user
Tom, 
I think the 502 is from station registry. Nothing is displaying on the map and GET stations is returning a 502
rich 

Tom Keffer

unread,
May 21, 2023, 4:22:54 PM5/21/23
to weewx...@googlegroups.com
Oops. Missed that! Thanks, Rich.

Not sure why the registry would return that error. Try debug=2 in weewx.conf, restart weewxd, let it run for a reporting cycle of two, then post the log. Option debug=2 will log the full URL used for the GET to the registry. 



bell...@gmail.com

unread,
May 21, 2023, 5:40:54 PM5/21/23
to weewx-user
Sorry, I was in a hurry and wasn’t clear. I think StationRegistry and WindGuru are both failing.
Re: StationRegistry
Go to http://weewx.com/stations.html. Nothing is displayed. The GET request to  /api/v2/stations/?limit=2000 is also returning a 502. So, like you said, seems like a server issue…
rich

Tom Keffer

unread,
May 21, 2023, 7:28:01 PM5/21/23
to weewx...@googlegroups.com
Right you are. 

Fixed.

seano...@gmail.com

unread,
May 21, 2023, 10:36:46 PM5/21/23
to weewx-user
Thanks for the feedback. So is it something I am doing wrong, or can fix on my end? What action should I take?

Important to note that through my fiddling over the last few days, the station did report for about 20 min yesterday and then about 3 hours on 19th May.

The location of the station is off grid and only powers on with generators from 12pm every day. Later today I will try debug=2 in weewx.conf and report back.

Thanks

Sean Jahnig

unread,
May 25, 2023, 5:52:04 AM5/25/23
to weewx...@googlegroups.com
Hi Tom,

Sorry that it took time to update on this, the remote location had a problem with their internet for a few days so i was not able to access it remotely until now.

I set debug=2 in weewx.conf and below is the output. Can you make any sense of it?

2023-05-25 13:33:23  weewx[989] DEBUG weewx.engine: Loading service weewx.engine.StdReport

2023-05-25 13:33:23  weewx[989] INFO weewx.engine: 'pyephem' not detected, extended almanac data is not available

2023-05-25 13:33:23  weewx[989] DEBUG weewx.engine: Finished loading service weewx.engine.StdReport

2023-05-25 13:33:23  weewx[989] INFO __main__: Starting up weewx version 4.10.2

2023-05-25 13:33:23  weewx[989] DEBUG weewx.engine: Station does not support reading the time

2023-05-25 13:33:23  weewx[989] INFO weewx.engine: Using binding 'wx_binding' to database 'weewx.sdb'

2023-05-25 13:33:23  weewx[989] INFO weewx.manager: Starting backfill of daily summaries

2023-05-25 13:33:23  weewx[989] INFO weewx.manager: Daily summaries up to date

2023-05-25 13:33:23  weewx[989] INFO weewx.engine: Starting main packet loop.

2023-05-25 13:33:23  weewx[989] DEBUG weewx.manager: Daily summary version is 4.0

2023-05-25 13:36:03  weewx[989] INFO weewx.manager: Added record 2023-05-25 13:35:00 +04 (1685007300) to database 'weewx.sdb'

2023-05-25 13:36:03  weewx[989] INFO weewx.manager: Added record 2023-05-25 13:35:00 +04 (1685007300) to daily summary in 'weewx.sdb'

2023-05-25 13:36:03  weewx[989] DEBUG user.windguru: url: http://www.windguru.cz/upload/api.php?stationtype=weewx&uid=10004&salt=1685007300~salted&hash=6bbd54aaf782a1a40662b4fcaaf75ee0&interval=60&percip_interval=3600&precip=0.00

2023-05-25 13:36:03  weewx[989] DEBUG weewx.reportengine: Running reports for latest time in the database.

2023-05-25 13:36:03  weewx[989] DEBUG weewx.reportengine: Running report 'SeasonsReport'

2023-05-25 13:36:03  weewx[989] DEBUG weewx.restx: StationRegistry url: 'http://weewx.com/register/register.cgi?station_url=www.kitebeachcenter.ae&description=Mikoko%2C+UAQ&latitude=25.5388&longitude=55.6287&station_type=WeatherFlowUDP&station_model=%3Cbound+method+WeatherFlowUDPDriver.hardware_name+of+%3Cuser.weatherflowudp.WeatherFlowUDPDriver+object+at+0x1061ec940%3E%3E&python_info=3.10.8&platform_info=macOS-12.5-x86_64-i386-64bit&config_path=%2FUsers%2FShared%2Fweewx%2Fweewx.conf&entry_path=%2FUsers%2FShared%2Fweewx%2Fbin%2Fweewxd&weewx_info=4.10.2'

2023-05-25 13:36:03  weewx[989] DEBUG weewx.restx: WindGuru url: 'http://www.windguru.cz/upload/api.php?stationtype=weewx&uid=10004&salt=1685007300~salted&hash=6bbd54aaf782a1a40662b4fcaaf75ee0&interval=60&percip_interval=3600&precip=0.00'

2023-05-25 13:36:03  weewx[989] DEBUG weewx.reportengine: Found configuration file /Users/Shared/weewx/skins/Seasons/skin.conf for report 'SeasonsReport'

2023-05-25 13:36:03  weewx[989] DEBUG weewx.cheetahgenerator: Using search list ['weewx.cheetahgenerator.Almanac', 'weewx.cheetahgenerator.Current', 'weewx.cheetahgenerator.DisplayOptions', 'weewx.cheetahgenerator.Extras', 'weewx.cheetahgenerator.Gettext', 'weewx.cheetahgenerator.JSONHelpers', 'weewx.cheetahgenerator.PlotInfo', 'weewx.cheetahgenerator.SkinInfo', 'weewx.cheetahgenerator.Station', 'weewx.cheetahgenerator.Stats', 'weewx.cheetahgenerator.UnitInfo']

2023-05-25 13:36:03  weewx[989] DEBUG weewx.manager: Daily summary version is 4.0

2023-05-25 13:36:04  weewx[989] INFO weewx.cheetahgenerator: Generated 8 files for report SeasonsReport in 0.88 seconds

2023-05-25 13:36:04  weewx[989] DEBUG weewx.manager: Daily summary version is 4.0

2023-05-25 13:36:04  weewx[989] INFO weewx.imagegenerator: Generated 15 images for report SeasonsReport in 0.58 seconds

2023-05-25 13:36:04  weewx[989] INFO weewx.reportengine: Copied 5 files to /Users/Shared/weewx/public_html

2023-05-25 13:36:04  weewx[989] DEBUG weewx.reportengine: Report 'SmartphoneReport' not enabled. Skipping.

2023-05-25 13:36:04  weewx[989] DEBUG weewx.reportengine: Report 'MobileReport' not enabled. Skipping.

2023-05-25 13:36:04  weewx[989] DEBUG weewx.reportengine: Report 'StandardReport' not enabled. Skipping.

2023-05-25 13:36:04  weewx[989] DEBUG weewx.reportengine: Report 'FTP' not enabled. Skipping.

2023-05-25 13:36:04  weewx[989] DEBUG weewx.reportengine: Report 'RSYNC' not enabled. Skipping.

2023-05-25 13:36:33  weewx[989] DEBUG weewx.restx: StationRegistry: Failed upload attempt 1: <urlopen error [Errno 8] nodename nor servname provided, or not known>

2023-05-25 13:36:38  weewx[989] DEBUG weewx.restx: StationRegistry url: 'http://weewx.com/register/register.cgi?station_url=www.kitebeachcenter.ae&description=Mikoko%2C+UAQ&latitude=25.5388&longitude=55.6287&station_type=WeatherFlowUDP&station_model=%3Cbound+method+WeatherFlowUDPDriver.hardware_name+of+%3Cuser.weatherflowudp.WeatherFlowUDPDriver+object+at+0x1061ec940%3E%3E&python_info=3.10.8&platform_info=macOS-12.5-x86_64-i386-64bit&config_path=%2FUsers%2FShared%2Fweewx%2Fweewx.conf&entry_path=%2FUsers%2FShared%2Fweewx%2Fbin%2Fweewxd&weewx_info=4.10.2'

2023-05-25 13:37:03  weewx[989] DEBUG weewx.restx: WindGuru: Failed upload attempt 1: <urlopen error timed out>

2023-05-25 13:37:08  weewx[989] DEBUG weewx.restx: StationRegistry: Failed upload attempt 2: HTTP Error 400: BAD REQUEST

2023-05-25 13:37:08  weewx[989] DEBUG weewx.restx: WindGuru url: 'http://www.windguru.cz/upload/api.php?stationtype=weewx&uid=10004&salt=1685007300~salted&hash=6bbd54aaf782a1a40662b4fcaaf75ee0&interval=60&percip_interval=3600&precip=0.00'

2023-05-25 13:37:08  weewx[989] INFO weewx.restx: WindGuru: Published record 2023-05-25 13:35:00 +04 (1685007300)

2023-05-25 13:37:13  weewx[989] DEBUG weewx.restx: StationRegistry url: 'http://weewx.com/register/register.cgi?station_url=www.kitebeachcenter.ae&description=Mikoko%2C+UAQ&latitude=25.5388&longitude=55.6287&station_type=WeatherFlowUDP&station_model=%3Cbound+method+WeatherFlowUDPDriver.hardware_name+of+%3Cuser.weatherflowudp.WeatherFlowUDPDriver+object+at+0x1061ec940%3E%3E&python_info=3.10.8&platform_info=macOS-12.5-x86_64-i386-64bit&config_path=%2FUsers%2FShared%2Fweewx%2Fweewx.conf&entry_path=%2FUsers%2FShared%2Fweewx%2Fbin%2Fweewxd&weewx_info=4.10.2'

2023-05-25 13:37:13  weewx[989] DEBUG weewx.restx: StationRegistry: Failed upload attempt 3: HTTP Error 400: BAD REQUEST

2023-05-25 13:37:13  weewx[989] ERROR weewx.restx: StationRegistry: Failed to publish record 2023-05-25 13:35:00 +04 (1685007300): Failed upload after 3 tries




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

Tom Keffer

unread,
May 25, 2023, 7:24:33 AM5/25/23
to weewx...@googlegroups.com
The station_url is invalid. You're using "www.kitebeachcenter.ae". It needs an "https://" in front, so it becomes


Meanwhile, whatever problem windguru had now seems to have gone away.


seano...@gmail.com

unread,
May 25, 2023, 8:12:07 AM5/25/23
to weewx-user
Thank you. It is posting to windguru now, but it seems the posts are empty. Windguru has a time stamp that is current, but there is no wind data. Upon a closer look I noticed that there is no WeatherFlowUDP [[sensor_map]] being loaded when weewx starts! I can't seem to figure out why though, the weewx.conf has the [[sensor_map]] and I don't notice any code issues. (I placed a copy below). I tried to use the other two udp_address options but they give errors.

As a final comment, I switched to 'Simulator' and it is posting to windguru correctly. This tells me that there is a problem with the 'WeatherFlowUDP' driver which appears to load correctly but according to the log, does not load the [[sensor_map]] when weewx starts. Any thoughts?

[WeatherFlowUDP]
    driver = user.weatherflowudp
    log_raw_packets = False
    udp_address = 0.0.0.0    
    # udp_address = <broadcast>
    # udp_address = 255.255.255.255
    udp_port = 50222
    udp_timeout = 90
    share_socket = False

    [[sensor_map]]
        outTemp = air_temperature.ST-00055111.obs_st
        outHumidity = relative_humidity.ST-00055111.obs_st
        pressure = station_pressure.ST-00055111.obs_st
        #lightning_strikes =  lightning_strike_count.ST-00055111.obs_st
        #avg_distance =  lightning_strike_avg_distance.ST-00055111.obs_st
        outTempBatteryStatus = battery.ST-00055111.obs_st
        windSpeed = wind_speed.ST-00055111.obs_st
        windDir = wind_direction.ST-00055111.obs_st
        #luxXXX = illuminance.ST-00055111.obs_st
        UV = uv.ST-00055111.obs_st
        rain = rain_accumulated.ST-00055111.obs_st
        windBatteryStatus = battery.ST-00055111.obs_st
        radiation = solar_radiation.ST-00055111.obs_st
        #lightningXXX = distance.ST-00055111.obs_st
        #lightningYYY = energy.ST-00055111.obs_st

Tom Keffer

unread,
May 25, 2023, 9:23:42 AM5/25/23
to weewx...@googlegroups.com
Sorry, but I don't know anything about the WF UDP driver. You'll have to ask the author.

Reply all
Reply to author
Forward
0 new messages