Upgrade from 3.9.2 to 4.1.1 issues

200 views
Skip to first unread message

Mark Jenks

unread,
Oct 25, 2020, 12:58:59 PM10/25/20
to weewx-user
I was running python 2 before, and upgraded to python 3.   Never had an issue until I upgraded to 4.1.1.  

What am I missing?

# python --version
Python 3.7.6

pyserial is installed.

[root@server bin]# ./wee_device
Using configuration file /home/weewx/weewx.conf
Using Vantage driver version 3.2.1 (weewx.drivers.vantage)
Traceback (most recent call last):
  File "./wee_device", line 78, in <module>
    main()
  File "./wee_device", line 74, in main
    device.configure(config_dict)
  File "/home/weewx/bin/weewx/drivers/__init__.py", line 67, in configure
    self.do_options(options, parser, config_dict, not options.noprompt)
  File "/home/weewx/bin/weewx/drivers/vantage.py", line 2055, in do_options
    station = Vantage(**config_dict[DRIVER_NAME])
  File "/home/weewx/bin/weewx/drivers/vantage.py", line 511, in __init__
    self.port.openPort()
  File "/home/weewx/bin/weewx/drivers/vantage.py", line 307, in openPort
    self.serial_port = serial.Serial(self.port, self.baudrate, timeout=self.timeout)
AttributeError: module 'serial' has no attribute 'Serial'

Mark Jenks

unread,
Oct 25, 2020, 1:00:18 PM10/25/20
to weewx-user
    # The station model, e.g., WMR200, WMR200A, Radio Shack W200
    model = Vantage

    # The driver to use:
    driver = weewx.drivers.vantage
    type = Serial
    port = /dev/ttyUSB0

    # The type of LOOP packet to request: 1 = LOOP1; 2 = LOOP2; 3 = both
    loop_request = 1

Tom Keffer

unread,
Oct 25, 2020, 2:28:02 PM10/25/20
to weewx...@googlegroups.com
How did you install pyserial?

--


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/77253bab-92be-417c-956d-1fcdc0876293n%40googlegroups.com.


--
-tk

Mark Jenks

unread,
Oct 25, 2020, 2:59:28 PM10/25/20
to weewx-user
pip install pyserial

Mark Jenks

unread,
Oct 25, 2020, 3:10:28 PM10/25/20
to weewx-user
I just did this.  No change..

dnf install python3-pyserial

Mark Jenks

unread,
Oct 25, 2020, 3:40:37 PM10/25/20
to weewx-user
This works...

