Sorry Greg, should have mentioned that I already tried running it with sudo, with interesting results. Here's what I get, running without sudo, then with sudo... . . . weewx@weewx:~ $ wee_device --clear-memory Using configuration file /home/weewx/weewx.conf Using Vantage driver version 3.2.1 (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 "/home/weewx/bin/wee_device", line 78, in <module> main() File "/home/weewx/bin/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 2056, in do_options station = Vantage(**config_dict[DRIVER_NAME]) File "/home/weewx/bin/weewx/drivers/vantage.py", line 512, 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) 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' . . . weewx@weewx:~ $ sudo wee_device --clear-memory [sudo] password for weewx: sudo: wee_device: command not found So how do I add the user to the dialout group? Is that like the sudoers group? (not sure how to do the sudoers group either). On Sunday, November 22, 2020 at 10:36:15 PM UTC-6 Greg from Oz wrote: > If you run the command and add sudo before the command then it will run as > root. > > sudo wee_device > > If you add the user to the dialout group then that user will have > permission to use the USB without out having to run sudo. > > > > On Monday, 23 November 2020 at 15:04:40 UTC+11 jd....@gmail.com wrote: > >> OK thanks guys... I'm a bit of a linux noob so I am not sure how to do >> symbolic links. Therefore I opted to change the directory where the web >> pages are living, to: >> HTML_ROOT = /var/www/html - This fixed it... but now I have another >> issue, undoubtedly related to the Vantage data corruption issue. I now get >> the correct web server, but the web page shows a date from two days ago and >> does not update. When I try to run wee_device commands I get a permissions >> issue on the USB port. PermissionError: [Errno 13] Permission denied: >> '/dev/ttyUSB0' How can I get permissions on the USB port? (Remember >> Linux noob)... I can start a new topic about this if necessary. >> >> On Saturday, November 21, 2020 at 3:53:05 PM UTC-6 Greg from Oz wrote: >> >>> I think you should put the weewx.conf into /etc/apache2/sites-available/ >>> The run sudo a2ensite (this will enable the site) >>> Then run: sudo systemctl restart apache2.service >>> >>> I don't know what system you are running apache on but the above should >>> work with Ubuntu (debian) >>> >>> >>> On Sunday, 22 November 2020 at 06:47:10 UTC+11 vince wrote: >>> >>>> You always want to look at your logs for both syslog and apache for the >>>> gory details. >>>> >>>> There are a couple alternate ways to get there.... >>>> >>>> - edit weewx.conf to tell it where to write its html to >>>> - at the top of the [[StandardReport]] section in weewx.conf, >>>> edit HTML_ROOT to point to /var/www/html which is where Apache >>>> thinks the >>>> web root is (weewx restart required) >>>> - or point the apache DOCROOT at weewx's tree >>>> - rename /var/www/html and create a symlink pointing to >>>> /home/weewx/public_html (no apache or weewx restarts needed) >>>> - or point the weewx's HTML_ROOT at apache's tree >>>> - rename /home/weewx/public_html and create a symlink pointing >>>> to /var/www/html (weewx restart required) >>>> >>>> FWIW, I use the second method here but that's just how I chose to do it. >>>> >>>> -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/a7fa2529-5ce2-4b95-b5f3-9f37c1a248f2n%40googlegroups.com.