Installation paths -debian package

79 views
Skip to first unread message

JM

unread,
May 5, 2019, 8:47:52 PM5/5/19
to weewx-user
I have previously set up two other weather stations using weewx. Just set up a new instance and I am finding that the default installation path for weewx.conf is incorrect. 
below is a error received in it's initial installation state. I have moved weewx.conf to the /home/pi/ directory and it runs. The weewx documentation indicates that the default DEB package will install to : /etc/weewx/weewx.conf.
Can anyone give me insight on how to point weewx to the /etc/weewx directory instead of /home/pi ?
 

pi@raspberrypi:~ $ sudo weewxd weewx.conf
Traceback (most recent call last):
  File "/usr/bin/weewxd", line 64, in <module>
    weewx.engine.main(options, args)
  File "/usr/share/weewx/weewx/engine.py", line 848, in main
    sane = os.stat(config_path).st_ctime
OSError: [Errno 2] No such file or directory: '/home/pi/weewx.conf'

Thomas Keffer

unread,
May 5, 2019, 11:19:24 PM5/5/19
to weewx-user
Irregardless of how weewx is installed, the following locations are searched when looking for weewx.conf:
  1. If an argument is given to weewxd, it uses that;
  2. Then it tries two levels up from the directory weewxd is in (this is useful when running out of the git repository);
  3. Then it tries /etc/weewx;
  4. Then it tries /home/weewx.
I suspect the problem is that the file /etc/weewx/weewx.conf doesn't exist? Make sure it does. If it does, then we'll have to investigate further.

-tk



--
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.
For more options, visit https://groups.google.com/d/optout.

JM

unread,
May 6, 2019, 5:32:08 PM5/6/19
to weewx-user
No its there, I copied the weewx.conf and weewx.conf.dist there.
without it, it will not run.
FWIW, I originally set up Raspian on a different, New MicroSD and encountered the same problem. both instances behaved the same way. Initially I thought maybe the SD card was defective.
So I imaged another card and encountered the same result.

I also copied the entire weewx folder from /etc/weewx/ to home/pi/  I dont think this made any difference. I'm confused, since I didn't run Setup.py and that installs to the paths this version is expecting.
Any help is appreciated.

JM

unread,
May 6, 2019, 5:35:22 PM5/6/19
to weewx-user
To clarify, my understanding is that setup.py installs to different paths than the DEB package. it almost seems as if they got switched.

gjr80

unread,
May 6, 2019, 6:54:19 PM5/6/19
to weewx-user
My understanding was that when weewxd is invoked the first command line parameter is the path and file name of the config file to be be used and no attempts are made to search elsewhere for the config file. My further understanding is that searches for the config file 'in the usual places' occur in the likes of the WeeWX utilities etc. Back to weewxd. If the config file (as given on the command like) does not exist WeeWX exits.

In the case above the command:

pi@raspberrypi:~ $ sudo weewxd weewx.conf

irrespective of WeeWX installation type, will cause weewxd to use /home/pi/weewx.conf as the config file, but of course that file does not exist so WeeWX exits. If WeeWX was installed via a deb package then weewx.conf will be in /etc/weewx and the correct command to use is:

$ sudo weewxd /etc/weewx/weewx.conf

Unless of course the present working directory is /etc/weewx in which case the original command would work.

Perhaps there is some confusion here over the command used to run WeeWX directly. The command is frequently given as:

$ sudo weewxd weewx.conf

which is often taken literally when in fact there is an implied need to include the path to weewx.conf. I don't have a problem with this format but perhaps there is a need for an explanatory note about the requirement for a path. Though I am not sure this is the only instance of an implied path in the documents, so if it is done for one it may need to be done for many.

In this case I would also remove all of the files copied to /home/pi (and any other non-standard WeeWX deb package locations), WeeWX may work with them in place now but you are setting yourself up for chasing your tail in the future when something does not work and you have multiples copies of WeeWX on your system.

Gary

Thomas Keffer

unread,
May 6, 2019, 8:34:26 PM5/6/19
to weewx-user
This is not the first time that Gary has corrected me on the workings of my own software!

He is correct. The search "in the usual places" applies only to the utilities. A path must be specified for weewxd.

-tk

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

JM

unread,
May 7, 2019, 6:21:51 PM5/7/19
to weewx-user
This did not help.
If I include the /etc/weewx/weewx.conf  path, it barfs.
It will run from the

$ sudo weewxd weewx.conf

This was a straightforward install i have done before. Not sure what I'm doing wrong but I feel like I went on three hour cruise and now I'm on gilligan's island. :(


On Monday, May 6
To unsubscribe from this group and stop receiving emails from it, send an email to weewx...@googlegroups.com.

gjr80

unread,
May 7, 2019, 6:23:40 PM5/7/19
to weewx-user
Would help to see exactly what it barfed.

Gary

Reply all
Reply to author
Forward
0 new messages