Unable to start Weewx

107 views
Skip to first unread message

Michael Grossie

unread,
Jul 11, 2020, 3:49:15 PM7/11/20
to weewx-user
Raspbian Stretch
Python v2.7, v3.5, v3.8.3
Default (for root) v3.8.3
Raspberry Pi  2 Model B
WeeWX v4.1.1

Following WeeWX using setup.py
used "sudo ./bin/weewxd" from inside the /home/weewx directory.
had some problems loading the following - 
sudo apt update 
 # Required 
sudo apt install python3-distutils - pi@raspberrypi:/ $ sudo apt install python3-distutils
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package python3-distutils
I was able to download and install "python-distutils-extra" from Debian.  Could not download "python3-distutils-extra_2.40_all.deb."

sudo apt install python3-configobj  -Loaded without issue
 sudo apt install python3-pil - Loaded without issue
sudo apt install python3-serial - Loaded without issue
sudo apt install python3-usb - Loaded without issue
sudo apt install python3-pip - Loaded without issue
sudo pip3 install cheetah3 - Loaded without issue
 # Optional: for extended almanac information 
sudo apt install python3-ephem - Loaded with out issue
 # Required if you are using MySQL (MariaDB): 
sudo apt install mysql-client - Did not install by choice
sudo apt install python3-mysqldb  - Did not install by choice

When I run the start command (as above and as below) I got :
pi@raspberrypi:/home/weewx $ sudo ./bin/weewxd
Traceback (most recent call last):
  File "./bin/weewxd", line 261, in <module>
    main()
  File "./bin/weewxd", line 148, in main
    engine = weewx.engine.StdEngine(config_dict)
  File "/home/weewx/bin/weewx/engine.py", line 69, in __init__
    self.setupStation(config_dict)
  File "/home/weewx/bin/weewx/engine.py", line 87, in setupStation
    driver = config_dict[station_type]['driver']
  File "/usr/lib/python2.7/dist-packages/configobj.py", line 554, in __getitem__
    val = dict.__getitem__(self, key)
KeyError: u'unspecified'

Checking the syslog -
pi@raspberrypi:/ $ sudo tail -f /var/log/syslog
Jul 11 14:04:26 raspberrypi weewx[941] CRITICAL __main__:     ****    File "./bin/weewxd", line 148, in main
Jul 11 14:04:26 raspberrypi weewx[941] CRITICAL __main__:     ****      engine = weewx.engine.StdEngine(config_dict)
Jul 11 14:04:26 raspberrypi weewx[941] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 69, in __init__
Jul 11 14:04:26 raspberrypi weewx[941] CRITICAL __main__:     ****      self.setupStation(config_dict)
Jul 11 14:04:26 raspberrypi weewx[941] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 87, in setupStation
Jul 11 14:04:26 raspberrypi weewx[941] CRITICAL __main__:     ****      driver = config_dict[station_type]['driver']
Jul 11 14:04:26 raspberrypi weewx[941] CRITICAL __main__:     ****    File "/usr/lib/python2.7/dist-packages/configobj.py", line 554, in __getitem__
Jul 11 14:04:26 raspberrypi weewx[941] CRITICAL __main__:     ****      val = dict.__getitem__(self, key)
Jul 11 14:04:26 raspberrypi weewx[941] CRITICAL __main__:     ****  KeyError: u'unspecified'
Jul 11 14:04:26 raspberrypi weewx[941] CRITICAL __main__:     ****  Exiting.

It appears that the python-configobj is the problem. It appears to think that it should be a version for Python2.7.

In checking the file structure, I find that I have:
/home/weewx
/var/run/weewx.pid 
 /var/log/syslog

Based on this it looks like the install just dumped it all into the /home/weewx folder as all the other "required" folders are there.

Suggestions appreciated.

TIA - Michael

vince

unread,
Jul 11, 2020, 4:53:20 PM7/11/20
to weewx-user
On Saturday, July 11, 2020 at 12:49:15 PM UTC-7, Michael Grossie wrote:
Raspbian Stretch
Python v2.7, v3.5, v3.8.3
Default (for root) v3.8.3
Raspberry Pi  2 Model B
WeeWX v4.1.1



Weewx doesn't currently care which python you use, as long as you have that python's prerequisites installed.  You can install with python2/pip or python3/pip3 either way as long as you're consistent.

Tom usually gives different instructions, but I've found here that explicitly calling the python I want and the pip I want makes things more known good.  So for me here I'd do "pip3 install whatever" and "python3 setup.py build ; python3 setup.py install" rather than expecting weewx to figure out which python I want to use.

That said, the error message looks to me like you specified your desired Station type, but have no block in weewx.conf defining that kind of station and how it works.   Check that first before messing around with any python stuff.  Change one thing at a time so you don't lose track of what you changed.

You didn't mention what kind of station you have, so I can't help much more there.  Usual 'how to report a problem' stuff applies.

Tom Keffer

unread,
Jul 11, 2020, 5:56:15 PM7/11/20
to weewx-user
Actually, it looks like just the opposite: you may or may not have an appropriate block in weewx.conf, but you definitely have not specified a station type for option 'station'. Use utility wee_config to fix:

cd /home/weewx
sudo python3 ./bin/wee_config --reconfigure

As for why it is running python 2, it will run whatever the "shebang" line on weewxd specifies. This is the very first line of the file. I'm betting that you ran setup.py without specifying a version of Python, so it went with the default on your system, python 2. 

To fix, either follow vince's suggestion and explicitly give the version of python:

sudo python3 ./bin/weewxd

Or, alternatively, you can start all over and reinstall, but this time explicitly specify the version of python you want to use:

sudo python3 ./setup.py install

setup.py will install a shebang line reflecting whatever you used to invoke it. In this case, python 3.

-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/f127e438-65fd-41d6-a635-cc7e4565e5f7o%40googlegroups.com.

Michael Grossie

unread,
Jul 11, 2020, 6:13:02 PM7/11/20
to weewx...@googlegroups.com
There was/is no Station Type described in the config file. I found it interesting when going through the install the weewx.conf file did not launch so that I could input that information. 
I'll edit the information in the weewx.conf file and see what happens -

Thanks
 
 
Michael H Grossie


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/nDTCR1aXMYY/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/CAPq0zEBQGjqwpgriqM1t7XrEe4crzhBQprVY4aRHkuq%3DAJ6W3w%40mail.gmail.com.

Tom Keffer

unread,
Jul 11, 2020, 6:38:56 PM7/11/20
to weewx-user
Please don't edit weewx.conf directly. You're likely to make a mistake. Use wee_config:

cd /home/weewx
sudo python3 ./bin/wee_config --reconfigure

Michael Grossie

unread,
Jul 11, 2020, 7:07:29 PM7/11/20
to weewx...@googlegroups.com
I will use wee_config.

Michael - via Honor 7

Michael Grossie

unread,
Jul 12, 2020, 12:04:10 PM7/12/20
to weewx...@googlegroups.com
Tom, Vince - 
Thanks - added station and other information to the weewx_config and it started up without errors. Now need to wait for the rest of the hardware parts to get here to complete the build.
Tom, this is the most pleasant forum experience that I have had - I will be back and will recommend.

Michael
 
 
Michael H Grossie


Reply all
Reply to author
Forward
0 new messages