[weewx@server ~]$ python
Python 3.7.6 (default, Jan 30 2020, 09:44:41)
[GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import serial

John Kline

unread,
Oct 25, 2020, 3:48:58 PM10/25/20
to weewx...@googlegroups.com

I’m not sure what OS you are on, but would you try:

python3
import serial

On Oct 25, 2020, at 12:40 PM, Mark Jenks <mjenk...@gmail.com> wrote:

This works...

Mark Jenks

unread,
Oct 25, 2020, 4:02:34 PM10/25/20
to weewx-user
That works.  See above.   It's python3

Mark Jenks

unread,
Oct 25, 2020, 4:06:22 PM10/25/20
to weewx-user
I just did a full stop and start, and I get this.   Permissions?

Oct 25 15:04:18 server.mjenks.net weewxd[20245]: weewx[20245] CRITICAL weewx.engine:     ****      Vantage.__init__(self, **config_dict[DRIVER_NAM>
Oct 25 15:04:18 server.mjenks.net weewxd[20245]: weewx[20245] CRITICAL weewx.engine:     ****    File "/home/weewx/bin/weewx/drivers/vantage.py", >
Oct 25 15:04:18 server.mjenks.net weewxd[20245]: weewx[20245] CRITICAL weewx.engine:     ****      self.port.openPort()
Oct 25 15:04:18 server.mjenks.net weewxd[20245]: weewx[20245] CRITICAL weewx.engine:     ****    File "/home/weewx/bin/weewx/drivers/vantage.py", >
Oct 25 15:04:18 server.mjenks.net weewxd[20245]: weewx[20245] CRITICAL weewx.engine:     ****      self.serial_port = serial.Serial(self.port, sel>
Oct 25 15:04:18 server.mjenks.net weewxd[20245]: weewx[20245] CRITICAL weewx.engine:     ****  AttributeError: module 'serial' has no attribute 'S>
Oct 25 15:04:18 server.mjenks.net weewxd[20245]: weewx[20245] CRITICAL __main__: Unable to load driver: module 'serial' has no attribute 'Serial'
Oct 25 15:04:18 server.mjenks.net weewxd[20245]: weewx[20245] CRITICAL __main__:     ****  Exiting...
Oct 25 15:04:18 server.mjenks.net systemd[1]: weewx.service: Main process exited, code=exited, status=4/NOPERMISSION
Oct 25 15:04:18 server.mjenks.net systemd[1]: weewx.service: Failed with result 'exit-code'.


I have this set..  I tried tty and usb for SUBSYSTEM..


[root@server rules.d]# more vantage.rules
# udev rules for davis vantage connected via usb
#ACTION=="add", SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="vantage"

# use this rule if you are using systemd
#ACTION=="add", SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="vantage", TAG+="systemd", ENV{SYSTEMD_WANTS}="weewx.service"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="vantage", TAG+="systemd", ENV{SYSTEMD_WANTS}="weewx.service"

Tim Tuck

unread,
Oct 25, 2020, 6:16:31 PM10/25/20
to weewx...@googlegroups.com
Hi Mark,

Does the user, that weewx is running as, belong to the group dialout ?

On linux, a user that wants to use a serial port must belong to the
dialout group.

This still applies even if the serial port is via a USB interface.

regards

Tim

Mark Jenks

unread,
Oct 25, 2020, 6:38:37 PM10/25/20
to weewx-user
Never had to do that before..   But just added weewx go dialout group and no change.

Tom Keffer

unread,
Oct 25, 2020, 8:31:36 PM10/25/20
to weewx-user
If you use pip to install things while in the WeeWX directory /home/weewx, it will see the setup.cfg file there, then try and install things in the WeeWX directory system. Take a look in /home/weewx/bin and see if serial ended up in there.

If so, delete it, then cd to some other directory, such as your home directory, then try installing. Make sure you use the python3 version of pip:

cd ~
python3 -m pip install pyserial

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

Mark Jenks

unread,
Oct 25, 2020, 9:02:12 PM10/25/20
to weewx-user
I completely removed pyserial using pip and dnf.
Same thing.  Maybe something to do with rules.d?  I tried tty and usb both, and get the same thing.

[root@server ~]# systemctl status weewx.service
● weewx.service - weewx weather system
   Loaded: loaded (/usr/lib/systemd/system/weewx.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sun 2020-10-25 20:00:20 CDT; 2s ago
  Process: 11717 ExecStart=/home/weewx/bin/weewxd /home/weewx/weewx.conf (code=exited, status=4)
 Main PID: 11717 (code=exited, status=4)
      CPU: 221ms

Oct 25 20:00:20 server.mjenks.net weewxd[11717]: weewx[11717] CRITICAL weewx.engine:     ****      Vantage.__init__(self, **config_dict[DRIVER_NAME])
Oct 25 20:00:20 server.mjenks.net weewxd[11717]: weewx[11717] CRITICAL weewx.engine:     ****    File "/home/weewx/bin/weewx/drivers/vantage.py", line 511, >
Oct 25 20:00:20 server.mjenks.net weewxd[11717]: weewx[11717] CRITICAL weewx.engine:     ****      self.port.openPort()
Oct 25 20:00:20 server.mjenks.net weewxd[11717]: weewx[11717] CRITICAL weewx.engine:     ****    File "/home/weewx/bin/weewx/drivers/vantage.py", line 307, >
Oct 25 20:00:20 server.mjenks.net weewxd[11717]: weewx[11717] CRITICAL weewx.engine:     ****      self.serial_port = serial.Serial(self.port, self.baudrate>
Oct 25 20:00:20 server.mjenks.net weewxd[11717]: weewx[11717] CRITICAL weewx.engine:     ****  AttributeError: module 'serial' has no attribute 'Serial'
Oct 25 20:00:20 server.mjenks.net weewxd[11717]: weewx[11717] CRITICAL __main__: Unable to load driver: module 'serial' has no attribute 'Serial'
Oct 25 20:00:20 server.mjenks.net weewxd[11717]: weewx[11717] CRITICAL __main__:     ****  Exiting...
Oct 25 20:00:20 server.mjenks.net systemd[1]: weewx.service: Main process exited, code=exited, status=4/NOPERMISSION
Oct 25 20:00:20 server.mjenks.net systemd[1]: weewx.service: Failed with result 'exit-code'.
[root@server ~]# more /etc/udev/rules.d/vantage.rules
# udev rules for davis vantage connected via usb
#ACTION=="add", SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="vantage"

# use this rule if you are using systemd
ACTION=="add", SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="vantage", TAG+="systemd", ENV{SYSTEMD_WANTS}="weewx.service"
#ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="vantage", TAG+="systemd", ENV{SYSTEMD_WANTS}="weewx.service"

Tom Keffer

unread,
Oct 25, 2020, 9:07:49 PM10/25/20
to weewx-user
Did you look in /home/weewx/bin? 

Mark Jenks

unread,
Oct 25, 2020, 9:16:10 PM10/25/20
to weewx-user
Ugh, I looked right at it and didn't even see it.  I looked into /home/weewx, but only glanced into bin.
Removed and it's working!   

Thank you!

-Mark

Tom Keffer

unread,
Oct 25, 2020, 9:20:47 PM10/25/20
to weewx-user
👍

I can't tell you how many times this has happened to me. 

Reply all
Reply to author
Forward
0 new messages