Re-installed weewx using setup.py and now it won't start at boot

141 views
Skip to first unread message

seano...@gmail.com

unread,
Jul 4, 2021, 9:50:41 AM7/4/21
to weewx-user
Hi,

I originally had weewx installed using the DEB package which was fine. With the intention of using multiple instances of weewx for different stations, I have uninstalled that and then I re-installed weewx using setup.py to the /home/weewx/

It works perfectly when I run it directly in terminal using sudo ./bin/weewxd but I have not been able to add the script to init.d/weewx in order for it to run at boot. I have followed the instructions at https://weewx.com/docs/setup.htm but weewx will not start at boot and after boot, even if I manually run sudo /etc/init.d/weewx start it does nothing. I can tell because I'm tailing the log file and nothing happens. Run it manually, it starts collecting data perfectly.

I used the default file from /weewx/utils/weewx.debian and copied it to /etc/init.d/weewx and I did not make any changes. Is there something else I'm supposed to do. The weewx installation was done to the default /home/weewx directory.

Would appreciate any suggestions.

Tom Keffer

unread,
Jul 4, 2021, 10:54:43 AM7/4/21
to weewx-user
Make sure the script in /etc/init.d/weewx references your new copy of weewxd in /home/weewx/bin, and not the old copy in /usr/share/weewx

But, it's hard to say anything definitive without seeing the log.

-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.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/9cfe9263-c54c-47f3-9ed5-f2197bb7696en%40googlegroups.com.

Sean Jahnig

unread,
Jul 4, 2021, 4:47:10 PM7/4/21
to weewx-user
Thanks for the reply. It could very well be the init.d/weewx script but i've started at it and from what i understand, i can't see an error. I've attached weewx.txt which is the top half of the init.d script.

I cleared the syslog and the weewx.log and then i rebooted. After the reboot i pasted the syslog into the attached syslog.txt - and the weewx.log remained empty so nothing to attach.

After the boot, i tried to run this sudo /etc/init.d/weewx start and nothing happens, nor gets added to the log.

Lastly, i ran cd /home/weewx and then sudo ./bin/weewxd and it immediately worked and started working.



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/POwnsa43jyI/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/CAPq0zEA7A0rcQ_OqmiqdYe_6MTNXy-rJH1LH8Vge1heqAxkuNg%40mail.gmail.com.
syslog.txt
weewx.txt

vince

unread,
Jul 4, 2021, 5:06:00 PM7/4/21
to weewx-user
We've seen this one before recently.

See if the pid file referenced in the init.d file is present in /var/run - if it's there either delete it manually or else do a couple 'sysctl stop weewx' commands to delete it.   Subsequent startups should work ok.


Sean Jahnig

unread,
Jul 4, 2021, 11:19:01 PM7/4/21
to weewx-user
Thanks Vince,

I checked that folder and i don't see anything out of sorts there. I'll admit i don't know what i am looking for. See attached screenshot.

I don't really understand all of this, but could there somehow be a dead path, symblink or something like that remaining from a previous weewx install (originally weewx was installed using DEB and now it's installed using setup.py)

Thanks,
Sean.

image.jpg

Tom Keffer

unread,
Jul 4, 2021, 11:28:22 PM7/4/21
to weewx-user
Things to try

1. Where are you getting this system log? It looks very sparse.

2. What version of Raspbian are you using? (Use "cat /etc/os-release")

3. Try using a -x switch before running /etc/init.d/weewx. It will at least tell you what it's doing:

set -x
sudo /etc/init.d/weewx start
set +x

-tk

Sean Jahnig

unread,
Jul 5, 2021, 12:15:11 AM7/5/21
to weewx-user
Thanks Tom,

I'm using Linux 10 Buster.

I tried that -x please see attached. I get the feeling like it's not even trying to run weewx. 

I cleared the syslog before i rebooted, that's why it's so sparse. I am getting it from /var/log/syslog. Everything related to weewx is in /var/log/weewx.log which you can see here. Whatever you see there with weewx running is when it has been run automatically. I'm sure this is an OS problem, somehow init.d is not doing what it's supposed to.

Thanks


image_02.jpg

vince

unread,
Jul 5, 2021, 3:04:54 AM7/5/21
to weewx-user
It's rather hard to tell what it's doing based on you (re)starting the service versus running manually perhaps.

At Jul 5 08:04:52 I see a keyboard interrupt then another start at 08:05:17 which seems to run.  At 08:10:19 it adds a record to the db but fails to run the Seasons skin due to the skin.conf file being missing.  If you look carefully you'll see it looking for the skin in /etc/weewx (where the dpkg puts things) rather than /home/weewx (where setup.py puts things) so basically your weewx.conf file seems to be pointing to where dpkg puts things, not where setup.py puts things...for at least the skins.

I do see some i/o errors in there (first example Jul 5 00:00:41) and weewx resetting as a result so I don't know if it's aborting on you due to lack of hearing data from the station maybe.

But it's definitely running..

Chiny

unread,
Jul 5, 2021, 3:50:51 AM7/5/21
to weewx-user
Why the discussion re init.d ?  Looking at my system, weewx appears to use systemd, so:
systemctl status weewx
should show whether weewx is running
and something like (not tested)
sudo systemctl enable weewx.service
to make weewx run on bootup.

Weewx newbie here, so it may not be so simple.

And:
sudo cat /var/log/syslog | grep weewx
for easily looking through a vast syslog for the weewx bits.

Sean Jahnig

unread,
Jul 5, 2021, 4:44:56 AM7/5/21
to weewx-user
Thanks Vince,

Yes, weewx runs perfectly when i start it manually. If i reboot, it does not start automatically. I'm convinced the previous install of weewx has left some confusion on the system. In fact, i tried to install weewx from deb again and it also wasn't starting automatically. I think things are just confusing, I may need to start from scratch.

@Chiny, thanks for the reply. I did initially have weewx installed via deb (like you) and then sudo service weewx start used to work perfectly. But since i installed a 2nd station and wanted to play with weewx-multi i ran into trouble and at that point tried to install weewx via setup.py in order to troubleshoot. In the process just made more trouble 😂

vince

unread,
Jul 5, 2021, 12:22:00 PM7/5/21
to weewx-user
You're changing too many things and not completely cleaning up what you had before.

I'd suggest starting over with the Simulator then switching to the real driver you want to use (presumably SDR from your previous posts).
  • Remove the debian package.  Remove the /etc/weewx tree if it still exists.   There might be other stuff still remaining on the system, consult the debian tab (HERE) for where to look.
  • Remove remnants of the previous setup.py by removing the /home/weewx tree.  Remove the init.d file if present. 
  • Reboot the system just in case (I really hate saying that, but you might have systemd confused at this point)
Now start over:
  • Install via setup.py and pick the Simulator driver.  Get that to work.  Make sure it runs after a reboot of the system.
  • Then switch to your real driver, presumably SDR from what you've posted.  Get that to work.  Make sure it runs after a reboot of the system.
  • Then if you want to use weewx-multi move on from there. 
Do one thing at a time.

Sean Jahnig

unread,
Jul 6, 2021, 12:13:26 AM7/6/21
to weewx-user
Thanks Vince,

That is good advice. I tried that more than once and the problem persists so i'm ready to drive out to the location and collect the SD card to format it so i can start fresh.

This is the first weather station I built so I probably did something wrong when I first set it up. I remember following an article that stored the weewx reports in RAM rather than on the sd card to preserve the life of the sd card. I have no idea how to disable that so maybe its something like that which is locking the system into thinking weewx is in it's original deb installation. This is the tutorial.



--
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/POwnsa43jyI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

seano...@gmail.com

unread,
Jul 9, 2021, 4:29:04 AM7/9/21
to weewx-user
Just a quick update.

One last attempt to get weewx running at boot before I drive out and format the microsd card to start fresh. I followed the below article to automatically run weewx using systemd and it is working now! Thanks for all the support.
Reply all
Reply to author
Forward
0 new messages