NOOB Questions on "Installation using setup.py" on Raspberry Pi

328 views
Skip to first unread message

radi...@gmail.com

unread,
May 21, 2022, 5:40:53 PM5/21/22
to weewx-user
I'm new to WeeWX, and have a new PWS, a Logia 5 in 1 (LOWSB510PB).  I have been a Cumulus user with several previous modest (fine offset) weather stations.  I'm using a Raspberry Pi 3B running the 64-bit Lite 2022-04-04 OS.  I'm comfortable with the Linux command line, and have written some Python.  I am interested in a Python-based solution.

I've been trying to follow...

I choose the setup.py with intentions of tinkering with the installation and at this point preferred everything being in one place.

I ran into some issues and I'd like to ask some questions - in a way that both serves me and perhaps has implications for susequent NOOBS.  (I have written quite a bit of documentation and would be happy to contribute to the project if I can.)

QUESTION:  What are the implications of choice between creating a user specifically for WeeWX, and using the default user "pi" on a Raspberry Pi?


QUESTION:  In the setup.cfg file, what are the implications of the "home" variable?  It was unclear to me if seeting it to "/home/pi/weewx-4.8.0" where I extracted the tar made sense but that is the root of the "install".  (That was the only change I made.)

The build and install seemed to run OK.  I didn't notice any issues (and I have the output).


QUESTION:  https://weewx.com/docs/setup.htm outlines; build, install, then run.  Is there some configurtion for the specific PWS required?

I tried running the daemon from the command line, first without, and then specifying the path to the config file.
$ sudo ./bin/weewxd /home/pi/weewx-4.8.0/weewx.conf
Traceback (most recent call last):
  File "/home/pi/weewx-4.8.0/./bin/weewxd", line 248, in <module>
    main()
  File "/home/pi/weewx-4.8.0/./bin/weewxd", line 147, in main
    engine = weewx.engine.StdEngine(config_dict)
  File "/home/pi/weewx-4.8.0/bin/weewx/engine.py", line 81, in __init__
    self.setupStation(config_dict)
  File "/home/pi/weewx-4.8.0/bin/weewx/engine.py", line 103, in setupStation
    driver = config_dict[station_type]['driver']
  File "/usr/lib/python3/dist-packages/configobj.py", line 554, in __getitem__
    val = dict.__getitem__(self, key)
KeyError: 'unspecified'

My best guess is that the build/install only partially configures weewx.conf.  I noticed this setting:
WEEWX_ROOT = /home/weewx
That doesn't seem to match what was coded in setup.cfg.  I looked through the web pages and couldn't spot anything I missed.

Oh, and this akso suggests to me a driver needs to be specified somewhere...?
$ sudo ./bin/wee_device
Using configuration file /home/pi/weewx-4.8.0/weewx.conf
Unable to determine driver: 'unspecified'


Thanks for reading ... As I mentioned, I do want to get WeeWX running, but I'm also motivated to make it easier for the next user,

Bob


I am a retired software engineer with a broad background including testing, customer support and technical documention (having worked on supercompters to embedded software).  I'll probably trying looking through the traceback because I'm interested in the code, but that's probably not helpful to NOOBs!  ;-)

vince

unread,
May 21, 2022, 6:50:37 PM5/21/22
to weewx-user
You're perhaps overthinking a bit.

1. weewx runs as root by default, so there's little gained by making a non-'pi' user really.   As long as your pi is adequately secured (change the 'pi' password of course) you're probably ok with the default setup.  You could choose to make a different non-privileged user but it gains little unless you change things to run as that non-privileged user rather than root, which ups the ante a bit re: permissions to talk to the hardware etc.  I'd suggest just running the defaults at least initially.

2. I don't know why you're messing with setup.cfg at all.  If you want to run a setup.py install, just go with it.  It'll put everything under /home/weewx in one place.   All you'll have to do is connect the public_html tree that will be created under /home/weewx/public_html to your webserver.  FWIW, I just symlink it.   You 'do' need to add a webserver on a pi since the os doesn't do that automagically for you.  I recommend nginx.

