USB/Serial permissions

384 views
Skip to first unread message

Gord Snarr (GSFarm)

unread,
Mar 11, 2024, 11:13:49 PM3/11/24
to weewx-user
New install on a fresh RPI4B, new card etc.

Installation seems to go fine, but there seems to be a permissions issue with the USB0 port I am using for the USB -> serial adapter to the serial console on the Davis VP.

Log as follows:

× weewx.service - WeeWX
     Loaded: loaded (/lib/systemd/system/weewx.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Mon 2024-03-11 17:10:35 CDT; 38min ago
   Duration: 342ms
       Docs: https://weewx.com/docs
    Process: 2511 ExecStart=weewxd /etc/weewx/weewx.conf (code=exited, status=4)
   Main PID: 2511 (code=exited, status=4)
        CPU: 343ms

Mar 11 17:10:35 raspberrypi weewxd[2511]: CRITICAL weewx.engine:     ****                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 11 17:10:35 raspberrypi weewxd[2511]: CRITICAL weewx.engine:     ****    File "/usr/lib/python3/dist-packages/serial/serialutil.py", line 244, in __init__
Mar 11 17:10:35 raspberrypi weewxd[2511]: CRITICAL weewx.engine:     ****      self.open()
Mar 11 17:10:35 raspberrypi weewxd[2511]: CRITICAL weewx.engine:     ****    File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 325, in open
Mar 11 17:10:35 raspberrypi weewxd[2511]: CRITICAL weewx.engine:     ****      raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
Mar 11 17:10:35 raspberrypi weewxd[2511]: CRITICAL weewx.engine:     ****  serial.serialutil.SerialException: [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0'
Mar 11 17:10:35 raspberrypi weewxd[2511]: CRITICAL __main__: Unable to load driver: [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0'
Mar 11 17:10:35 raspberrypi weewxd[2511]: CRITICAL __main__:     ****  Exiting...
Mar 11 17:10:35 raspberrypi systemd[1]: weewx.service: Main process exited, code=exited, status=4/NOPERMISSION
Mar 11 17:10:35 raspberrypi systemd[1]: weewx.service: Failed with result 'exit-code'.
~

VER:
Linux raspberrypi 6.6.20+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.20-1+rpt1 (2024-03-07) aarch64

HRDWR
RPI-4B
Davis Vantage Pro (not the II).
Weewx version (what ever downloaded today using "apt install weewx"). Think it's 5.0.2.

What should the permissions be set to the port, or user added? Is it weewxd, root, pi?
SHould I change the user in the weewx.conf, or change the chmod the port?

Maybe I should have started with an older weewx version and upgraded? This may have been sorted out already previously.
Thankx in advance,
-G.

vince

unread,
Mar 11, 2024, 11:21:47 PM3/11/24
to weewx-user
Give https://github.com/weewx/weewx/wiki/Understanding-permissions a read and see if that helps.....

Summary is at https://github.com/weewx/weewx/wiki/Understanding-permissions#the-weewx-user and which group typically permits most is at the bottom of the same page.

Tom Keffer

unread,
Mar 11, 2024, 11:22:58 PM3/11/24
to weewx...@googlegroups.com
Most likely you need to add the user "weewx" to the "dialout" group. See the wiki section add the weewx user to group defined on a device.


--
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/da82a39f-9cad-4b52-941f-b6529efb7c05n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages