# WF PiConsole beta testing: UDP connection

**URL:** <https://community.tempest.earth/t/wf-piconsole-beta-testing-udp-connection/21084>\
**Category:** WeatherFlow PiConsole\
**Created:** [May 31, 2023, 2:24pm UTC](https://community.tempest.earth/t/wf-piconsole-beta-testing-udp-connection/21084 "2023-05-31T14:24:58Z")\
**Posts on this page:** 16\
**Page:** 2

<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:** [June 3, 2023, 6:36pm UTC](https://community.tempest.earth/t/wf-piconsole-beta-testing-udp-connection/21084/21 "2023-06-03T18:36:36Z")

</div>

Thanks for all the feedback everyone! I’m away on family holidays at the moment so won’t be able to fix anything, but do keep the bugs and suggestions in coming!

> [@DavidK](#):
>
> There are incoming thunderstorms and when used with UDP & REST API it doesn’t seem like the lightning panel is automatically displayed after a strike and the values on that panel aren’t being updated.

Ok, I’ll take a look at this. Are you referring to the “big” numbers showing the time and distance to the last strike? The “small” numbers showing the historical counts and frequency are updating?

> [@vinceskahan](#):
>
> =\> it would be nice to query up front for which mode to run in (websockets, UDP, or UDP+websockets) and to jump right there. Again, in a UDP-only mode I would ‘hope’ that users never need to enter any WF keys or info and that ‘no’ internet connectivity is ever required to WF even to install the console.

I pondered about this a lot while setting up UDP mode. My reasoning for the current iteration with Websocket as default and an internet connection required to setup is that a WF station cannot be setup without the internet, the PiConsole cannot be installed without the internet, and the websocket provides “better” data, hence the defaults I choose seemed justified. Added to this, soooo many users get thoroughly confused between station IDs, device IDs and serial numbers that I thought removing the requirement for users to enter the serial number was probably a good thing.

That being said, I can see why in your case these choices are not optimal at all.

> [@vinceskahan](#):
>
> =\> it would be nice(r) to get my PR merged when you get a chance to install a working demo mode that folks could reconfigure to taste, or alternately add a ‘skip’ feature for the questions it asks and put some failsafe into place. That would let folks set the console up without the WF side being done (yet).

This I think is the solution, and getting your PR merged is my intention before the UDP functionality becomes stable. The user can then choose to install a blank .ini file as either a “demo” mode or as an “advanced” installation option that allows them to configure the .ini file manually in a way that suits their setup by may violate the usual requirements. I could also allow an advance mode that does no verification when the user is asked to enter information and allows fields to be skipped. I’ll give this some thought!

> [@eric](#):
>
> the 24 hour trend is not showing yet and that is ok since it rebooted not so long ago.  
> But the trend °C/hr and barometer trends are empty since last re boot (where I disabled REST)

If REST is set to off, then this is expected behaviour. The PiConsole does no caching of data, so without the API it cannot calculate any trends or differences. This is something I could look at though.

> [@eric](#):
>
> my log file has a few new errors

That log file is busy!! It looks like some of your sensors were returning no data, and the API requests were failing for some reason (not sure why is REST services was set to off). Can you start again with a clean terminal and let me know what you see? It’ll be easier to pick out the errors.

> [@vinceskahan](#):
>
> I see the one last\_6hr message (why?)

This is probably the Sager forecast trying to hit the API. I realise I never added the API/no API checks to this module

---

<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:** [June 3, 2023, 6:52pm UTC](https://community.tempest.earth/t/wf-piconsole-beta-testing-udp-connection/21084/22 "2023-06-03T18:52:51Z")

</div>

Thanks - enjoy the holiday(s) !!!

One thing you might consider is permitting comments that persist in the .ini file - if you do that you could annotate the proposed example/demo .ini file and folks could understand that the differences between a TempestID for websockets vs. the TempestSN in the UDP messages (for one example).

One question though re: UDP only mode. How are you going to populate the panels for things that aren’t present in the UDP messages ? Examples would include things that accumulate (strike count/frequency, rain totals etc.). Would it be more appropriate to have them display N/A rather than - or 0 values ?

Re: the other questions from @davidk re: lightning, I tweaked my udp simulator to throw evt\_strike messages occasionally and I ‘do’ see the display autoswitch to that panel when one comes in, so that’s working as expected here FWIW. I’m in UDP only mode with rest turned off if that matters, so my setup is a little more LAN-only than his.

---

<div class="post-metadata">

**Author:** ![DavidK](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/davidk/32/9445_2.png) [@DavidK](https://community.tempest.earth/u/DavidK)\
**Post date:** [June 3, 2023, 7:02pm UTC](https://community.tempest.earth/t/wf-piconsole-beta-testing-udp-connection/21084/23 "2023-06-03T19:02:43Z")

</div>

> [@peter](#):
>
> Ok, I’ll take a look at this. Are you referring to the “big” numbers showing the time and distance to the last strike? The “small” numbers showing the historical counts and frequency are updating?

The historical (small) numbers were updating, but not the “big” ones.

---

<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:** [June 26, 2023, 3:52pm UTC](https://community.tempest.earth/t/wf-piconsole-beta-testing-udp-connection/21084/24 "2023-06-26T15:52:19Z")

</div>

@peter

I’ve updated both of my Rpi PiConsole(s) to the Beta version. Both are operating without any issues. Thanks, for what appears to be never ending improvements.

I was courious if it would be possible to also update to the Beta version on my Windows 11, PC setups?

I had in the past just cloned the ‘wfpiconsole’ folder from one of my Pi installs, and that worked most of the time. It didn’t depending on whatever changes you made, perhaps to some of the Python or Kivy code or some such modifications.  
I tried that cloning process without success … An suggestions? It would be nice to have a clean update routine on the Windows platform, but I understand that’s probably much easier said than done.

Thanks for all your efforts … I always look forward to your tweaks.

---

<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:** [June 27, 2023, 9:45am UTC](https://community.tempest.earth/t/wf-piconsole-beta-testing-udp-connection/21084/25 "2023-06-27T09:45:47Z")

</div>

> [@tcichowicz](#):
>
> I tried that cloning process without success … An suggestions? It would be nice to have a clean update routine on the Windows platform, but I understand that’s probably much easier said than done.

The cloning process _should_ work, assuming you have changed the `Hardware` key to `Other` on the Windows machine. I can’t think of any other changes I have made that would stop it working. What error are you seeing?

---

<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:** [June 27, 2023, 4:44pm UTC](https://community.tempest.earth/t/wf-piconsole-beta-testing-udp-connection/21084/26 "2023-06-27T16:44:07Z")

</div>

> [@tcichowicz](#):
>
> I tried that cloning process without success … An suggestions?

As always - suggest providing the logfile and/or console output that indicates it did not succeed. We can’t read minds.

---

<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:** [June 27, 2023, 5:30pm UTC](https://community.tempest.earth/t/wf-piconsole-beta-testing-udp-connection/21084/27 "2023-06-27T17:30:34Z")

</div>

> The cloning process _should_ work, assuming you have changed the `Hardware` key to `Other` on the Windows machine. I can’t think of any other changes I have made that would stop it working. What error are you seeing?

Thanks Peter …

as always you were spot on… It’s been quite awhile since I did a clone … I knew about the hardware key parameter, ‘Other’ that needed to be switched in the ini file. However, I forgot that I created specific wfpiconsole.ini files for each of my WF stations (one Tempest & one original Weatherflow). So on my desktop I have a icon to a batchfile that copies over the wfpiconsole.ini to correspond to the respective device’s unique IDs, etc…

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

So modified the root wfpiconsole.ini but it was written over immediately the first time I tried to launch!

All fixed now working like a charm…

Thanks again.

EDIT: I also noticed other parameters I didn’t expect that I also had to be sure were addressed with my 2 device setup that I have enabled.

Connection = UDP  
rest\_api = 1

```auto
[System]
Connection = UDP
rest_api = 1
SagerInterval = 6
Timeout = 20
Hardware = Other
Version = v23.5.beta

```

---

<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:** [July 23, 2023, 12:23pm UTC](https://community.tempest.earth/t/wf-piconsole-beta-testing-udp-connection/21084/28 "2023-07-23T12:23:49Z")

</div>

Hi all, thanks for all the testing so far. I have just released some more functionality to the beta branch. This includes the ability to configure the PiConsole to run in UDP mode without requiring a network connection (of course the internet is still required to install the console), and you can also now install a blank/example config file for demonstration purposes or advanced configuration if you don’t want to use the wizard. It would be great to get this functionality tested before it is released to the main branch.

To get the latest changes, run `wfpiconsole beta` in a terminal and then delete (or rename) your existing `wfpiconsole.ini` file. That will prompted the console to start the configuration wizard the next time you run the console.

---

<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:** [July 23, 2023, 5:42pm UTC](https://community.tempest.earth/t/wf-piconsole-beta-testing-udp-connection/21084/29 "2023-07-23T17:42:53Z")

</div>

Looks like it’s not quite there out of the box.

Installed via the curl | bash script, ran “wfpiconsole beta” to set it to beta. Then tried the first start. Transcripts below…

```auto
[INFO] [Logger] Record log in /home/pi/.kivy/logs/kivy_23-07-23_2.txt
[INFO] [Kivy] v2.1.0
[INFO] [Kivy] Installed at "/home/pi/.local/lib/python3.9/site-packages/kivy/ __init__.py"
[INFO] [Python] v3.9.2 (default, Mar 12 2021, 04:06:34)
[GCC 10.2.1 20210110]
[INFO] [Python] Interpreter at "/usr/bin/python3"
[INFO] [Logger] Purge log fired. Processing...
[INFO] [Logger] Purge finished!

  ===================================================
  Starting wfpiconsole configuration wizard
  ===================================================

  Welcome to the WeatherFlow PiConsole. You will now
  be guided through the initial configuration

  Required fields are marked with an asterix (*)

  Would you like to install a minimal configuration file
  for demonstration purposes or advanced setup?* [y/n] (n) [INFO] [Factory] 189 symbols loaded
[INFO] [Image] Providers: img_tex, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO] [Window] Provider: sdl2
[INFO] [GL] Using the "OpenGL ES 2" graphics system
[INFO] [GL] Backend used <sdl2>
[INFO] [GL] OpenGL version <b'2.1 Mesa 20.3.5'>
[INFO] [GL] OpenGL vendor <b'Broadcom'>
[INFO] [GL] OpenGL renderer <b'V3D 4.2'>
[INFO] [GL] OpenGL parsed version: 2, 1
[INFO] [GL] Shading version <b'1.20'>
[INFO] [GL] Texture max size <4096>
[INFO] [GL] Texture max units <16>
[INFO] [Window] auto add sdl2 input provider
[INFO] [Window] virtual keyboard not allowed, single mode, not docked
[INFO] [Text] Provider: sdl2(['text_pango'] ignored)
[INFO] [GL] NPOT texture support is available

  Sucesfully installed a minimal configuration file. Please edit
  this file manually to configure an advanced installation

 Traceback (most recent call last):
   File "/home/pi/wfpiconsole/main.py", line 552, in <module>
     wfpiconsole_app.run()
   File "/home/pi/.local/lib/python3.9/site-packages/kivy/app.py", line 954, in run
     self._run_prepare()
   File "/home/pi/.local/lib/python3.9/site-packages/kivy/app.py", line 924, in _run_prepare
     root = self.build()
   File "/home/pi/wfpiconsole/main.py", line 198, in build
     self.start_connection_service()
   File "/home/pi/wfpiconsole/main.py", line 407, in start_connection_service
     self.connection_thread.start()
 AttributeError: 'wfpiconsole' object has no attribute 'connection_thread'

```

Then on the next attempt to start…

```auto
[INFO] [Logger] Record log in /home/pi/.kivy/logs/kivy_23-07-23_3.txt
[INFO] [Kivy] v2.1.0
[INFO] [Kivy] Installed at "/home/pi/.local/lib/python3.9/site-packages/kivy/ __init__.py"
[INFO] [Python] v3.9.2 (default, Mar 12 2021, 04:06:34)
[GCC 10.2.1 20210110]
[INFO] [Python] Interpreter at "/usr/bin/python3"
[INFO] [Logger] Purge log fired. Processing...
[INFO] [Logger] Purge finished!
 Traceback (most recent call last):
   File "/home/pi/wfpiconsole/main.py", line 35, in <module>
     configFile.update()
   File "/home/pi/wfpiconsole/lib/config.py", line 277, in update
     if int(current_config['System']['rest_api']):
 ValueError: invalid literal for int() with base 10: ''

```

I noticed rest\_api = in the .ini and set it to 0, but the next attempt of starting again throws the connection thread error I got initially…

I manually edited the connection type to UDP and it ‘does’ start ok afterward, but I think the demo mode .ini file looks like it needs a little more work.

It would be really helpful if you’d do a quick readme file for how to start with a clean system to run the beta, as well as what the settings top+bottom of the file should be. What should they be to run clean in demo mode ? What should they be to run in UDP mode ? Assume we’re hand-editing the file rather than using the gui to do so (if the gui doesn’t start, that path is kinda not gonna work of course).

---

<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:** [July 23, 2023, 6:08pm UTC](https://community.tempest.earth/t/wf-piconsole-beta-testing-udp-connection/21084/30 "2023-07-23T18:08:01Z")

</div>

OK, everything should be fixed now. Fetch the fixes using `wfpiconsole beta` or a simple `git pull`. In demo mode, both `Connection` and `rest_api` in the `.ini` file should be blank. I will add some details to the README for how to configure the `.ini` file manually. But in a nutshell:

**UDP only**  
Both the Weatherflow and CheckWX keys should be blank.  
`Connection = UDP`  
`rest_api = 0`

**UDP + REST API**  
The Weatherflow and CheckWX keys should be specified.  
`Connection = UDP`  
`rest_api = 1`

**Websocket**  
The Weatherflow and CheckWX keys should be specified.  
`Connection = Websocket`  
`rest_api = 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:** [July 23, 2023, 8:59pm UTC](https://community.tempest.earth/t/wf-piconsole-beta-testing-udp-connection/21084/31 "2023-07-23T20:59:12Z")

</div>

Looks great. Thanks !!!

---

<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:** [July 23, 2023, 10:27pm UTC](https://community.tempest.earth/t/wf-piconsole-beta-testing-udp-connection/21084/32 "2023-07-23T22:27:22Z")

</div>

Likely nit bug…

In about line 176 of lib/derived\_variables.py you need a try/except block or a little rethinking of your if/elif block.

In UDP-only mode with just a device SN specified, it blows up because you set height based on the (non-existent) ID for the device, so the subsequent elevation+height goes boom.

I hacked mine to add two more elif(s) ala:

```auto
    # Extract required configuration variables
    elevation = config['Station']['Elevation']
    if str(device) == config['Station']['OutAirID']:
        height = config['Station']['OutAirHeight']
    elif str(device) == config['Station']['TempestID']:
        height = config['Station']['TempestHeight']
    elif str(device) == config['Station']['OutAirSN']:
        height = config['Station']['OutAirHeight']
    elif str(device) == config['Station']['TempestSN']:
        height = config['Station']['TempestHeight']

```

But maybe you might set height=0 initially above there as a failsafe perhaps (?)

---

<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:** [July 26, 2023, 4:47pm UTC](https://community.tempest.earth/t/wf-piconsole-beta-testing-udp-connection/21084/33 "2023-07-26T16:47:47Z")

</div>

Yep, good spot, that’s a bug. I will get that fixed up and then if nothing else pops up I will push this all into a new release

---

<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:** [July 27, 2023, 4:09pm UTC](https://community.tempest.earth/t/wf-piconsole-beta-testing-udp-connection/21084/34 "2023-07-27T16:09:04Z")

</div>

Does this fix actually work for you? I am finding that `device` is completely empty at this point in the code because when only a device SN is specified in the config file, the code still tries to set the value of `device` to the device ID from the config file (which is empty).

---

<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:** [July 27, 2023, 4:24pm UTC](https://community.tempest.earth/t/wf-piconsole-beta-testing-udp-connection/21084/35 "2023-07-27T16:24:26Z")

</div>

Let me do a clean installation and get you diffs on the .ini file from what it installs vs. what I got to 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:** [July 27, 2023, 5:30pm UTC](https://community.tempest.earth/t/wf-piconsole-beta-testing-udp-connection/21084/36 "2023-07-27T17:30:37Z")

</div>

Actually I found another way if it helps any…

Simply set the TempestID to any bogus value and the TempestHeight to 0 and it works with no code edits. This works vs. my wfudpsimulator which emits ST-00000001 as the tempest SN.

```auto
--- wfpiconsole.ini.1	2023-07-27 10:27:28.811863205 -0700
+++ wfpiconsole.ini	2023-07-27 10:25:11.861119381 -0700
@@ -4,15 +4,15 @@

 [Station]
 StationID =
-TempestID =
-TempestSN =
+TempestID = 12345
+TempestSN = ST-00000001
 SkyID =
 SkySN =
 OutAirID =
 OutAirSN =
 InAirID =
 InAirSN =
-TempestHeight =
+TempestHeight = 0
 SkyHeight =
 OutAirHeight =
 Latitude = 51.5072
@@ -68,8 +68,8 @@
 PanelSix = Lightning

 [System]
-Connection =
-rest_api =
+Connection = UDP
+rest_api = 0
 SagerInterval = 6
 Timeout = 20
 Hardware = Pi4

```

[Previous page](https://community.tempest.earth/t/wf-piconsole-beta-testing-udp-connection/21084.md?page=1)