3. When you ran 'python3 setup.py install' it should have asked you the questions needed to populate weewx.conf including which driver to use.  I'd recommend using the Simulator for starters until you get used to the software.  Once you have that set up you can stop weewx, delete your archive and public_html contents, reconfigure weewx to the right driver for your station, and restart weewx.   Unfortunately I don't know anything about FO stations or if yours is supported or not so I can't help there.

I think you want to run "sudo /home/weewx/bin/wee_config --reconfigure" and answer the questions again so it populates weewx.conf appropriately.

paul...@gmail.com

unread,
May 22, 2022, 11:07:19 AM5/22/22
to weewx-user
Hi Bob

Your Logia looks to be identical to the Bresser 5-in-1 PC station I use (model 7002571). With it being the PC version (as opposed to the wireless version) you can use Bob Atchley's driver WS6in1. I've been using it since November 2020 and it has worked flawlessly for me. You'll find full details about it on Bob's github page:

In fact I've just checked and indeed the LOWSB510PB is listed.

Don't forget to register your station when you setup WeeWX then you will join a select band (currently 11 of us) on the WeeWX map who use the WS6in1 driver ;-)

Paul

radi...@gmail.com

unread,
May 22, 2022, 2:52:13 PM5/22/22
to weewx-user
@vince - Yeah, overthinking is likely...

My intent was to install WeeWX "out of the box" and get it up and running, to get familiar with it  (quite possibly reinstall using one of the other methods later thinking that might ease updates).  I ran into GPIO access issues when trying to manipulate them through a web page a while ago, so I planned to stick with "pi" initially.  I confess when I saw /home/weewx mentioned several times, I assumed this implied a user.  Nowhere does it say this that I recall, so not a valid assumption.  (A little sys admin bias perhaps.)  I've used Apache on most of my Pis, having failed to get nginx to run at one time, and having used Apache for some time.  I do have a hosted server which will be the target for observations eventually.

"Why mess with setup.cfg?"  The short answer is https://weewx.com/docs/setup.htm says "To specify an install location different from the default /home/weewx, modify the parameter home in the setup.cfg file." Again, I didn't want to create a weewx user (my assumption), and didn't understand the implications of what one chooses for home.

I did note that the code has to run under root / sudo.  Eventually I'll run it under systemd (using root).

I'll try wee_config --reconfigure when I get back to it.  Helpful tip, thanks!



When researching what station to buy I did note Bob Atchley's driver but didn't have the Logia model number on hand at the time.  Amazingly it does match!  I was looking for a USB-connected station, and they are getting harder to find it seems.  Appreciate the pointer to his git, and knowing that you've had good success with it.  (With Cumulus I had written a separate watchdog process because the comms were dropping fairly often.)

I had planned on registering once I was up and running - so we'll be 12!  ;-)

Thanks Folks- Very favorable experience with my first post to the forum!
Bob

Bob Atchley

unread,
May 23, 2022, 1:12:29 PM5/23/22
to weewx-user
And just as a slight addendum to your original post ...

I personally choose to run weewx as a non privileged user.  Its relatively simple to set up but the user does need to be in the www-data group to interface with the web server (assuming the web server is local) and needs permission to read/write to the usb see:

I use systemd to start/stop the weewx service and you need to add the user name into the [service] part of the configuration e.g.
User= myUser  
Group=myUser
Again the brilliant weewx Wiki has some stuff on using systemd see:

But as Vince says no need to do this, the default works out of the box ... but it can be done.  I found it useful while developing the WS6in1 driver.

Hope this helps rather than confuses

Bob

radi...@gmail.com

unread,
May 25, 2022, 10:50:03 AM5/25/22
to weewx-user
@Bob Atchley - Thanks!  Not confusing (to me) at all!  ;-)

Very helpful- particularly the Wiki links.  My usage of GitHub has been very limited from what I now see for WeeWX, so I'll have to do some exploring.  I've used Wikis often but was unaware GitHub has such a rich capability.

Thanks Again-
Bob

radi...@gmail.com

unread,
May 25, 2022, 8:16:41 PM5/25/22
to weewx-user
OK - I think I got connected and allowed part of the log to be captured.  Time to do more reading...

I read in the Logia manual that when plugged into a USB port, the console pulls some power via USB.  So I wanted to check for undervoltage with dmesg and noticed this when plugging in the console:

