Re: Private message regarding: [weewx-user] Weewx stopped posting data

77 views
Skip to first unread message

Tom Keffer

unread,
Jan 2, 2024, 6:35:04 PMJan 2
to emur...@gmail.com, weewx-development
It appears that whatever user you are running weewx as does not have permission to access /dev/ttyUSB0. 

Either use sudo, or change the permissions on /dev/ttyUSB0.



On Tue, Jan 2, 2024 at 9:26 AM emur...@gmail.com <emur...@gmail.com> wrote:
The reboot of the console did nothing. So I stopped weewx and ran the dump and clear memory command.

wee_device --dump
Using configuration file /etc/weewx/weewx.conf
Using Vantage driver version 3.5.2 (weewx.drivers.vantage)
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 265, in open
    self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
PermissionError: [Errno 13] Permission denied: '/dev/ttyUSB0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/weewx/wee_device", line 76, in <module>
    main()
  File "/usr/share/weewx/wee_device", line 72, in main
    device.configure(config_dict)
  File "/usr/share/weewx/weewx/drivers/__init__.py", line 67, in configure
    self.do_options(options, parser, config_dict, not options.noprompt)
  File "/usr/share/weewx/weewx/drivers/vantage.py", line 2155, in do_options
    station = Vantage(**config_dict[DRIVER_NAME])
  File "/usr/share/weewx/weewx/drivers/vantage.py", line 531, in __init__
    self.port.openPort()
  File "/usr/share/weewx/weewx/drivers/vantage.py", line 318, in openPort
    self.serial_port = serial.Serial(self.port, self.baudrate, timeout=self.timeout)
  File "/usr/lib/python3/dist-packages/serial/serialutil.py", line 240, in __init__
    self.open()
  File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 268, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 153, in apport_excepthook
    with os.fdopen(os.open(pr_filename,
FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/_usr_share_weewx_wee_device.1000.crash'

Original exception was:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 265, in open
    self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
PermissionError: [Errno 13] Permission denied: '/dev/ttyUSB0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/weewx/wee_device", line 76, in <module>
    main()
  File "/usr/share/weewx/wee_device", line 72, in main
    device.configure(config_dict)
  File "/usr/share/weewx/weewx/drivers/__init__.py", line 67, in configure
    self.do_options(options, parser, config_dict, not options.noprompt)
  File "/usr/share/weewx/weewx/drivers/vantage.py", line 2155, in do_options
    station = Vantage(**config_dict[DRIVER_NAME])
  File "/usr/share/weewx/weewx/drivers/vantage.py", line 531, in __init__
    self.port.openPort()
  File "/usr/share/weewx/weewx/drivers/vantage.py", line 318, in openPort
    self.serial_port = serial.Serial(self.port, self.baudrate, timeout=self.timeout)
  File "/usr/lib/python3/dist-packages/serial/serialutil.py", line 240, in __init__
    self.open()
  File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 268, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0'

mel@Mel-computer:~$ wee_device --clear-memory
Using configuration file /etc/weewx/weewx.conf
Using Vantage driver version 3.5.2 (weewx.drivers.vantage)
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 265, in open
    self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
PermissionError: [Errno 13] Permission denied: '/dev/ttyUSB0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/weewx/wee_device", line 76, in <module>
    main()
  File "/usr/share/weewx/wee_device", line 72, in main
    device.configure(config_dict)
  File "/usr/share/weewx/weewx/drivers/__init__.py", line 67, in configure
    self.do_options(options, parser, config_dict, not options.noprompt)
  File "/usr/share/weewx/weewx/drivers/vantage.py", line 2155, in do_options
    station = Vantage(**config_dict[DRIVER_NAME])
  File "/usr/share/weewx/weewx/drivers/vantage.py", line 531, in __init__
    self.port.openPort()
  File "/usr/share/weewx/weewx/drivers/vantage.py", line 318, in openPort
    self.serial_port = serial.Serial(self.port, self.baudrate, timeout=self.timeout)
  File "/usr/lib/python3/dist-packages/serial/serialutil.py", line 240, in __init__
    self.open()
  File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 268, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 153, in apport_excepthook
    with os.fdopen(os.open(pr_filename,
FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/_usr_share_weewx_wee_device.1000.crash'

Original exception was:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 265, in open
    self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
PermissionError: [Errno 13] Permission denied: '/dev/ttyUSB0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/weewx/wee_device", line 76, in <module>
    main()
  File "/usr/share/weewx/wee_device", line 72, in main
    device.configure(config_dict)
  File "/usr/share/weewx/weewx/drivers/__init__.py", line 67, in configure
    self.do_options(options, parser, config_dict, not options.noprompt)
  File "/usr/share/weewx/weewx/drivers/vantage.py", line 2155, in do_options
    station = Vantage(**config_dict[DRIVER_NAME])
  File "/usr/share/weewx/weewx/drivers/vantage.py", line 531, in __init__
    self.port.openPort()
  File "/usr/share/weewx/weewx/drivers/vantage.py", line 318, in openPort
    self.serial_port = serial.Serial(self.port, self.baudrate, timeout=self.timeout)
  File "/usr/lib/python3/dist-packages/serial/serialutil.py", line 240, in __init__
    self.open()
  File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 268, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0'

I restarted weewx and still nothing.

On Monday, January 1, 2024 at 7:01:53 PM UTC-5 Tom Keffer wrote:
Set debug=1, restart weewx, let it run until it crashes or the first reporting cycle, whichever happens first, post the log.

On Mon, Jan 1, 2024 at 1:42 PM emur...@gmail.com <emur...@gmail.com> wrote:
I have a vantage pro 2 station. My OS is Linux Mint. I had changed the batteries in the console. When I did so, I also unplugged the power to it. Upon replacing the batteries and rebooting the console, weewx not longer posts anything to Index HTML or NOAA. I tried removing power including batteries and rebooting again but to no avail. 

Next, I purged weewx and then reinstalled. Still nothing. Yet, when I run weewxd in terminal it posts the loops there with all my station data.

Here is the log:
Jan  1 16:33:13 Mel-computer weewx[16417] INFO weewx.engine: Loading station type Vantage (weewx.drivers.vantage)
Jan  1 16:33:13 Mel-computer weewx[16417] INFO weewx.engine: StdConvert target unit is 0x1
Jan  1 16:33:13 Mel-computer weewx[16417] INFO weewx.wxservices: StdWXCalculate will use data binding wx_binding
Jan  1 16:33:13 Mel-computer weewx[16417] INFO weewx.engine: Archive will use data binding wx_binding
Jan  1 16:33:13 Mel-computer weewx[16417] INFO weewx.engine: Record generation will be attempted in 'hardware'
Jan  1 16:33:13 Mel-computer weewx[16417] INFO weewx.engine: The archive interval in the configuration file (300) does not match the station hardware interval (1800).
Jan  1 16:33:13 Mel-computer weewx[16417] INFO weewx.engine: Using archive interval of 1800 seconds (specified by hardware)
Jan  1 16:33:13 Mel-computer weewx[16417] INFO weewx.restx: StationRegistry: Registration not requested.
Jan  1 16:33:13 Mel-computer weewx[16417] INFO weewx.restx: Wunderground: Posting not enabled.
Jan  1 16:33:13 Mel-computer weewx[16417] INFO weewx.restx: PWSweather: Posting not enabled.
Jan  1 16:33:13 Mel-computer weewx[16417] INFO weewx.restx: CWOP: Posting not enabled.
Jan  1 16:33:13 Mel-computer weewx[16417] INFO weewx.restx: WOW: Posting not enabled.
Jan  1 16:33:13 Mel-computer weewx[16417] INFO weewx.restx: AWEKAS: Posting not enabled.
Jan  1 16:33:13 Mel-computer weewx[16417] INFO weewx.engine: 'pyephem' not detected, extended almanac data is not available
Jan  1 16:33:13 Mel-computer weewx[16417] INFO __main__: Starting up weewx version 4.10.2
Jan  1 16:33:14 Mel-computer weewx[16417] INFO weewx.engine: Clock error is -2.41 seconds (positive is fast)
Jan  1 16:33:14 Mel-computer weewx[16417] INFO weewx.engine: Using binding 'wx_binding' to database 'weewx.sdb'
Jan  1 16:33:14 Mel-computer weewx[16417] INFO weewx.manager: Starting backfill of daily summaries
Jan  1 16:33:14 Mel-computer weewx[16417] INFO weewx.manager: Daily summaries up to date
Jan  1 16:33:16 Mel-computer weewx[16417] INFO weewx.engine: Starting main packet loop.
Jan  1 16:33:17 Mel-computer weewx[16417] INFO weewx.engine: Main loop exiting. Shutting engine down.
Jan  1 16:33:17 Mel-computer weewx[16417] CRITICAL __main__: Caught OSError: [Errno 5] Input/output error
Jan  1 16:33:17 Mel-computer weewx[16417] CRITICAL __main__:     ****  Traceback (most recent call last):
Jan  1 16:33:17 Mel-computer weewx[16417] CRITICAL __main__:     ****    File "/usr/share/weewx/weewxd", line 154, in main
Jan  1 16:33:17 Mel-computer weewx[16417] CRITICAL __main__:     ****      engine.run()
Jan  1 16:33:17 Mel-computer weewx[16417] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 210, in run
Jan  1 16:33:17 Mel-computer weewx[16417] CRITICAL __main__:     ****      self.dispatchEvent(weewx.Event(weewx.NEW_LOOP_PACKET, packet=packet))
Jan  1 16:33:17 Mel-computer weewx[16417] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 245, in dispatchEvent
Jan  1 16:33:17 Mel-computer weewx[16417] CRITICAL __main__:     ****      callback(event)
Jan  1 16:33:17 Mel-computer weewx[16417] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 799, in new_loop_packet
Jan  1 16:33:17 Mel-computer weewx[16417] CRITICAL __main__:     ****      print("LOOP:  ",
Jan  1 16:33:17 Mel-computer weewx[16417] CRITICAL __main__:     ****  OSError: [Errno 5] Input/output error
Jan  1 16:33:17 Mel-computer weewx[16417] CRITICAL __main__:     ****  Waiting 10 seconds then retrying...

Thanks for any assistance.



--
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/4d4ce24e-a6ae-4fa2-8183-bea601a67451n%40googlegroups.com.

Tom Keffer

unread,
Jan 3, 2024, 3:27:01 PMJan 3
to emur...@gmail.com, weewx-development
It dumps directly to the database. See the documentation on wee_device --dump.

On Wed, Jan 3, 2024 at 9:29 AM emur...@gmail.com <emur...@gmail.com> wrote:
Running those commands using sudo solved the issue. Once I did that, weewx started posting data again. Question - where does wee_device --dump put those files? Many thanks for your help!
Reply all
Reply to author
Forward
0 new messages