Author Topic: New install weewx5 meteo-pi raspberry pi 4  (Read 403 times)

0 Members and 1 Guest are viewing this topic.

Offline jodell

  • Member
  • *
  • Posts: 5
New install weewx5 meteo-pi raspberry pi 4
« on: August 31, 2024, 11:55:39 AM »
Hoping someone can help me figure out how to configure the serial port on my Raspberry Pi 4 running the latest Raspberry Pi OS. In the interests of brevity, I'm sketching a broad overview of the setup, and can supply more info as needed.

How I got to this point:
I have a Davis Vantage Pro 2 hooked to the cellular Gateway, set up, working fine from January to May, then (according to Davis) their cellular provider (TMobile) made changes that caused the cellular modem in the Gateway to no longer be able to connect.  Since I am still under warranty, they will send me a new cellular board, but blah-blah supply chain, and here I sit with no data.  I want my data.  I can't get data if I have no connection. And I will also leave out what I think of Davis' handling of this outage. (The kindest thing I can say is I'm not impressed.)

So I bought a Weather Envoy (cabled, because the VP2 is cabled, because the Gateway is cabled).  And because I have Raspberry Pis in excess, I bought the Meteo-Pi that attaches to the Pi's pin header.  Set up the Pi using the latest PiOS (imaged to the card) and run it headless, ssh to it via wifi. Installed weewx5 and configured it using the source as the simulator. It works at the commandline. It works after rebooting, once I found out that the modern way is accessing the log files with journalctl.  Installed nginx, configured it to grab the weewx html output, and voila, I can see the simulator data on a web browser.  I'm confident that weewx5 and nginx will let me capture and view the data.

Where I am stuck is getting the Pi to talk to the Meteo-Pi.  I have used raspi-config to set the serial interface to serial yes and console no, which supposedly will make it a standard UART interface.  I ran 'sudo systemctl stop weewx' and 'weectl station configure', set the driver to Vantage using /dev/ttyS0, and everything else as it was for the Simulator and restarted weewx with 'sudo systemctl start weewx'.  journalctl shows the following final error
Aug 31 08:16:27 wxdragon weewxd[18226]: CRITICAL __main__: 'Unable to load driver: [Errno 13] could not open port /dev/ttyS0: [Errno 13] Permission denied: '/dev/ttyS0'
Aug 31 08:16:27 wxdragon weewxd[18226]: CRITICAL __main__:     ****  Exiting...

Another web page suggested looking at
ls -l /dev/tty*
crw-rw---- 1 root   dialout 4, 64 Aug 31 10:06 /dev/ttyS0
and
ls -lah /dev/se*
lrwxrwxrwx 1 root root 5 Aug 31 10:06 /dev/serial0 -> ttyS0

It looks as though the hardware connections are correct, but I'm at a loss whether this output indicates an issue, whether weewx needs to be added to the dialout group, or something else? 

Appreciate any thoughts or even better if someone has a writeup of how to set up the meteo-pi under the latest PiOS...

Online R.Sidetrack

  • Senior Member
  • **
  • Posts: 86
Re: New install weewx5 meteo-pi raspberry pi 4
« Reply #1 on: August 31, 2024, 08:22:56 PM »
I don't have any Davis or Meteo hardware.  I do have Pi though.  And I have on occasion struggled with linux permissions.  :roll:

In your shoes, my first choice would be to adjust permissions in this:
Quote
ls -l /dev/tty*
crw-rw---- 1 root   dialout 4, 64 Aug 31 10:06 /dev/ttyS0
... so it looks like this:
Quote
rwxrwxrwx

The second instance grants all permissions, the first is more restrictive.  So I'd grant all permissions, see if that fixes the problem, then evaluate whether you really have a security risk with those lax permission settings. :)


Graham

--- Variety of Ecowitt devices ---

Offline jodell

  • Member
  • *
  • Posts: 5
Re: New install weewx5 meteo-pi raspberry pi 4
« Reply #2 on: September 01, 2024, 05:03:54 PM »
Thanks, I’ll give that a shot when I’m back on the grid.

Offline vinceskahan

  • Senior Contributor
  • ****
  • Posts: 238
    • home site
Re: New install weewx5 meteo-pi raspberry pi 4
« Reply #3 on: Today at 05:33:00 PM »
I'm at a loss whether this output indicates an issue, whether weewx needs to be added to the dialout group, or something else? 

This has come up dozens of times on the weewx-user google group.  Add the user weewx runs as (now, typically 'weewx' if you used a dpkg install) to group dialout and it should work.
WeeWX sites on a pi4:
  Davis VP2+DFARS
  EcoWitt GW1200, WH32 outdoor T+H, multiple WH31 indoor T+H, WH51 soilMoisture, WH34 soilTemp
  Davis AirLink (inside)
  PurpleAir (outside)
Home site:        https://www.skahan.net/  - sorry, but I block incoming other than US/CA/AU due to bots from elsewhere
Wunderground: KWAFEDER15
PWS:                KWFEDER15
CWOP:              CW6881

 

anything