Weewx- MQTT permissions error

190 views
Skip to first unread message

Dun Mac

unread,
Mar 14, 2021, 8:08:05 PM3/14/21
to weewx-user
I have a MQTT broker setup on a dedicated RPi and another dedicated RPi running Weewx. The MQTT broker to client is working using manual testing. When I include the MQTT settings in Weewx.conf'
 [[MQTT]]
        server_url = mqtt://vantagepro:aug90sept...@192.168.8.158:1833/
        topic = weather
        unit_system = METRIC
        binding = archive, loop
        aggregation = aggregate

and then run wee_reports I get a permissions error on two of the Belchertown files

Traceback (most recent call last):
  File "/usr/share/weewx/weewx/reportengine.py", line 196, in run
    obj.start()
  File "/usr/share/weewx/weewx/reportengine.py", line 281, in start
    self.run()
  File "/usr/share/weewx/weewx/reportengine.py", line 429, in run
    ncopy += weeutil.weeutil.deep_copy_path(path, html_dest_dir)
  File "/usr/share/weewx/weeutil/weeutil.py", line 1440, in deep_copy_path
    shutil.copy(path, d)
  File "/usr/lib/python3.7/shutil.py", line 245, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.7/shutil.py", line 121, in copyfile
    with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: '/var/www/html/belchertown/favicon.ico'
Traceback (most recent call last):
  File "/usr/share/weewx/weewx/reportengine.py", line 196, in run
    obj.start()
  File "/usr/share/weewx/weewx/reportengine.py", line 281, in start
    self.run()
  File "/usr/share/weewx/user/belchertown.py", line 1857, in run
    with open(json_filename, mode='w') as jf:
PermissionError: [Errno 13] Permission denied: '/var/www/html/belchertown/json/homepage.json'
vantagepro@RPi-weather:/etc/weewx $

When I comment out the [[MQTT]] section in weewx.conf and re run wee_reports the report generation runs with no exceptions.

Has anyone had such an issue or able to make any suggestions for correction, please
Duncan

vince

unread,
Mar 14, 2021, 10:36:42 PM3/14/21
to weewx-user
try "sudo wee_reports" and see if that helps any or alternately just let weewx do things since it typically runs as root and shouldn't have permission issues.

Dun Mac

unread,
Mar 14, 2021, 11:19:25 PM3/14/21
to weewx-user
Thank you Vince. Weewx has always ran with no logged errors prior to the addition of the MQTT parameters. But when I have added the MQTT parameters to the weewx.conf the errors appear. I ran the "sudo weewx.conf" and the errors were not logged.  However I still have an issue that I can't get live updates nor the weewx-mqtt to effectively log onto the broker. I thought this permissions issue may have had something to do with matter.
Reply all
Reply to author
Forward
0 new messages