WeeWX UDP driver for WeatherFlow station

You’re overthinking this one. All you need to do is replace the ‘example’ sensor device id with ‘your’ sensor device id. So if you are ST-12345678 then you would simply need to…

replace:

     outTemp = air_temperature.ST-00000025.obs_st

with

     outTemp = air_temperature.ST-12345678.obs_st
     (and similarly edit the other lines in the sensor_map)


longer commentary for future folks asking the same question....

WeeWX is super-flexible, supporting dozens of station types as well as user-developed sensors. With great flexibility comes a little of a learning curve.

All a sensor_map does is tell weewx:

  • which measurement
  • from which sensor
  • should be saved into which weewx database element

Why ?

  • there are over 100 database elements in the db so weewx can support a zillion station variants
  • users are able to create all kinds of custom solutions for themselves…and they ‘do’ so
  • so a ‘little’ configuration is required in order to support all this flexibility weewx gives you

For @vreihen’s weewx WF driver specifically:

  • it supports multiple Air, Sky, Tempest sensors attached to one Hub
  • so if you have multiple sensors (many people do), you have to tell weewx which one to use for what

For 95% of the folks, just editing in your sensor id, replacing the example one, is all you need to do. Really.

For the other 5% you have the ability to do things like:

  • use Tempest ST-12345678 for wind speed
  • use Sky SK-234256789 for uv readings
  • use Air AR-34567890 for outside temperature
  • (and so on, in any combination you choose to set up to match your needs)

But for the default case, the example stanza will work for you ‘if’ you replace the example device id with the one for your unique sensor. It’s really that simple.

5 Likes

Not sure if this is the proper venue for this sort of question. Let me know if there’s a better place for it.

I have the UDP listener configured with weewx, and occasionally I notice an issue where a database entry is created with an epoch time of “300” which is impossible. This causes all of my NOAA reports from 1969 on to be populated with blank data. I have removed the spurious database entry a few times, but it comes back after a few days/weeks.

Anyone seen this?

Here’s an example:

sqlite> select * FROM archive WHERE datetime<1442894400;

300|1|5||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||0.0|||||||||| ||||||0.0|||||||||||||||||||||||||||||||244.230262691432|4.00412591497135|245.0| 0.271229199547641|3.25475039457169

My bets would be a Hub reboot whacking the clock or another device broadcasting using the same UDP port such as an IP security camera. The device uptimes on the Tempest web site should show any reboots that have happened…

Think it’s the weewx system perhaps.

The weewx timestamp in the db is what was measured in the weewx system’s clock, not in the ‘content’ of the UDP message that was saved to the db. So if you power-reset a raspi without a RTC in it, this is possible…but any recent weewx has code in there to protect against this kind of thing. It won’t start weewx until the date+time is later than the date+time on the weewx.conf file

One workaround is to simply open the weewx.conf file for edit ‘after’ your host has good time, then save the file (changing nothing). The mtime on the file should show current date+year. That should block weewx starting up until the system it’s running on has its brain straight re: a correct date+time.

To verify this check your uptime on the pi and your syslog. You should see syslog entries that were from 1969 or 1970, depending on which side of Greenwich you’re at.

(update - I posted a question in the weewx-users group asking if there’s an easy way to prevent obviously bogus timestamped data from being written. If I get an answer, I’ll edit this post with details or pointers)

Thanks for the insight. In my case, weewx is not running on a pi, but on a machine with a RTC. Also, the machine running weewx is UPS protected and hasn’t rebooted in quite some time. So I don’t think it’s an issue with the system clock being temporarily incorrect.

I am running weewx 4.1.1 and I do believe this behavior started when I upgraded from weewx 3.x to 4.x.

root@1w-rackcomputer:~# apt list weewx
Listing… Done
weewx/squeeze,now 4.1.1-1 all [installed]

Doubtful it’s v4 related. Weewx gets the timestamp for the archive record from the clock on the runtime computer. So if the computer reports bogus time, weewx believes it. That has always been the case from day one a decade+ ago.

is there an “easy setup” for Linux ignoramus’s? I can follow simple Linux commands like is used to install weewx => weewx: Installation on Debian systems when I can cut and paste… but I have no idea how to go about installing this addon to make it work with my tempest :frowning:
Using a Raspberry Pi., which is also used for sending data to FlightRadar/FlightAware.

Something simple enough to cut+paste does not currently exist. You need to be able to:

  • download the extension (one command)
  • install the extension (one command)
  • edit the weewx.conf file to define your station in it
  • restart weewx (one command)

It ain’t rocket science, but you do need to do some actual work to make it so.

And therein lies the problem… I did say I know nothing about Linux, meaning I dont know the commands/syntax to do those steps without possibly nuking my Pi!

Sorry - weewx requires some minimal expertise. If you can’t agree to the time investment to learn a couple simple things, you probably need to look for other more turnkey software and save yourself the blood pressure.

That said, you can’t hurt the pi no matter what you do that’s weewx-related. Worst that can happen is weewx doesn’t work for you, and you’re already in that condition…

As I mentioned in my initial post, the Weewx site DOES have simple instructions that I was able to follow to install Weewx, what I am struggling with is how to install the driver. However as I am not a member of the Linux Elite, and no one is prepared to list the apparently 4 simple commands to install the driver, then I guess I miss out!

I assume you have read the README from the Github repo? Lifting directly from there:

Installation should be as simple as grabbing a .ZIP download of this
entire project from the GitHub web interface, and then running this
command:

wee_extension --install weatherflow-udp-master.zip

If you have a desktop on your Pi you can download the zip file directly from the Git web interface. If you don’t then the command you need is wget along with the web address of the github repo. Some thing like https://github.com/captain-coredump/weatherflow-udp/archive/master.zip. I don’t know the exact wget command format, so you might need to do some Googling.

Once you have the extension installed, keep following the README to make the necessary changes to weewx.conf. This is different for every user based on their hardware, so you’ll have to work through it and work out the changes you need to make. Once you are ready, restart Weewx and see if it works.

Yeah, it’s horribly unfair to expect folks to read the extension’s README and do its one step…

If you’re not going to even try to work that hard, our ‘volunteer’ time is probably not worth investing in your future happiness.

1 Like

thanks again for your reply.
yes I did read the readme, but as I have said several times that I dont know enough Linux command line to download a file, and unzip a file. I actually just wanted someone to write the simple commands ( it seems its only one or two commands?) that I can cut and paste to my Pi… but obviously that is too much time for you to volunteer.

this is the type of thing I was hoping to get, from some helpful person !
Tell your system to trust weewx.com:

wget -qO - http://weewx.com/keys.html | sudo apt-key add -
Use apt-get to install WeeWX. The installer will prompt for a location, latitude/longitude, altitude, station type, and parameters specific to your station hardware.

sudo apt-get update
sudo apt-get install weewx

… obviously its too much to ask!

One of these days, I’m going to have a free moment to paste these much simpler instructions (courtesy of Matthew Wall) from my Atmocom UDP driver into the WF driver’s readme:

  1. Starting with a fresh weewx installation, choose the “Simulator” station driver during the package install process.

  2. Next, grab a .ZIP download of this entire project from the GitHub web interface:

    wget -O weatherflow-udp-master.zip https://github.com/captain-coredump/weatherflow-udp/archive/master.zip

  3. Install the driver package by running this command:

    wee_extension --install weatherflow-udp-master.zip

  4. Configure weewx and this WeatherFlow_UDP driver (probably not implemented in WF driver yet):

    wee_config --reconfigure

You will still need to edit weewx.conf manually to add an appropriate sensor_map, per the readme file!

Additional reading:

3 Likes

Thank you very much. I will follow through with this!
it is really appreciated!

step 3 is going to give permission denied installing it…as is step 4…

Hi @ad6699,
I had the same problem in the beginning!
What we have to learn when beginning to use Linux is the different permission a user has.
You are probably logged in as the ‘pi’ user and do not have permission to change any system settings.
So look up to learn about using ‘sudo’, for example here: Root user/sudo - Raspberry Pi Documentation

All the experienced linux people know that you can add the letters 'sudo ’ in front of a command to have super user privileges so they often exclude those letters in their instructions.
Thanks to @vinceskahan for providing the clue to the error to expect. You will need to include 'sudo ’ in front of steps 3 and 4 to give yourself the required permission.
eg step 3:
sudo wee_extension --install weatherflow-udp-master.zip
step 4:
sudo wee_config --reconfigure
And to edit system files you do the same which might be :
sudo nano -w /etc/weewx/weewx.conf
Once you start learning how linux works the frustrating difficulties reduce and it becomes fun :slight_smile:
cheers Ian :slight_smile:

1 Like

Ian
Thanks very much for the further clarifications, that worked a treat and I seem to have the driver installed now. :slight_smile:
An I think I also managed to add the sensor map…
so I am connecting to my Pi by ssh from my Mac… how do I verify that its working as per the weewx install instructions:

Verify

After about 5 minutes, open the station web page in a web browser. You should see your station information and data. If your hardware supports hardware archiving, then how long you wait will depend on the archive interval set in your hardware.

file:///var/www/html/weewx/index.html

1 Like

Hi @ad6699,
You can use SSH to see if the html file is being updated every 5 minutes:
ls -halt /var/www/html/weewx/
Your web browser on a Mac is Safari or you may also have chrome, either will work.
I dont know if Apache web server is installed by default in your pi setup. If it is then it will serve the html files from /var/www/html/ to your browser .
In the browser address bar type the same IP address that you are using for your SSH connection but without the pi@ and then on the end add /weewx/index.html
Once you can see that it is updating then it means the weewx UDP driver is working and your next questions might be researched in the weewx forums. We should avoid straying off topic here :slight_smile:
good luck, cheers Ian :slight_smile: