# Modified PiConsole that gets data from UDP

**URL:** <https://community.tempest.earth/t/modified-piconsole-that-gets-data-from-udp/20209>\
**Category:** WeatherFlow PiConsole\
**Tags:** tempest\
**Created:** [February 25, 2023, 2:01am UTC](https://community.tempest.earth/t/modified-piconsole-that-gets-data-from-udp/20209 "2023-02-25T02:01:41Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinceskahan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/vinceskahan/32/2785_2.png) [@vinceskahan](https://community.tempest.earth/u/vinceskahan)\
**Post date:** [February 25, 2023, 2:01am UTC](https://community.tempest.earth/t/modified-piconsole-that-gets-data-from-udp/20209/1 "2023-02-25T02:01:41Z")

</div>

Testers wanted…

I’m fiddling around with trying to modify the PiConsole to get its data from the local UDP broadcasts rather than from the WF REST data and have it mostly ready enough for others to try, if anybody has interest.

If so, let me know via PM and we can coordinate via email

[…TL;DR…]

Architecturally it requires the following:

- install and run my wfudptools listener with a certain set of command-line options so the data is saved to /var/tmp tmpfs files, to not write to SD card
- modify a couple files in Peter’s product
- very lightly edit your .ini file

Testing is very reversible. Basically “cp -a” the wfpiconsole tree to another name for safekeeping, do the few modifications above, and fire it up. Reversing it is just putting the original official wfpiconsole directory back into place.

Note - there ‘are’ some limitations of going with UDP for data because that API does not provide accumulated data (rain, strikes) nor trends (min/max), but for a realtime display it works pretty nicely. Also would support indoor data from a Air with some modifications if that’s important to you.

Long term goals - I hope to go further to let weewx be the listener and map to some standard kind of schema for the data, which would let the PiConsole display data from any of the 70+ vendors and stations that weewx supports. Initially I’m doing just the Tempest to see how well the vision might work out long term.

Again - please let me know if you have any interest and we can coordinate via email.

---

<div class="post-metadata">

**Author:** ![padamec](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/padamec/32/5819_2.png) [@padamec](https://community.tempest.earth/u/padamec)\
**Post date:** [February 25, 2023, 1:15pm UTC](https://community.tempest.earth/t/modified-piconsole-that-gets-data-from-udp/20209/2 "2023-02-25T13:15:38Z")

</div>

This is certainly an interesting thing, especially for the case where there is no internet access, and PiConsole would still display the basic data from Tempest.

However, the ideal solution would be if @peter could build such functionality into PiConsole, and for the local station it could be switched to UDP mode.

Or, if PiConsole found Tempest UDP traffic on the local network, it would offer to display that weather station as well, and fill in the missing information from the cloud if it also had Internet access.

Can’t you and @peter agree on some kind of collaboration so that it is still a single software product?

Personally, I would like to run both options simultaneously 👍

---

<div class="post-metadata">

**Author:** ![vinceskahan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/vinceskahan/32/2785_2.png) [@vinceskahan](https://community.tempest.earth/u/vinceskahan)\
**Post date:** [February 25, 2023, 4:56pm UTC](https://community.tempest.earth/t/modified-piconsole-that-gets-data-from-udp/20209/3 "2023-02-25T16:56:56Z")

</div>

I’m certainly not trying to do an integrated product nor support one. All I’m trying to do is use the PiConsole to display data coming from other kinds of sources.

We ‘are’ talking about integrating the small changes to the PiConsole code needed to make that possible.

The PiConsole is really great for what it does, so I’m trying to leverage it’s very slick look’n’feel for data coming from other sources. Basically anything that can generate JSON following the WF UDP API could probably work.

---

<div class="post-metadata">

**Author:** ![vinceskahan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/vinceskahan/32/2785_2.png) [@vinceskahan](https://community.tempest.earth/u/vinceskahan)\
**Post date:** [March 1, 2023, 12:45am UTC](https://community.tempest.earth/t/modified-piconsole-that-gets-data-from-udp/20209/4 "2023-03-01T00:45:46Z")

</div>

I think I’m going to punt at this time on this one. It’s just too complicated under the hood for me to reverse engineer enough. Sorry if I got anybody’s hopes up too much.

---

<div class="post-metadata">

**Author:** ![tcichowicz](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/tcichowicz/32/661_2.png) [@tcichowicz](https://community.tempest.earth/u/tcichowicz)\
**Post date:** [March 25, 2023, 12:10pm UTC](https://community.tempest.earth/t/modified-piconsole-that-gets-data-from-udp/20209/5 "2023-03-25T12:10:38Z")

</div>

hey … sounds like something similar to what Gary Funk did a few years back. I still have a rpi running with it still doing it’s thing.

Not sure what happened to Gary or his project “ArchiveSW” it also allowed a sensor attached to the GPIO - for indoor temperature. I really liked having it as a backup - and the best part is it is totally local.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/sws/original/2X/6/68212884f2262b77dfb8ebe8d17810cb29e9b0f7.png)

edit: forgot to mention one of the BEST features … it’s displayed via http, web browser.

---

<div class="post-metadata">

**Author:** ![btst.online](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/btst.online/32/16538_2.png) [@btst.online](https://community.tempest.earth/u/btst.online)\
**Post date:** [March 25, 2023, 1:43pm UTC](https://community.tempest.earth/t/modified-piconsole-that-gets-data-from-udp/20209/6 "2023-03-25T13:43:24Z")

</div>

And… This is exactly how WeatherBox is doing it… All data that WeatherBox displays is via the local UDP (or from other station types: Davis, Peet etc).  
And you get a local -network web display in addition to the internet based display.

Just sayin’.

WxBox is still on beta form…but getting more and more stable by the day.

WxBox mobile app is coming along nicely as well.

---

<div class="post-metadata">

**Author:** ![tcichowicz](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/tcichowicz/32/661_2.png) [@tcichowicz](https://community.tempest.earth/u/tcichowicz)\
**Post date:** [March 25, 2023, 3:24pm UTC](https://community.tempest.earth/t/modified-piconsole-that-gets-data-from-udp/20209/7 "2023-03-25T15:24:54Z")

</div>

Trying to get more information and or a link where I can download and test …

can’t find anything online - nothing comes up from the ‘download’ link?

no links or names of apps for mobile devices either?

---

<div class="post-metadata">

**Author:** ![vinceskahan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/vinceskahan/32/2785_2.png) [@vinceskahan](https://community.tempest.earth/u/vinceskahan)\
**Post date:** [March 25, 2023, 3:34pm UTC](https://community.tempest.earth/t/modified-piconsole-that-gets-data-from-udp/20209/8 "2023-03-25T15:34:56Z")

</div>

You guys probably need a new thread for this product that is different from Peter’s piconsole, even if it’s just so folks can follow your discussion…

---

<div class="post-metadata">

**Author:** ![iladyman](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/iladyman/32/2305_2.png) [@iladyman](https://community.tempest.earth/u/iladyman)\
**Post date:** [March 26, 2023, 2:00am UTC](https://community.tempest.earth/t/modified-piconsole-that-gets-data-from-udp/20209/9 "2023-03-26T02:00:55Z")

</div>

If you have found this thread and are looking for information about different methods to extract and display your data you may be interested in this thread:

> [@Tempest Weather System Third-Party Applications](https://community.tempest.earth/t/tempest-weather-system-third-party-applications/873):
>
> Updated: 20 February 2019 This is an ongoing list of third-party applications that directly or indirectly support or use data from WeatherFlow. I will be updating and revising the list during the first two weeks in November. (Applications are placed in alphabetical order) Applications directly supporting WeatherFlow Weather Display WeatherFlow PiConsole WeeWX UDP driver WX Console and Uploader WeatherFlow for Home assistant Tempest Weather Station for TRMNL Applications indirect…

cheers Ian 🙂

---

<div class="post-metadata">

**Author:** ![lenny](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/lenny/32/16822_2.png) [@lenny](https://community.tempest.earth/u/lenny)\
**Post date:** [September 15, 2023, 12:46am UTC](https://community.tempest.earth/t/modified-piconsole-that-gets-data-from-udp/20209/10 "2023-09-15T00:46:56Z")

</div>

UDP works for me.  
But today, when I ran “wfpiconsole beta” to update  
am getting an error:  
main: line 304: /home/pi/wfpiconsole//venv/bin/python3: No such file or directory  
Seems to be a typo in the beta script?

---

<div class="post-metadata">

**Author:** ![peter](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/peter/32/1365_2.png) [@peter](https://community.tempest.earth/u/peter)\
**Post date:** [September 15, 2023, 8:16pm UTC](https://community.tempest.earth/t/modified-piconsole-that-gets-data-from-udp/20209/11 "2023-09-15T20:16:22Z")

</div>

The beta branch (or development branch) is not always stable. Right now I am in the middle of adding some new functionality which is not complete yet. It’s not recommended to switch to the beta branch unless I indicate that it is currently in a stable state

---

<div class="post-metadata">

**Author:** ![lenny](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/lenny/32/16822_2.png) [@lenny](https://community.tempest.earth/u/lenny)\
**Post date:** [September 19, 2023, 9:30pm UTC](https://community.tempest.earth/t/modified-piconsole-that-gets-data-from-udp/20209/12 "2023-09-19T21:30:38Z")

</div>

I had the beta running well - receiving UDP data directly from the Weatherflow onsite.  
I noticed a prompt that an upgrade was available.  
I ran the update, but am unable to get back to beta so that I can receive UDP data directly from the Weatherflow unit.

---

<div class="post-metadata">

**Author:** ![vinceskahan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/vinceskahan/32/2785_2.png) [@vinceskahan](https://community.tempest.earth/u/vinceskahan)\
**Post date:** [September 19, 2023, 11:42pm UTC](https://community.tempest.earth/t/modified-piconsole-that-gets-data-from-udp/20209/13 "2023-09-19T23:42:57Z")

</div>

Pete - I took a quick look and found a few nits that should hopefully be quick edits for you to try. Apologies for this reply being a little long but I wanted to document how I got it to work.

First, I started with a clean raspi SD card…

I did a ‘git clone’ of your repo and ‘git checkout develop’ to get to the develop branch, then ran ‘bash wfpiconsole.sh install’ procedurally to try to work off a local develop clone of your current repo dated today.

It blew up. Simple fix. You need to activate the venv in install\_python\_venv( ) above the ‘already exists’ line so that subsequent installation of modules goes into the venv. I think this is most of what lenny was running into and is definitely needed for a clean new install.

```auto
diff --git a/wfpiconsole.sh b/wfpiconsole.sh
index 3b64032..d89ea01 100755
--- a/wfpiconsole.sh
+++ b/wfpiconsole.sh
@@ -240,6 +240,7 @@ install_python_venv() {
             exit 1
         fi
     else
+ source "$VENVDIR/bin/activate"
         printf " already exists\\n"
     fi
 }

```

At this point, the install correctly seeds the venv with the python modules and completes, but your script ‘really’ wants to run off main, so the wfpiconsole stuff it installs is actually off main. Sigh. Fortunately your installed wfpiconsole tree is actually a git clone (whew) so I got around this by manually switching to the develop branch after the installation finished.

- cd wfpiconsole && git checkout develop
- I also copied my lightly hacked wfpiconsole.sh file into place as wfpiconsole/wfpiconsole.sh

At that point a ‘wfpiconsole start’ worked as expected, giving me the develop branch prompts for whether to run the example configs, use UDP, and the like. So I basically got beta to work with a little sleight of hand.

A couple other nits:

- you set the VENVDIR variable with a trailing slash to assemble the python3 path (ok) but in other places you seem to expect ‘no’ trailing slash in the directory name. This makes a filename ala /some/dir//filename which while benign is ugly. I think Lenny’s last reply showed an example. The .service file similarly has two // in a row mid-filename as another example.

- I like the prompts for units and timezone etc. (nice) but you might want to give some help on how to answer the questions. I know that Western lon is negative but the prompt doesn’t help. Similarly the elevations etc. should be in meters (?) and the like. It was uncertain how to answer from the questions you answered but I guessed ok it seems.

- one really interesting bug is that the prompts for degrees C/F looked awful for the degree symbol. I’ve run into this in the venv setup of weewx re: the web pages it generated and we never got a resolution there, but my guesstimate is it’s something in the i18n or localization stuff. For weewx it doesn’t happen on ubuntu AWS but is very consistently broken on debian and raspi os (which is deb-based).

Bottom line - the venv stuff looks ‘really’ close. Try adding that ‘one’ line to wfpiconsole.sh on develop and let us know if you want more testing done…

---

<div class="post-metadata">

**Author:** ![lenny](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/lenny/32/16822_2.png) [@lenny](https://community.tempest.earth/u/lenny)\
**Post date:** [October 9, 2023, 5:21pm UTC](https://community.tempest.earth/t/modified-piconsole-that-gets-data-from-udp/20209/14 "2023-10-09T17:21:20Z")

</div>

I am still not able to get back to the beta so that I can utilize the UDP.  
Am getting an error:  
“main: line 304: /home/pi/wfpiconsole//venv/bin/python3: No such file or directory”

---

<div class="post-metadata">

**Author:** ![peter](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/peter/32/1365_2.png) [@peter](https://community.tempest.earth/u/peter)\
**Post date:** [October 9, 2023, 7:15pm UTC](https://community.tempest.earth/t/modified-piconsole-that-gets-data-from-udp/20209/15 "2023-10-09T19:15:52Z")

</div>

I’m still working on this I’m afraid. Life is very busy! The UDP functionality will soon be released in the next stable version

---

<div class="post-metadata">

**Author:** ![peter](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/peter/32/1365_2.png) [@peter](https://community.tempest.earth/u/peter)\
**Post date:** [October 9, 2023, 7:42pm UTC](https://community.tempest.earth/t/modified-piconsole-that-gets-data-from-udp/20209/16 "2023-10-09T19:42:12Z")

</div>

> [@vinceskahan](#):
>
> You need to activate the venv in install\_python\_venv( ) above the ‘already exists’ line so that subsequent installation of modules goes into the venv.

> [@vinceskahan](#):
>
> you set the VENVDIR variable with a trailing slash to assemble the python3 path (ok) but in other places you seem to expect ‘no’ trailing slash in the directory name. This makes a filename ala /some/dir//filename which while benign is ugly. I think Lenny’s last reply showed an example. The .service file similarly has two // in a row mid-filename as another example.

Hi @vinceskahan, do you mind testing this again for me? I couldn’t recreate the venv activation error. Do you mind testing again and sharing the error output if you see it again. I should have fixed the trailing / issue too.

I’ll work on the prompts for the UDP setup - it didn’t occur to me that I had to explain things to people 🤣

---

<div class="post-metadata">

**Author:** ![vinceskahan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/vinceskahan/32/2785_2.png) [@vinceskahan](https://community.tempest.earth/u/vinceskahan)\
**Post date:** [October 9, 2023, 7:45pm UTC](https://community.tempest.earth/t/modified-piconsole-that-gets-data-from-udp/20209/17 "2023-10-09T19:45:15Z")

</div>

@peter - sure I can give it a try today or tomorrow

@lenny - I thought I answered your question. Unfortunately the workaround does require a bit of CLI and git/python expertise. A ‘click here and go’ switch to beta/UDP was not possible 20 days ago when I last tried it.

More info just so it’s here someplace…

Important: with the new pi5 coming out this month, they will have a new os with it that has breaking python changes under the hood that will ‘prevent’ wfpiconsole from installing at all until Peter can catch up to the upstream changes he’s working on via the beta branch. The coming pi os also changed the windowing system so it’s uncertain what else that might break. Patience is needed.

Bottom line: nobody running piconsole should run the coming-soon ‘bookworm’ (deb12) based raspi os nor try to run it on the pi5 until Peter says it’s ok.

---

<div class="post-metadata">

**Author:** ![vinceskahan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/vinceskahan/32/2785_2.png) [@vinceskahan](https://community.tempest.earth/u/vinceskahan)\
**Post date:** [October 9, 2023, 10:13pm UTC](https://community.tempest.earth/t/modified-piconsole-that-gets-data-from-udp/20209/18 "2023-10-09T22:13:51Z")

</div>

@peter you need to patch wfpiconsole.sh to add the source $VENVDIR/bin/activate on line 243.

I did not find an official way to get to beta but I did find a manual CLI way. The basic problem is the install script ‘really’ wants to do a git pull of latest and also always installs ‘main’.

Here’s what I did to do a clean installation that starts up on develop (beta) and does show the beta prompts etc. as expected…

```auto
# clone the current github repo manually
cd /home/pi
git clone https://github.com/peted-davis/WeatherFlow_PiConsole.git
cd WeatherFlow_PiConsole/

# checkout the develop (aka beta) branch
git checkout develop

# patch the local develop branch wfpiconsole.sh script
# add one line "source $VENVDIR/bin/activate" on line 243
# above the 'already exists' line
vim wfpiconsole.sh

# run the locally-modified installer manually
# this does the right thing using 'develop'
bash wfpiconsole.sh install

# move the generated .service file aside
# temporarily to let us switch the installed
# tree to develop in the next step
mv wfpiconsole.service /home/pi/wfpiconsole.service

# checkout develop for the 'installed' /home/pi/wfpiconsole tree
git checkout develop

# put the generated service file back into place
cp /home/pi/wfpiconsole.service .

# at this point a start works with 'develop' prompts
wfpiconsole start

# presumably you'd later want to manually
# install the wfpiconsole.service file to start on boot....

# you might also patch (again)
# the wfpiconsole.sh script
# if you had to patch it to install above

```

---

<div class="post-metadata">

**Author:** ![peter](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/peter/32/1365_2.png) [@peter](https://community.tempest.earth/u/peter)\
**Post date:** [October 10, 2023, 7:35am UTC](https://community.tempest.earth/t/modified-piconsole-that-gets-data-from-udp/20209/19 "2023-10-10T07:35:00Z")

</div>

> [@vinceskahan](#):
>
> you need to patch wfpiconsole.sh to add the source $VENVDIR/bin/activate on line 243

Are you sure this is still necessary? Whenever the `.sh` script calls python, it is pointed to the venv version of python (i.e. `~/wfpiconsole/venv/bin/python3`) rather than the system version of python. This should avoid the requirement to activate the venv. I prefer this solution as it means when a user stops the console, they don’t also have to deactivate the venv in order to get back to their system python.

---

<div class="post-metadata">

**Author:** ![vinceskahan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/vinceskahan/32/2785_2.png) [@vinceskahan](https://community.tempest.earth/u/vinceskahan)\
**Post date:** [October 10, 2023, 6:12pm UTC](https://community.tempest.earth/t/modified-piconsole-that-gets-data-from-udp/20209/20 "2023-10-10T18:12:41Z")

</div>

Experimentally I’d say yes it’s needed for my scenario if you follow the exact steps I indicated.

I also agree with the rest of your commentary.

Remember, I’m trying to go straight to the venv future to-be without altering my os with the current ‘install modules to the os trees’ old way that main uses.

My guess is there’s something in your switch to beta flow that is either skipping something or clearing something out, but my memory is a little hazy there. Let me instrument my local copy of the script and see if I can get you some diagnostics to figure out where it’s happening…

[Next page](https://community.tempest.earth/t/modified-piconsole-that-gets-data-from-udp/20209.md?page=2)