[356628.885042] usb 1-1.3: new full-speed USB device number 10 using dwc_otg
[356629.001467] usb 1-1.3: New USB device found, idVendor=1941, idProduct=8021, bcdDevice= 0.00
[356629.001511] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[356629.001536] usb 1-1.3: Product: CCLEL C8488
[356629.001558] usb 1-1.3: Manufacturer: Silicon Laboratories Inc.
[356629.001580] usb 1-1.3: SerialNumber: CCLEL c8488
[356629.024144] hid-generic 0003:1941:8021.001B: hiddev97,hidraw3: USB HID v1.11 Device [Silicon Laboratories Inc. CCLEL C8488] on usb-3f980000.usb-1.3/input0


This would seem to confirm Bob Atchley's in comment in https://github.com/bobatchley/weewx-ws6in1 that the Logia is likely manufactured by CCL Electronics.

I've found dmseg to be helpful for a number of things, including what the OS "thinks" about a USB device plugged into a port as it tried to make it accessible.

Cheers,
Bob

Looks promising!

radi...@gmail.com

unread,
May 30, 2022, 7:27:27 PM5/30/22
to weewx-user
@paul...@gmail.com

Up and running (mostly).  Looks like I'm on the map too (though I mis-typed the web site url).  location = "Washington/South Strabane, PA"

@Bob Atchley
Looking forward to looking through the code, but it's working well.

I did notice some startup warnings, like "WARNING user.ws6in1: genStartupRecords: bad CRC"

Also when I turned on debug I was getting a slew of 
May 30 17:36:19 pi-wx-05 weewx[153046] DEBUG user.ws6in1: decode::got my_time: 1653571800
May 30 17:36:19 pi-wx-05 weewx[153046] DEBUG user.ws6in1: decode::gettint time
May 30 17:36:19 pi-wx-05 weewx[153046] DEBUG user.ws6in1: decode::got my_time: 1653572100
May 30 17:36:19 pi-wx-05 weewx[153046] DEBUG user.ws6in1: decode::gettint time
May 30 17:36:19 pi-wx-05 weewx[153046] DEBUG user.ws6in1: decode::got my_time: 1653572400
May 30 17:36:19 pi-wx-05 weewx[153046] DEBUG user.ws6in1: decode::gettint time


Cheers, and Thanks Guys-
Bob

On Sunday, May 22, 2022 at 11:07:19 AM UTC-4 paul...@gmail.com wrote:

Bob Atchley

unread,
May 31, 2022, 3:29:21 AM5/31/22
to weewx-user
The warning is because the checksum received for a message from the console that is incorrect - not an issue as the driver simply re-requests the data.
The DEBUG info is a left over from when I was debugging the driver.  Agree its a bit spammy, but setting the debug flag to 0 in weewx.conf should remove these messages.
I will look at tidying up the debug messages at sometime in the future ...

Glad its working, great to have another user

Bob

radi...@gmail.com

unread,
May 31, 2022, 11:51:06 AM5/31/22
to weewx-user
Hi Bob-
Things seems to be working well, thanks!  I appreciate the effort that goes into coding a driver. As time allows I hope to look at the code a little.  I've done a little protocol work and always found it interesting.

Of course I run with debug = 0, but I was having a little trouble uploading to various public sites, particularly Weather Underground which in my mind can be unreliable at times, so I was trying to debug it.   If you look at the timestamps on the debug messages you can see they come fast and furious.  From what I read, I thought I could put "debug=0" in the [WS6in1] to quite the driver only, but it seemed not to help.

https://www.wunderground.com/dashboard/pws/KPAWASHI69 seems to be mostly OK though my station has disappeared from the map even while data is definately updating.  (Makes me chuckle - having worked at IBM for a time.)  Not unexpected for that site.

On thing I did discover is that, in my mind, the "[[Wunderground]]" section of weewx.conf could be made clearer.  The template includes fields for password and api_key, but after some trial an error I found that I had to specify what wunderground calls a "Key" in the password field to authenticate, so both fields are now set to the same value.  Seems like a reasonable work-around.  Once I get a little more familiar I may make or suggest a change (if only commentary).

Thanks Again!
Bob
Reply all
Reply to author
Forward
0 new messages